Trainer Tower data structures (Generation III)
All memory addresses refer to the addresses used in the US version of the games.
In the Japanese release of Pokémon FireRed and LeafGreen, players could scan in e-Reader cards from the Battle-e FireRed and LeafGreen series to customize the layout of Trainer Tower. In the international releases, the data from all 32 of the regular cards are folded into the game ROM; none of the Japanese promotional cards are present. The four battle modes (Single, Double, Knockout, and Mixed) each have a hard-coded order of eight Trainers, exactly as if their corresponding cards have been scanned.
Note that not all 32 cards are used in international releases; notably, all 8 of the Knockout battle cards are used in the Knockout mode, some of which are reused in Mixed mode. A few singles and doubles cards are also reused in Trainer Tower.
The card data is stored in memory location 0x0847ABAC (FireRed) and 0x0847A488 (LeafGreen).
Each Trainer Card is stored as a 992-byte structure, laid out as follows:
|Battle Type - 0 for Single Battles, 1 for Double Battles, and 2 for knockout battles
|Reward Item - This is the reward item that is obtained when players defeat Trainer Hill, provided that this card represents the first Trainer. The values are indices in a special 15-entry array.
|The data for up to three Trainers and their Pokémon.
Trainer Data is a 328-byte structure, laid out as follows:
|Easy Chat Quote
|Challenge, win, and lose quotes (in that order) - each of these are built in accordance to the easy chat system.
|Padding bytes resulting from alignment
|Trainer's Pokémon Lineup
Trainer's Pokémon is a 44-byte structure, laid out as follows:
|Species - see List of Pokémon by index number (Generation III) for values.
|Held Item - see List of items by index number (Generation III) for values.
|Moves - see List of moves for values.
|Nickname - Note that none of the Pokémon on any of these cards are actually nicknamed; the species name is placed here instead.
If a Trainer is unused (the second and third Trainers in a Single Battle card, or the third Trainer in a Double battle card), the entire structure, with the exception of the easy chat quotes, is zeroed out; the easy chat quote area is filled with 0xFF instead.
The floor plan is simply a list of eight pointers to the various cards that will be used in each mode. There are four such lists, one for each mode. Their locations are as follows:
The reward items used on each card corresponds to indices in an array of 15 items (as indices to the master item list). This array is stored in location 0x0847A2B4 (FireRed) and 0x08479B90 (LeafGreen). For convenience, it is reproduced here.
|This data structure article is part of Project Games, a Bulbapedia project that aims to write comprehensive articles on the Pokémon games.