This article describes how to set up the player character. It also details the rest of the game's global metadata.
Setting up a player character
The PBS file "metadata.txt" contains much of the information about the player characters, including listing the graphics used to depict them in the game. See the article Metadata for more information on how to complete the metadata to define a player character.
You will also need to ensure that all relevant graphics are in the appropriate places. These include charsets depicting various kinds of movement (walking, running, cycling, surfing, diving and fishing), and front and back sprites. The front and back sprites are part of defining a trainer type - see the article Defining a trainer for how to set these sprites.
Manipulating the player
To set the player (and thus set all their sprites), use the following script:
"X" is a number between 0 and 7, corresponding to player characters A through H. This script is called in the game intro, and is one of the two vital things that MUST happen there (along with setting the player's name). You can also use this command at any point during the game, but note that all it will do is change whichever information is written for that player character in the global metadata (i.e. the trainer type and the charsets) - it will NOT change their party/money/name/etc.
In this sense, changing the player is purely cosmetic, as all that changes is the player's appearance.
Naming the player
To name the player, use the following script:
This opens the naming screen, where the player can choose a name for themselves. If they close the naming screen while the name section is still blank, the player's username on their computer will be used (or a randomly generated name if that can't be found). The randomly generated name is nearly always terrible, as it is generated letter by letter according to a set of rules, rather than choosing one name from a list of names. You may wish to change this to use a specific name (or a random choice from a list of names); if so, find this script in the script section PokemonUtilities and edit as appropriate. Remember to differentiate between genders.
To set the player's name automatically without letting the player choose it for themselves, use the following command in the game intro event instead of the above (you can change the highlighted part to whatever you want):
If this script is called, but
pbChangePlayer hasn't been, then the player's character will be set to the default character A.
The player can be given a selection of outfits to choose from. These effectively behave like multiple forms do for Pokémon, in that the outfit ("form") is a single number which determines the graphics to use for the player. This number is stored in the variable
$Trainer.outfit, and is 0 by default.
The charsets which the player will use are named by taking the defined charset names in the PBS file "metadata.txt" for the player's character, and then adding an underscore followed by the outfit number to the end of it. Therefore, each outfit will require its own collection of charsets. If the appropriate charset does not exist, the game will instead use the base charset name (without any outfit number on the end). As with Pokémon multiple forms, it is recommended that outfit 0's graphics actually have no numbers on the ends of their filenames, so that outfit 0 can also act as the default/backup outfit if necessary.
This file naming convention also applies to the trainer sprites (both front and back sprites), as well as the player's head icon which is shown on the region map, and to the Vs. battle intro animation.
There is no in-game way to change the player's outfit in Essentials, by default (except for a Debug mode option). Implementing a "wardrobe" feature, and deciding how to number each outfit and which outfits are available, is left to the user to do.
A number of pieces of information are stored in the variable
$Trainer, as follows:
|The player's name (e.g. "Dave").|
|The name of the trainer type that the player has (e.g. "PkMn Trainer").|
|The full name of the trainer (e.g. "PkMn Trainer Dave").|
|The player's trainer type (typically 000 if male, 001 if female).|
|An 8 digit hexadecimal number (between 00000000 and FFFFFFFF).|
|The last 4 hexadecimal digits of the player's ID (a number between 0 and 65535). This is the player's ID number as shown on the Trainer card, as well as the displayed OT ID for a Pokémon originally owned by the player.|
|The first 4 hexadecimal digits of the player's ID (a number between 0 and 65535).|
|The gender of the trainer type that the player has (0=male, 1=female, 2=unknown).|
|The outfit the player is wearing (0 by default, or any positive number).|
|A number corresponding to the language used by the player's computer. All Pokémon caught by the player have the same language.
If the language is known but none of the above, it is set to English.
|The amount of money the player currently has.|
|An array of values, each of which is TRUE if the corresponding badge is owned and FALSE if it is not. The first value, |
|The total number of badges that the player has. It counts every region's badges.|
|Is TRUE if the player has the Pokégear (i.e. it shows up in the Pause menu).|
|Is TRUE if the player has the Pokédex (i.e. it shows up in the Pause menu).|
|The total number of Pokémon species the player has seen in the specified Regional Dex. Leave the parameter blank or |
|The total number of Pokémon species the player has owned in the specified Regional Dex. Leave the parameter blank or |
|Returns the total number of alternate forms that the player has seen of the given species. This only counts "true" alternate forms, i.e. gender differences are ignored.|
|Completely erases everything in the Pokédex.|
|An array that contains up to 6 entries, each entry being a Pokémon (or egg). This is the player's party.|