• Our software update is now concluded. You will need to reset your password to log in. In order to do this, you will have to click "Log in" in the top right corner and then "Forgot your password?".
  • Welcome to PokéCommunity! Register now and join one of the best fan communities on the 'net to talk Pokémon and more! We are not affiliated with The Pokémon Company or Nintendo.

[Scripting Question] Adding Terrain-Changing Abilities

sonicfan7895

Just a dude, I guess
122
Posts
13
Years
Hello!

I'm back, and hopefully I don't figure out the problem and look like an idiot for not testing out something sooner!

So since I don't have any Gen VII Pokes, or any of the scripts for them (specifically, the Tapus), I'm trying to recreate their terrain-changing abilities in 16.2 (because we don't want to spend hours porting all the scripts and all the changes we made to a newer version).

I'm trying to add in an effect that not only boosts certain type moves, but affects Camoflauge (who uses that anymore?), Nature Power, Secret Power, and transforms Giratina while the field is in effect.

Without access to those scripts, how would I go about recreating those abilities held by the Tapus?

Any help would be appreciated! I tried to treat it like a weather-changing ability, but it never works like that.

Thanks!
 
6
Posts
5
Years
  • Age 43
  • Seen Sep 12, 2020
the terrains themselves are coded in 17x and I believe you can port them to 16x without issues. though the surge abilities i'll try and code below.
it's divided between the messages that pop up in Pokebattle_Battle and the actual effects spread around Pokebattle_Move, Pokebattle_MoveEffects and Pokebattle_BattlerEffects. you can use the search thingy in the script editor.

if you want to code them yourself:

you have to use a field effect instead of a weather (those are in PBEffects, close to things like trick room, magic room and gravity):

first you define the effect there. in the part that says "these affect both sides" add the line:
MISTYTERRAIN = (any number not used in that bunch of effects)

then an ability that applies it ("coded" it on the fly based on intimidate, tell me if it works cause i'll use it too XD):
paste this in PokeBattle_Battler, below the code for intimidate:

if self.hasWorkingAbility(:MISTYSURGE) && onactive
PBDebug.log("[#{pbThis}: has Misty Surge]")
@battle.pbDisplayEffect(self)
@field.effects[PBEffects::MistyTerrain]=5
end

also a move effect in MoveEffects that applies it (this one was in 17x):

class PokeBattle_Move_XXX < PokeBattle_Move #replace XXX with an unused effect number
def pbEffect(attacker,opponent,hitnum=0,alltargets=nil,showanimation=true)
if @battle.field.effects[PBEffects::MistyTerrain]>0 #this makes the move fail if Misty Terrain is already on
@battle.pbDisplay(_INTL("But it failed!"))
return -1
end
pbShowAnimation(@id,attacker,nil,hitnum,alltargets,showanimation)
@battle.field.effects[PBEffects::TerrainY]=0 #this makes the move eliminate other similar terrain effects
@battle.field.effects[PBEffects::TerrainZ]=0
@battle.field.effects[PBEffects::MistyTerrain]=5 #this makes the move set Misty Terrain to last 5 turns
@battle.pbDisplay(_INTL("Misty Terrain was applied!"))
return 0
end
end

and then go into Pokebattle_Move/Battle/etc and add conditions like:
if @battle.field.effects[PBEffects::MistyTerrain]>0
to any move/effect/ability that interacts with the terrain.

I need to sleep lol
 

HM100

HM100 the Techno
113
Posts
7
Years
  • Age 23
  • Seen Mar 24, 2024
the terrains themselves are coded in 17x and I believe you can port them to 16x without issues. though the surge abilities i'll try and code below.
it's divided between the messages that pop up in Pokebattle_Battle and the actual effects spread around Pokebattle_Move, Pokebattle_MoveEffects and Pokebattle_BattlerEffects. you can use the search thingy in the script editor.

if you want to code them yourself:

you have to use a field effect instead of a weather (those are in PBEffects, close to things like trick room, magic room and gravity):

first you define the effect there. in the part that says "these affect both sides" add the line:
MISTYTERRAIN = (any number not used in that bunch of effects)

then an ability that applies it ("coded" it on the fly based on intimidate, tell me if it works cause i'll use it too XD):
paste this in PokeBattle_Battler, below the code for intimidate:

if self.hasWorkingAbility(:MISTYSURGE) && onactive
PBDebug.log("[#{pbThis}: has Misty Surge]")
@battle.pbDisplayEffect(self)
@field.effects[PBEffects::MistyTerrain]=5
end

also a move effect in MoveEffects that applies it (this one was in 17x):

class PokeBattle_Move_XXX < PokeBattle_Move #replace XXX with an unused effect number
def pbEffect(attacker,opponent,hitnum=0,alltargets=nil,showanimation=true)
if @battle.field.effects[PBEffects::MistyTerrain]>0 #this makes the move fail if Misty Terrain is already on
@battle.pbDisplay(_INTL("But it failed!"))
return -1
end
pbShowAnimation(@id,attacker,nil,hitnum,alltargets,showanimation)
@battle.field.effects[PBEffects::TerrainY]=0 #this makes the move eliminate other similar terrain effects
@battle.field.effects[PBEffects::TerrainZ]=0
@battle.field.effects[PBEffects::MistyTerrain]=5 #this makes the move set Misty Terrain to last 5 turns
@battle.pbDisplay(_INTL("Misty Terrain was applied!"))
return 0
end
end

and then go into Pokebattle_Move/Battle/etc and add conditions like:
if @battle.field.effects[PBEffects::MistyTerrain]>0
to any move/effect/ability that interacts with the terrain.

I need to sleep lol

No the terrains were available since Essentials 16. Just the person must be using Essentials 15 or I'm wrong.
 
Back
Top