v21.1 How to add a new ability ?

This thread pertains to v21.1 of Pokémon Essentials.

Friloweye

Rookie
Member
Joined
Aug 22, 2023
Posts
4
Age
19
I've already checked the forum but it's not really precise and i can't find a video or a webpage to explain how it's done, i'm trying to add more recent pokemon to the game, and new abilities have to be added too, abilities is the only part i don't know how to manage
 

LinKazamine

Elite Trainer
Member
Joined
May 24, 2023
Posts
288
Pokemon and abilities up to gen 8 are already included in vanilla Pokemon Essentials. The proper PBS files for them are in the gen 8 folder inside the PBS folder. They only lack sprites and cries that you can get from the Gen 8 pack. There's also a gen 9 pack that includes the pokemon, attacks and abilities from the newest generation. Both packs are in this forum.

This one for the gen 8 pack. In the discussion is a link to download the Pokemon Essentials v21 version of the plugin:

This one is for the gen 9 pack. The next update will be compatible with v21:

In any case, you can download the gen 9 pack and see how it makes the abilities and moves if you want to try it on your own.
 

Spudfin

Novice
Member
Joined
Aug 20, 2023
Posts
11
New abilities can be easier or harder to define depending on what they are, but are generally easier to define if they're similar to a pre-existing ability. To start, go to the abilities file in PBS, then define the ID, name, and description using the same format as the other abilities.

For the actual coding, next go to into your scripts and go to the Battle_AbilityEffects tab. From here, you can find how most abilities were coded and use them to code your own. For an example of a simple one, I'm planning on adding an ice-type version of Sandygast to my game. Sandygast normally has an ability called Water Compaction which raises its Defense by two stages when it's hit by a water-type move. Since giving it Water Compaction as an ability no longer makes sense, I want to give it an ability called Refreeze that's functionally identical but triggers when it's hit by a fire-type move. To do so, I should first look at how Water Compaction is coded:

Code:
Battle::AbilityEffects::OnBeingHit.add(:WATERCOMPACTION,
  proc { |ability, user, target, move, battle|
    next if move.calcType != :WATER
    target.pbRaiseStatStageByAbility(:DEFENSE, 2, target)
  }
)

Since this one's simple, all I need to do is change WATERCOMPACTION to REFREEZE, and WATER to FIRE. Here's my result:

Code:
Battle::AbilityEffects::OnBeingHit.add(:REFREEZE,
  proc { |ability, user, target, move, battle|
    next if move.calcType != :FIRE
    target.pbRaiseStatStageByAbility(:DEFENSE, 2, target)
  }
)

Now all I need to do is apply it to a Pokemon in the pokemon text file, and it see if it works when tested (which it did).

Obviously most new abilities are going to be a lot more complicated. I'm still pretty new to this myself, so I'm not an expert at making them. If there are any particular abilities you struggle with, you can always make another post asking for help. One final tip is that you can also look in the scripts for how certain moves are coded which can also help with making new abilities. For example, if you want an ability that triggers if the user wasn't hit this turn, try looking at the code for Focus Punch.

Feel free to ask if you have any questions.
 
Top