- For giving, taking, counting and choosing Pokémon, see Manipulating Pokémon.
This page describes how to edit the attributes of a Pokémon, such as its gender, owner or ribbons.
Deciding which Pokémon to edit
The first step is to find the Pokémon to edit. This can be done a variety of different ways depending on the circumstances. For example:
pkmn = $player.party[0] pkmn = $player.first_able_pokemon pkmn = $player.last_pokemon pkmn = pbGetPokemon(1)
These will all return a Pokémon (if possible) and call it "pkmn
". This page assumes that the Pokémon being edited is referred to as "pkmn
".
Attributes that can be edited
Attribute | Code | Description |
---|---|---|
Ability | pkmn.ability_index = 2 pkmn.ability = :INTIMIDATE
|
To set the Pokémon's ability to one that is defined as available to its species, set its ability_index to the appropriate number. 0 is the first regular ability, 1 is the second regular ability, and 2+ are hidden abilities. Use pkmn.ability_index = nil to make the choice of ability be determined by the Pokémon's personal ID.
To set the Pokémon's ability to any existing ability at all, simply set its |
Contest stats | pkmn.beauty = 42
|
Sets the Pokémon's contest stats. Each stat should be a number between 0 and 255 inclusive.
Note that these properties are currently unused (except beauty for Feebas' evolution). |
Discardable | pkmn.cannot_store = true pkmn.cannot_trade = true pkmn.cannot_release = true
|
Puts restrictions on how the player can remove the Pokémon from their party/ownership. Setting cannot_store means the Pokémon cannot be put into Pokémon storage or the Day Care.
|
EVs | pkmn.ev[:DEFENSE] = 42
|
Sets the Pokémon's EVs for a given stat. Each stat should be a number between 0 and 252 inclusive. The possible stats (as mentioned in the square brackets) are as follows:
|
Experience | pkmn.exp = 12345
|
Sets the Pokémon's Experience Points. You will usually want to add/subtract amounts from this, rather than setting it to a specific new value. |
First moves | pkmn.add_first_move(:TACKLE)
|
Registers a move as being a first-known move for the Pokémon (which it can relearn via the Move Relearner). The second option takes all moves currently known by the Pokémon and registers those as its first-known moves (all other first-known moves are cleared). The last option will clear a particular move from the Pokémon's list of first-known moves (it does nothing if it wasn't a first-known move). |
Form | pkmn.form = 1
|
Sets the Pokémon's form. 0 is the default form as defined in the PBS file "pokemon.txt".
Some Pokémon species determine their form automatically depending on various factors. Their form cannot be manually changed this way, as they will immediately change back. You can alter the code responsible for this automatic determination to not recalculate if the form is currently a particular number(s), allowing you to set the Pokémon's form to that number(s) this way. Setting a Pokémon's form will also recalculate its stats and mark it as seen in the Pokédex. It will also trigger any changes that happen when the Pokémon changes form, such as trying to learn a form-specific move for Rotom. |
Fused Pokémon | pkmn.fused = pkmn2
|
Sets the Pokémon which is fused with this Pokémon. pkmn2 is itself a Pokémon and can itself be edited. Use pkmn.fused = nil to erase the fused Pokémon.
|
Gender | pkmn.makeMale pkmn.makeFemale
|
Sets the Pokémon's gender to male or female. This cannot make a Pokémon a gender it cannot legally be. Use pkmn.gender = nil to remove the override and have the gender be determined by the Pokémon's personal ID.
You will also need to record the new gender as seen, so that it will show up in the Pokédex. To do this, use |
Happiness | pkmn.happiness = 200 pkmn.changeHappiness("walking")
|
Sets the Pokémon's happiness. This should be a number between 0 and 255 inclusive.
The second line of code will change the Pokémon's happiness as it would change if triggered by a particular event. This takes into account modifiers such as the Soothe Bell and Luxury Ball. The possible events are:
|
Hatched map | pkmn.hatched_map = 42
|
Sets the ID of the map in which the Pokémon hatched from an egg. Is used only if the Pokémon's obtain method is "egg received". |
Hatched time | pkmn.timeEggHatched = Time.now
|
Sets the time at which the Pokémon hatched from an egg. Can only be set if the Pokémon's obtain method is "egg received", and is only used in that case. |
Held item | pkmn.item = :ORANBERRY
|
Sets the Pokémon's held item. Use pkmn.item = nil to delete the held item.
If the item is a mail item, then If the item is a mail item which shows Pokémon on it, then this should instead be: |
HP | pkmn.hp = 42
|
Sets the Pokémon's current HP. The second option fully restores the Pokémon's HP. The last option will fully restore the Pokémon's HP, cure its status problem, and restore all its moves' PP to full. |
IVs | pkmn.iv[:DEFENSE] = 7
|
Sets the Pokémon's IVs for a given stat. Each stat should be a number between 0 and 31 inclusive. The possible stats (as mentioned in the square brackets) are as follows:
|
Level | pkmn.level = 42
|
Sets the Pokémon's current level.
What it actually does is change the Pokémon's " |
Markings | pkmn.markings = [0, 1, 1, 0, 0, 2]
|
Sets the Pokémon's markings. The values in this array correspond to the marking graphics in order from the file "Graphics\Pictures\Summary\markings.png" - the first array value is the first marking, the second array value is the second marking, etc. Marking graphics are arranged horizontally in their graphic.
Each marking has multiple variants, which are arranged vertically. Variants are typically different colors of the same symbol, with the first variant being "no color/doesn't have this marking". There can be any number of variants of each marking (simply add them to the graphic), but every marking must have the same number of variants. By default, the markings in order are ●▲■♥★♦, and the variants are "none"/"black"/"blue"/"pink". The example given here corresponds to a black ▲, a black ■ and a blue ♦ (the other symbols are not colored in). |
Moves | pkmn.learn_move(:TACKLE)
|
The first option teaches a move to the Pokémon. This can teach any move, and will do so without informing the player. If the Pokémon already knows a full set of moves, the first move will be forgotten, the others bumped up and the new move added to the end.
The second option deletes a move from the Pokémon, if it knows it. Again, this will happen without informing the player. Note that this is able to make a Pokémon forget its last move. The third option resets the Pokémon's moveset to what a wild Pokémon of that species/level/form would know. This can be useful when changing a Pokémon's level/form. |
Nature | pkmn.nature = :HASTY
|
Sets the Pokémon's nature. Use pkmn.nature = nil to remove the override and have the nature be determined by the Pokémon's personal ID.
|
Nickname | pkmn.name = "Dave"
|
Sets the Pokémon's nickname to a given phrase. Use pkmn.name = nil to remove the nickname.
To let the player choose their own name, simply call |
Obtain level | pkmn.obtain_level = 42
|
Sets which Level the Pokémon was at when it was obtained. |
Obtain map | pkmn.obtain_map = 42
|
Sets the map in which the Pokémon was obtained. |
Obtain method | pkmn.obtain_method = 1
|
Sets the method by which the Pokémon was obtained. The number is either 0 ("met"), 1 ("egg received", i.e. it then hatched), 2 ("traded") or 4 ("fateful encounter").
|
Obtain text | pkmn.obtain_text = "Day-Care Couple"
|
Sets the phrase to use, instead of the obtain map's name, as the place where the Pokémon was obtained. Use pkmn.obtain_text = nil to remove the phrase.
|
Owner's gender | pkmn.owner.gender = 1
|
Sets the gender of the Pokémon's original owner. The number is either 0 (male), 1 (female), 2 (mixed) or 3 (unknown).
|
Owner's ID number | pkmn.owner.id = $Trainer.id pkmn.owner.id = $player.make_foreign_ID
|
Sets the ID number of the Pokémon's original owner. The first option sets it to the player's ID number, and the second option sets it to a random other ID number.
This and the original owner's name determine whether the Pokémon originally belonged to the player or not. |
Owner's language | pkmn.owner.language = 2
|
Sets the language of the Pokémon's original owner. Is one of the following:
|
Owner's name | pkmn.owner.name = "Dave"
|
Sets the name of the Pokémon's original owner.
This and the original owner's ID number determine whether the Pokémon originally belonged to the player or not. |
Personal ID | pkmn.personalID = rand(2 ** 16) | rand(2 ** 16) << 16
|
Sets the Pokémon's personal ID. The example will randomise the Pokémon's personal ID, although it can also be set to any value between 0 and 4,294,967,295 inclusive.
Note that the Pokémon's gender, nature, ability and shininess all depend on the value of the personal ID by default. Spinda's spot locations and the evolution methods "Silcoon" and "Cascoon" also depend on it. |
Poké Ball | pkmn.poke_ball = :ULTRABALL
|
Sets the type of Poké Ball the Pokémon is contained in. This is the ID of a Poké Ball item. |
Pokérus | pkmn.givePokerus pkmn.givePokerus(4)
|
Gives the Pokémon Pokérus. The parameter is optional, and is the strain of Pokérus to give (between 1 and 15 inclusive; the strain is randomly chosen if not given). The strain number determines how many days the Pokémon will be infected for before becoming immune.
|
Ribbons | pkmn.giveRibbon(:HOENNCOOL) pkmn.takeRibbon(:HOENNCOOL)
|
Gives the Pokémon the specified ribbon (or removes it).
There are a few other methods dealing with ribbons:
|
Shadowness | pkmn.makeShadow
|
Makes the Pokémon a Shadow Pokémon. It is not so easy to turn a Shadow Pokémon into a regular Pokémon, though.
|
Shininess | pkmn.shiny = true pkmn.super_shiny = true pkmn.super_shiny = false
|
Makes the Pokémon shiny or super shiny, or not. Use both pkmn.shiny = nil and pkmn.super_shiny = nil to remove the overrides and have the shininess be determined by the Pokémon's personal ID.
|
Species | pkmn.species = :BULBASAUR
|
Sets the Pokémon's species. This will also recalculate the Pokémon's level, ability and stats. |
Status | pkmn.status = :POISON
|
Sets the Pokémon's status. The possible statuses are:
If putting the Pokémon to sleep, then |
Steps to hatch | pkmn.steps_to_hatch = 5120
|
Sets the number of steps required for the Pokémon egg to hatch. If this is 0, pkmn is a Pokémon and not an egg.
|
Time received | pkmn.timeReceived = Time.now
|
Sets the time when the Pokémon was obtained. |
What can't be changed
There are some attributes of a Pokémon that cannot be changed directly. These are:
- Types
- Stats:
- Maximum HP
- Attack
- Defense
- Special Attack
- Special Defense
- Speed
- Height
- Weight
- EV yield
The last part of editing a Pokémon
Once a Pokémon's attributes have been edited, its stats may need to be recalculated. This is done by the following line of code:
pkmn.calc_stats
To be safe, you should always include this line after all other edits.