Essentials Docs Wiki

The Essentials wiki has moved and is now at: Essentials Engine wiki

This wiki will no longer be updated.

READ MORE

Essentials Docs Wiki
Maruno (talk | contribs)
mNo edit summary
Line 336: Line 336:
   
 
* Merge two or more existing methods together into a new one.
 
* Merge two or more existing methods together into a new one.
* Evolution that depends on the Pokémon's nature or form.
+
* Evolution that depends on the Pokémon's nature or form. (e.g. Toxtricity)
 
* Fusion evolution (e.g. for Magnemite/Slowpoke). Check that there is a Shellder in the party, and if so, delete it and evolve the levelled-up Slowpoke.
 
* Fusion evolution (e.g. for Magnemite/Slowpoke). Check that there is a Shellder in the party, and if so, delete it and evolve the levelled-up Slowpoke.
 
* Change the Pokémon's form depending on how it evolves (e.g. Rockruff into Lycanroc). This is done by setting the form immediately before returning <code>poke</code> in the evolution method's code. This assumes the unevolved Pokémon doesn't have multiple forms, only the evolved species.
 
* Change the Pokémon's form depending on how it evolves (e.g. Rockruff into Lycanroc). This is done by setting the form immediately before returning <code>poke</code> in the evolution method's code. This assumes the unevolved Pokémon doesn't have multiple forms, only the evolved species.

Revision as of 03:09, 15 January 2020

Evolution

Pikachu is evolving!

For defining evolutions for particular species, see Defining a species.

This page describes Pokémon evolution. It details the different evolution methods available by default, and explains how to create new evolution methods.

Evolution methods

Pokémon can evolve in a variety of different ways, from gaining a level to gaining a new owner, or if it just really likes you. Nearly all evolution methods that exist in the Pokémon games have been coded into Essentials. There is even space for you to invent a few new methods of your own.

The evolution paths for a species are listed in the PBS file "pokemon.txt" as a series of comma-separated triplets. Each triplet describes one evolution branch, and contains the following information:

  1. The internal name of the species to evolve into.
  2. The name of the evolution method used.
  3. A special parameter the evolution method may use, such as a level number or item's internal name.

Each evolution method is checked in the order they are listed in the PBS file "pokemon.txt". If the Pokémon being checked can evolve through several different methods, and fulfills the criteria for more than one of them at the same time (e.g. Eevee can fulfill both happiness and location at the same time), it will evolve using the first listed method and ignore all the others.

Leveling-up evolution methods

The evolution methods that are checked whenever a Pokémon is leveled up are listed in the script section Pokemon_Evolution in def pbMiniCheckEvolution, and are as follows:

Method name Parameter Notes Pokémon that use this method
Level Level The Pokémon will evolve when it levels up, if its level is greater than or equal to the parameter. Most Pokémon
LevelMale Level Exactly the same as "Level", except the Pokémon must also be male. Burmy
LevelFemale Level Exactly the same as "Level", except the Pokémon must also be female. Burmy, Combee
LevelDay Level Exactly the same as "Level", but will only evolve during the daytime. Fomantis, Tyrunt, Yungoos
LevelNight Level Exactly the same as "Level", but will only evolve during the night-time. Amaura, Cubone (Alolan), Rattata (Alolan)
DayHoldItem Item The Pokémon will evolve if it levels up during the daytime while holding a particular item (named by the parameter). Happiny
NightHoldItem Item The Pokémon will evolve if it levels up during the night-time while holding a particular item (named by the parameter). Gligar, Sneasel
HasMove Move The Pokémon will evolve if it levels up while knowing a particular move (named by the parameter). Aipom, Bonsly, Lickitung, Mime Jr., Piloswine, Tangela, Yanma
Beauty Minimum beauty level The Pokémon will evolve when it levels up, if its beauty stat is greater than or equal to the parameter. Feebas
HasInParty Species The Pokémon will evolve if it levels up while the player has a Pokémon of a certain species in their party (named by the parameter). The named Pokémon is unaffected. Mantyke
LevelDarkInParty Level Exactly the same as "Level", but will only evolve if the player has a Dark-type Pokémon in their party. Pancham
AttackGreater Level Exactly the same as "Level", except the Pokémon's Attack stat must also be greater than its Defense stat. Tyrogue
AtkDefEqual Level Exactly the same as "Level", except the Pokémon's Attack stat must also be equal to its Defense stat. Tyrogue
DefenseGreater Level Exactly the same as "Level", except the Pokémon's Attack stat must also be lower than its Defense stat. Tyrogue
Silcoon Level Exactly the same as "Level", except the last digit of the Pokémon's decimalised personal ID number must also be one of 0, 1, 2, 3 or 4. Wurmple
Cascoon Level Exactly the same as "Level", except the last digit of the Pokémon's decimalised personal ID number must also be one of 5, 6, 7, 8 or 9. Wurmple
Ninjask Level Exactly the same as "Level". There is no difference between the two methods at all. Is used alongside the method "Shedinja". Nincada
Shedinja Level Must be used with the method "Ninjask". Duplicates the Pokémon that just evolved (if there is an empty space in the party), and changes the duplicate's species to the given species. Nincada
LevelRain Level Exactly the same as "Level", but will only evolve if the overworld weather is some kind of rain (including storm). Sliggoo
Location Map ID The Pokémon will evolve when it levels up, if the player is currently on the map given by the parameter.

This method should be listed in the PBS file "pokemon.txt" before any others, because it is supposed to take priority over them (e.g. a happy Eevee should evolve into Leafeon, not Espeon/Umbreon, in the appropriate place).

Eevee, Magneton, Nosepass
Happiness - The Pokémon will only evolve if its happiness is greater than or equal to 220. This number is set in the evolution method's code itself, so changing it will affect all Pokémon with this evolution method. Azurill, Buneary, Chansey, Cleffa, Golbat, Igglybuff, Munchlax, Pichu, Swadloon, Togepi, Woobat
HappinessDay - Exactly the same as "Happiness", but will only evolve during the daytime. Budew, Eevee, Riolu
HappinessNight - Exactly the same as "Happiness", but will only evolve during the night-time. Chingling, Eevee
HappinessMoveType Move Exactly the same as "Happiness", but will only evolve if the Pokémon knows a move of a certain type (named by the parameter). Eevee
Custom1 ... Custom5 Number between 0 and 65535 Unused methods, but can be used to create new evolution methods. -

Using an item evolution methods

The following three evolution methods are checked when an item (typically an evolution stone) is used on a Pokémon, rather than whenever it levels up. These methods are listed in def pbMiniCheckEvolutionItem, which is just below the one for the above methods.

The difference between the methods above and the three below is that the evolution cannot be cancelled for the three methods below.

Method name Parameter Notes Pokémon that use this method
Item Item The Pokémon will evolve if a particular item is used on it (named by the parameter - typically an evolution stone). Clefairy, Cottonee, Eelektrik, Eevee, Exeggcute, Gloom, Growlithe, Jigglypuff, Lampent, Lombre, Minccino, Misdreavus, Munna, Murkrow, Nidorina, Nidorino, Nuzleaf, Panpour, Pansage, Pansear, Petilil, Pikachu, Poliwhirl, Roselia, Shellder, Skitty, Staryu, Sunkern, Togetic, Vulpix, Weepinbell
ItemMale Item Exactly the same as "Item", except the Pokémon must also be male. Kirlia
ItemFemale Item Exactly the same as "Item", except the Pokémon must also be female. Snorunt

Trade evolution methods

The following three evolution methods are checked when a the player receives a Pokémon in a trade. These methods are listed in def pbTradeCheckEvolution in the script section PScreen_Trading.

As with the item evolution methods above, these evolution cannot be cancelled.

Method name Parameter Notes Pokémon that use this method
Trade - The Pokémon will evolve immediately after it is traded. Boldore, Graveler, Gurdurr, Haunter, Kadabra, Machoke
TradeItem Item Exactly the same as "Trade", except the Pokémon must also be holding a particular item (named by the parameter). That item is removed afterwards. Clamperl, Dusclops, Electabuzz, Feebas, Magmar, Onix, Porygon, Porygon2, Poliwhirl, Rhydon, Scyther, Seadra, Slowpoke
TradeSpecies Species Exactly the same as "Trade", except the Pokémon must have been traded for a Pokémon of a certain species (named by the parameter). Karrablast, Shelmet

Examples

Evolutions=IVYSAUR,Level,16

The evolution path of Bulbasaur. It has only one evolution method, which is evolving through level up at Level 16 into Ivysaur.

Evolutions=TOGETIC,Happiness,

The evolution path of Togepi. It has only one evolution method, which is evolving when really happy into Togetic. Note the comma at the end of this line - the third entry of this triplet is still included, even though it is blank. Every evolution path must be a triplet (i.e. contain two commas).

Evolutions=VAPOREON,Item,WATERSTONE,JOLTEON,Item,THUNDERSTONE,FLAREON,Item,FIRESTONE,LEAFEON,Location,11,GLACEON,Location,8,ESPEON,HappinessDay,,UMBREON,HappinessNight,

The evolution paths of Eevee. It has seven evolution methods, as follows:

  • Use a Water Stone on it to evolve into Vaporeon.
  • Use a Thunder Stone on it to evolve into Jolteon.
  • Use a Fire Stone on it to evolve into Flareon.
  • Level up on map 11 into Leafeon. Note this comes before the "Happiness" methods, so this will be checked first.
  • Level up on map 8 into Glaceon. Note this comes before the "Happiness" methods, so this will be checked first.
  • Level up when really happy during the day to evolve into Espeon.
  • Level up when really happy during the night to evolve into Umbreon.
Evolutions=NINJASK,Ninjask,20,SHEDINJA,Shedinja,20

The evolution paths of Nincada. It uses the twin evolution methods of "Ninjask" and "Shedinja":

  • "Ninjask" evolves the Nincada into a Ninjask at/above Level 20, just like "Level" does.
  • "Shedinja" immediately duplicates the Ninjask (if there is an empty spot in the player's party), and turns the duplicate into a Shedinja.

Note that these method names are named after members of the Nincada family only because they are the only Pokémon that exhibit this behavior. Fakemon can use these methods just as easily.

Creating a new evolution method

The evolution methods are defined at the top of the script section Pokemon_Evolution, as follows:

 Happiness         = 1
 HappinessDay      = 2
 HappinessNight    = 3
 Level             = 4
 Trade             = 5
 TradeItem         = 6
 Item              = 7
 AttackGreater     = 8
 AtkDefEqual       = 9
 DefenseGreater    = 10
 Silcoon           = 11
 Cascoon           = 12
 Ninjask           = 13
 Shedinja          = 14
 Beauty            = 15
 ItemMale          = 16
 ItemFemale        = 17
 DayHoldItem       = 18
 NightHoldItem     = 19
 HasMove           = 20
 HasInParty        = 21
 LevelMale         = 22
 LevelFemale       = 23
 Location          = 24
 TradeSpecies      = 25
 LevelDay          = 26
 LevelNight        = 27
 LevelDarkInParty  = 28
 LevelRain         = 29
 HappinessMoveType = 30
 Custom1           = 31
 Custom2           = 32
 Custom3           = 33
 Custom4           = 34
 Custom5           = 35

 EVONAMES = ["Unknown",
    "Happiness","HappinessDay","HappinessNight","Level","Trade",
    "TradeItem","Item","AttackGreater","AtkDefEqual","DefenseGreater",
    "Silcoon","Cascoon","Ninjask","Shedinja","Beauty",
    "ItemMale","ItemFemale","DayHoldItem","NightHoldItem","HasMove",
    "HasInParty","LevelMale","LevelFemale","Location","TradeSpecies",
    "LevelDay","LevelNight","LevelDarkInParty","LevelRain","HappinessMoveType",
    "Custom1","Custom2","Custom3","Custom4","Custom5"
 ]

 # 0 = no parameter
 # 1 = Positive integer
 # 2 = Item internal name
 # 3 = Move internal name
 # 4 = Species internal name
 # 5 = Type internal name
 EVOPARAM = [0,  # Unknown (do not use)
    0,0,0,1,0,   # Happiness, HappinessDay, HappinessNight, Level, Trade
    2,2,1,1,1,   # TradeItem, Item, AttackGreater, AtkDefEqual, DefenseGreater
    1,1,1,1,1,   # Silcoon, Cascoon, Ninjask, Shedinja, Beauty
    2,2,2,2,3,   # ItemMale, ItemFemale, DayHoldItem, NightHoldItem, HasMove
    4,1,1,1,4,   # HasInParty, LevelMale, LevelFemale, Location, TradeSpecies
    1,1,1,1,5,   # LevelDay, LevelNight, LevelDarkInParty, LevelRain, HappinessMoveType
    1,1,1,1,1    # Custom 1-5
 ]

Each evolution method is defined with a number (e.g. Happiness=1, HasMove=20).

The EVONAMES array contains the names of each evolution method, which should be identical to the lines above which assign numbers to them. Their order in the EVONAMES array depends on their assigned numbers.

The EVOPARAM array contains numbers, one per evolution method, listed in the same order as the previous array. These numbers determine the kind of parameter this evolution method expects when the game compiles the PBS file "pokemon.txt" (an evolution method has one parameter). The comments in the scripts describe this adequately.

The evolution methods "Custom1" through "Custom5" are not used by default (because they are custom methods). Feel free to use and adapt them for your own methods. You may want to rename them to something a bit more memorable (in both places above where the name appears) - note that capitalisation is important, and that you shouldn't use spaces.

You can easily add additional evolution methods by simply adding on to the ends of the code above.

Defining an evolution method's effect

Once an evolution method has been defined, its effect needs to be coded in. There are three possible places to put this code, depending on how the evolution method works:

  • def pbMiniCheckEvolution in script section Pokemon_Evolution - for methods which occur upon levelling up (most of them).
  • def pbMiniCheckEvolutionItem in script section Pokemon_Evolution - for methods which occur when an item is used on the Pokémon (e.g. an evolution stone).
  • def pbTradeCheckEvolution in script section PScreen_Trading - for methods which occur when the Pokémon has been received in a trade.

Each place has at least several examples of evolution methods. You just need to add another one following the same pattern. The order in which the evolution methods are listed is not important. These scripts all return the species to evolve into (the species ID number) if the evolution will happen, or -1 if it won't evolve.

In the code for an evolution method, the parameter (number, item, move, species or type) is always referred to by the name level, even if it isn't literally a level number. The Pokémon wanting to evolve (if it can) is referred to by the name pokemon, and the species it can evolve into is referred to by the name poke.

Possible new evolution methods

There is a great deal of flexibility in what an evolution method can be. You can check any aspect of the Pokémon wanting to evolve (pokemon), consider the parameter given for the evolution method (level), or refer to any recorded aspect in the game (e.g. weather, location). The exact code you'll need to use for your custom evolution method will obviously depend on what you want it to do. This wiki page cannot describe at a general level what to do; however, some examples are given below.

As well as creating new evolution methods, you could also/instead make a few changes to existing methods.

Other ideas:

  • Merge two or more existing methods together into a new one.
  • Evolution that depends on the Pokémon's nature or form. (e.g. Toxtricity)
  • Fusion evolution (e.g. for Magnemite/Slowpoke). Check that there is a Shellder in the party, and if so, delete it and evolve the levelled-up Slowpoke.
  • Change the Pokémon's form depending on how it evolves (e.g. Rockruff into Lycanroc). This is done by setting the form immediately before returning poke in the evolution method's code. This assumes the unevolved Pokémon doesn't have multiple forms, only the evolved species.
  • Disable all evolutions for a time by inserting the line return -1 if $game_switches[42] at the very beginning of def pbCheckEvolutionEx (in the script section Pokemon_Evolution, next to similar lines for the Everstone and Pichu) and then setting Game Switch 42 to ON whenever you want to forbid all evolutions. The number of the Game Switch you use may vary.

Hatred

This method is almost identical to "Happiness", with the sole changes of replacing the "greater than" sign to a "less than" sign, and changing the threshold value. If you use this method, you may also want to make it easier to get a Pokémon to hate you in-game (currently the only ways to do this are fainting and using herbal medicine, which can easily be countered by the many more happiness-boosting methods).

As with "Happiness", this method would not use a special parameter.

Evolution=HATEMON,Hatred,

This is an example of the "Evolution" line in the PBS file "pokemon.txt".

Well trained

"Well trained" here means that the Pokémon has been in battles and has gained EVs. The following code checks how many EVs the Pokémon has, and allows evolution only if that amount is greater than or equal to the EV threshold value set by the parameter.

evtotal = 0
for i in 0...6
 evtotal += pokemon.ev[i]
end
return poke if evtotal>=level

Remember that the maximum number of EVs a Pokémon can have is 510 (by default).

This method's special parameter would be a number.

Evolution=TRAINEDMON,Trained,400

This is an example of the "Evolution" line in the PBS file "pokemon.txt".

Evolution screen

When a Pokémon evolves, it is displayed on screen with some messages ("What? Pikachu is evolving!", etc.). The player has the chance to cancel some evolutions by pressing a button during the animation.

The animation itself is described in def pbGenerateMetafiles in the script section Pokemon_Evolution. It shows the Pokémon's sprite fade to white, then grow bigger and smaller while alternating with the sprite of its evolved form, before the evolved form's sprite colours in.

The background used for the evolution screen is located in the "Graphics/Pictures" folder, and is called "evolutionbg.png". This image will be tiled across the entire background. If there is no picture with this name, a blank white background will be shown instead.