• 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.

Ability cloning Zen Mode?

148
Posts
11
Years
I'd like make a new ability that does just what the Zen Mode ability does, once a certain Hp is reached the Pokemon's sprite and stats change. Is it even possible to make new ones? I've been looking through the scripts and so far found the following about Zen Mode. Where are the scripts telling the game which stats to change when the ability starts? If anyone can help I would be very grateful. Just trying to learn as much about this as I can.

# Zen Mode
if isConst?(self.species,PBSpecies,:DARMANITAN) && hp>0
if isConst?(self.ability,PBAbilities,:ZENMODE)
if @hp<=((@totalhp/2).floor)
if self.form!=1
self.form=1; transformed=true
end
else
if self.form!=0
self.form=0; transformed=true
end
end
else
if self.form!=0
self.form=0; transformed=true
end
end
end
 
185
Posts
12
Years
  • Seen Apr 7, 2014
That looks like you'd just change "DARMANITAN" to the Pokemon with this ability, and change "ZENMODE" to the form it takes. This page details multiple forms, which you'd use to set up the form the ability uses.
 
148
Posts
11
Years
Thank you. Something happened during the battle. I gave the new form new stats graphic and moves but the moves didn't change. And even though I changed the stats the damage from my it's attacks don't seem to do any more damage. After the transformation I checked it's stats and they all changed to what I set them to though. Any help for me there?
 
Last edited:

Maruno

Lead Dev of Pokémon Essentials
5,285
Posts
16
Years
The only Pokémon which changes its current moveset upon changing its form is Rotom, and that only happens in a safe and controlled environment. My advice is that you don't try to change your Pokémon's moves during battle, because there's all kinds of complications to it.

To make sure your Pokémon's form is only changed during battle, and reverts back to normal afterwards, find the method immediately below the one you found and quoted, and add in a similar bit of code for your Pokémon.

The damage inflicted by moves naturally varies by about 15% each way anyway. Unless you made a drastic change to the Atk/Sp Atk, you probably won't notice a difference. If you only changed one of those two stats, make sure you're testing it by using a move that will use that stat (i.e. Atk is Physical, Sp Atk is Special).
 
148
Posts
11
Years
Thank you for letting me know abut that. Trying to change it's moves was starting to get to me. I made it so the pokemon stays in the new form even outside battle when it's Hp is low. As for the stat changes, to see if I was doing it right I made it so the normal forms attack was 60 and the new form was over 200. When the pokemon changes in battle there doesn't seem to be a difference in damage but if it enters the battle already transformed then it's attacks are taking out everything in one hit. Is there something I may have changed that I shouldn't have to make this happen?
 

Awkward Squirtle

,@,e .ºoO
110
Posts
12
Years
  • Seen Jan 29, 2016
IIRC the PokeBattle_Battler class stores stats separately from the PokeBattle_Pokemon class. I suspect the Zen Mode code (and by extension, your custom code) isn't updating the PokeBattle_Battler stats to match the PokeBattle_Pokemon stats. Maruno, could you confirm/deny?
 

Maruno

Lead Dev of Pokémon Essentials
5,285
Posts
16
Years
I presume you made a "getForm" procedure for your Pokémon in order to make sure its form changes outside of battle properly (which could happen due to poisoning).

The stats not changing in battle is an oversight on my part. In PokeBattle_Battler, find def pbUpdate and add this:

Code:
  def pbUpdate(fullchange=false)
    if @pokemon
      [COLOR=Red]@pokemon.calcStats[/COLOR]
      if fullchange
        @[email protected]
        @[email protected]
Bear in mind that there's a very good reason why, of all the base stats, the HP stat never changes between forms - it would affect the current HP as well, and that's too fiddly to deal with. Make sure any of your Pokémon with multiple forms never change their HP stat.
 
185
Posts
12
Years
  • Seen Apr 7, 2014
I'm a bit late, but instead of having the moveset change in-battle along with the form, what about giving it a signature move with an effect that depends on the form? Would that be possible?
 
148
Posts
11
Years
Like a move that once in the new form, would add burn or freeze? Or change type from say fire to Dark? That would be cool. Looking at Judgment I could maybe make a move that changes type when the new form is used but I have no idea how I could add effects once it transforms.
 
Last edited:

Maruno

Lead Dev of Pokémon Essentials
5,285
Posts
16
Years
That's certainly possible. Part of the move's effect as defined in PokeBattle_MoveEffects (under its own function code) should be to check the user's form, and do something depending on it. You can change pretty much anything about a move this way (except its name/PP).

Compare with Curse, which does different things depending on the user's type.
 
148
Posts
11
Years
I took a look at PokeBattle_MoveEffects. Scripting was never my strong suit, but I tried piecing together code for an attack to hit twice, and when the user is part Ghost it would double damage hit twice and paralyze. Could one of you check over the code? I know there's stuff wrong with it but I would never be able to find out what myself.

################################################################################
# Hits twice. If Ghost Type hits twice paralyze and double damage.
################################################################################
class PokeBattle_Move_133 < PokeBattle_Move
def pbIsMultiHit
return true
end

def pbNumHits
return 2
end
end
def pbBaseDamage(damage,attacker,opponent)
if !attacker.pbHasType?(:GHOST)
damage*=2
end
return damage
end
return -1 if !opponent.pbCanParalyze?(true)
@battle.pbAnimation(@id,attacker,opponent)
opponent.pbParalyze(attacker)
@battle.pbDisplay(_INTL("{1} is paralyzed! It may be unable to move!",opponent.pbThis))
return 0
end
end
 

Maruno

Lead Dev of Pokémon Essentials
5,285
Posts
16
Years
That's a bit of a jumble. Study the following and see if you can spot where you went wrong:

Code:
################################################################################
# Hits twice. If user is Ghost-type, also doubles damage and paralyzes target.
################################################################################
class PokeBattle_Move_133 < PokeBattle_Move
  def pbIsMultiHit
    return true
  end

  def pbNumHits
    return 2
  end

  def pbBaseDamage(damage,attacker,opponent)
    damage*=2 if attacker.pbHasType?(:GHOST)
    return damage
  end

  def pbAdditionalEffect(attacker,opponent)
    return false if !attacker.pbHasType?(:GHOST)
    return false if !opponent.pbCanParalyze?(false)
    opponent.pbParalyze(attacker)
    @battle.pbDisplay(_INTL("{1} was paralyzed!  It may be unable to move!",opponent.pbThis))
    return true
  end
end
The move as defined in moves.txt should have an additional effect chance of whatever percentage chance you want the paralysis to be (apparently 100 for "always"). The move will always hit twice in a row (regardless) and do double damage (if the user is a Ghost type).
 
148
Posts
11
Years
The first part I think I see how it's supposed to be, adding effects still seems complicated but Looking at this I think I'll be able to make others like this. Thanks so much for fixing the code for me. If I wanted to have this without the paralyze would I just get rid of everything after "def pbAdditionalEffect" and put a second end?
 

Maruno

Lead Dev of Pokémon Essentials
5,285
Posts
16
Years
To remove the paralysing effect, just remove the lines between (and including) def pbAdditionalEffect(attacker,opponent) and the penultimate end. No need to add anything.

Hint: A method always begins with a line saying def something, and ends with a line saying end. To delete a method, delete those two lines and everything in between. Line indents are very helpful when deciding which end belongs with each def (the two should have the same amount of indent).
 
Back
Top