This article describes how to separate a game into several distinct regions, and how to create a Regional/National Pokédex.
A region is a collection of maps, all of which are related to the same region map. Different regions may contain different wild Pokémon, and consequently a regional Pokédex list. To set up a new region in a game, the following should be done:
- Create a region map picture and fill it with information points.
- Assign maps to that region.
- Create a Regional Pokédex.
Defining a region
The PBS file "townmap.txt" defines the region map for each region, as well as filling in the squares of that map with information (such as the location's name). Each region has its own section, beginning with a number in square brackets (the region's ID number). For example:
 Name=Kanto Filename=kantomap.png Point=10,5,Pallet Town,,17,9,8, Point=6,4,Route 1,,,,, Point=6,5,Viridian Forest,,,,,  Name=Johto Filename=johtomap.png Point=11,5,New Bark Town,,42,9,8, Point=10,4,Route 29,,,,, Point=7,5,Dark Cave,,,,,
The numbering of regions should start at 0 and count upwards, without skipping numbers. There is no (practical) limit to the number of regions a game can have.
See the article Region map for more information on how to add this information.
Adding game maps to a region
The PBS file "metadata.txt" lists each map in the game, along with various metadata relating to each map.
When considering multiple regions, the "MapPosition" metadata is the important one. It contains three numbers: a region ID number, followed by the X and Y coordinates of that map in relation to the region map. There are no other differences between maps in different regions.
Note that all maps must be assigned to a region, including building interiors. This is because when the Town Map item is used, the region map shown depends on the "MapPosition" metadata of the map the player is currently on, and if there is none set, there can be an error.
See the article Metadata for more information on how to set map metadata.
There are two basic types of Pokédex list: the National Dex and the Regional Dex. The National Dex contains all Pokémon in the game, in the order they appear in the PBS file "pokemon.txt". Regional Dexes are different.
One of the properties that can be set for a Pokémon species in the PBS file "pokemon.txt" is "RegionalNumbers". This property gives the Regional Dex number(s) of that species. For example:
This example means that the species is number 25 in the first Regional Dex, 137 in the second Regional Dex, and doesn't appear in the third Regional Dex.
Every line should have the same number of numbers (e.g. the above example has 3 numbers - all other "RegionalNumbers" lines for other species should also have 3 regional numbers). You can have species which do not appear in any Regional Dex; in which case, simply don't have a "RegionalNumbers" line for it (or set all the numbers to 0).
It is important to note that these Regional Dexes do not automatically correspond in any way to the regions defined above - making them do so requires playing with various settings.
Regional Dex settings
In the script section Settings is the following information:
DEXDEPENDSONLOCATION = true def pbDexNames; return [ [_INTL("Kanto Pokédex"),0], [_INTL("Johto Pokédex"),1], [_INTL("Hoenn Pokédex"),2], _INTL("National Pokédex") ]; end ALWAYSSHOWALLFORMS = false DEXINDEXOFFSETS = 
The first setting is a TRUE/FALSE setting. What this setting means is described below.
If you want to include the National Dex in your game, it must appear in the array in
pbDexNames and must be the last one listed. It may or may not have a number next to it.
The third setting is a TRUE/FALSE setting, that determines which forms of a Pokémon species are shown in its Pokédexentry. If TRUE, it will always show every form (including gender differences) for that species. If FALSE, it will only show the forms and genders that the player has seen.
The fourth setting is an array of numbers. Each number represents a Regional Dex in the array in
pbDexNames (0 is the first listed Dex, 1 is the second listed Dex, etc.). Each Dex in this array will have its species numbers lowered by 1. This allows for that Regional Dex to have a "species 0" (e.g. Victini). Victini would be numbered species 1 in that Regional Dex (and Snivy species 2) in the PBS file "pokemon.txt", but in-game it will be species 0 (and Snivy species 1).
Dexes depend on location
DEXDEPENDSONLOCATION = true
The Regional Dex shown when the Pokédex is opened will correspond exactly to the region the player is in (e.g. the first Regional Dex for the first region, the second for the second, etc.).
If there is no Regional Dex corresponding to the current region (e.g. the player is in the fourth region, but only three Regional Dexes have been defined), then the National Dex will be shown instead. If the map the player is currently in is not associated with a region (i.e. its "MapPosition" metadata is not set), then the National Dex will be shown.
Usually the National Dex will never be shown. There will never be an option to choose which Dex list to view.
The array of Dex names is ignored.
Dexes don't depend on location
DEXDEPENDSONLOCATION = false
The player manually chooses which Dex list to view. However, they only have a choice of Dex lists that have been unlocked and are not empty. If there is only one such Dex list, that one is shown automatically when the Pokédex is opened.
There are two arrays that are important here. The first is the array of Dex list names, shown above. There is also an array called
$PokemonGlobal.pokedexUnlocked, which records which Dex lists have been unlocked. Both of these list all the Regional Dexes first, followed by the National Dex.
Each entry in the Dex names array can either be a name (e.g. the National Dex above), or an array itself containing the name and a number (e.g. the Kanto Dex above). If it is just a name, then when viewing that Dex list and looking at a species' nest map, the current region's map will be shown. If it is a name and a number, then the number is which region's map to show in the nest map (or the current region's map if that is invalid).
The first Regional Dex is automatically unlocked at the start of the game, but the rest are locked and will need to be unlocked manually later on. To unlock a Dex, use the following method:
pbUnlockDex(0) pbUnlockDex(1) pbUnlockDex
The number is the number of the Dex list to unlock (0 is the first Regional Dex, 1 is the second Regional Dex, etc.). If no number is given, then this will unlock the National Dex instead.
Similarly, you can lock a Dex as follows:
pbLockDex(0) pbLockDex(1) pbLockDex
The only way in which a Regional Dex corresponds to an actual region, when
DEXDEPENDSONLOCATION is FALSE, is when the numbers in the Dex names array determine the region map to show when looking at a species' nest map.
Regional Pokémon storage
This section of the article is not yet completed. See the discussion page for a list of what needs to be done. You can help Pokémon Essentials Wiki by expanding it.
Pokémon Essentials contains scripts for regional Pokémon storage, which is a way of separating Pokémon caught in different regions so that a Pokémon caught in one region cannot be used in another region. However, this is not currently implemented.
- You can use the multiple regions feature in a number of ways, e.g.
- Have one Dex list per region. This is the typical use.
- Johto "Old" and "New" styles (i.e. just rearrange the National Dex) - a Regional Dex doesn't need to contain fewer Pokémon than the National Dex.
- Characteristic-based Dex lists (e.g. "common"/"legendary", habitats, type-ordered). Having one Dex list per characteristic may lead to having lots of Dex lists.
- You don't need to have the National Dex in your game at all. Even if it appears in the Dex names array (which it doesn't have to), you may simply never use/unlock it.
- To easily remove Regional Dexes, you can use the Editor's "Edit Regional Dexes" function to delete the Regional Dexes you want. Remember to start a new game afterwards rather than loading a saved game.