- 325
- Posts
- 11
- Years
- Antarctica
- Seen Apr 1, 2020
Trainers and Trainer's Pokémon
Even though we've all used Trainer editors, I'd bet that almost no one who reads this thread has any idea of how their data is actually formatted. As of right now, the only documentation I could find of this was with Hopeless Trainer Editor (and that was after I had researched and documented it myself, rip). Anyway, I'll just post what I found.
Trainer data
Pokémon data
Basically, all the custom moves flag does is add four half-words.
~EDIT~ Quick update. There's a table located at 0x24F220 that is related to the money that each class gets. The pointer to it is at 0x259CC, and is used by the battle script command 0x5D. From this, I can gather than cmd5D is related to giving away money, even though I have no clue what the pointer after it is for. Anyway, the table is organized in a really strange way.
The table does not go in order of both trainer class or the money gain rate, but rather seems to be completely arbitrary.
Even though we've all used Trainer editors, I'd bet that almost no one who reads this thread has any idea of how their data is actually formatted. As of right now, the only documentation I could find of this was with Hopeless Trainer Editor (and that was after I had researched and documented it myself, rip). Anyway, I'll just post what I found.
Trainer data
Spoiler:
Code:
Trainer data:
byte 0x0: bitfield, see below
byte 0x1: class
byte 0x2: bitfield, see below
byte 0x3: sprite ID
bytes 0x4-0xF: trainer name (byte 0xF is always FF)
hword 0x10: trainer item 1
hword 0x12: trainer item 2
hword 0x14: trainer item 3
hword 0x16: trainer item 4
byte 0x18: double battle. (00 is default, 01 is double battle)
bytes 0x19-1B: ??? (filler)
word 0x1C: bitfield, see below
byte 0x20: number of Pokemon in Trainer's team
bytes 0x21-0x23: ??? (filler)
word 0x24: pointer to Pokemon data
byte 0x0 info:
Uses only the last four bits. 0010b means that there are custom held items, 0001b means that there are custom attacks.
byte 0x2 info:
The bit all the way on the left represents gender, 0 being male, 1 being female.
Everything else is the intro music. Largest integer it can take is 0x7F.
word 0x1C info:
This controls the AI intelligence, the various bits are explained by danillS in his post.
[url]https://www.pokecommunity.com/posts/8728848/[/url]
Spoiler:
Code:
Pokemon data:
Without custom moves:
byte 0x0: IVs
byte 0x1: ??? (filler)
byte 0x2: level
byte 0x3: ??? (filler)
hword 0x4: species
hword 0x6: item (see below)
With custom moves:
byte 0x0: IVs
byte 0x1: ??? (filler)
byte 0x2: level
byte 0x3: ??? (filler)
hword 0x4: species
hword 0x6: item (see below)
hword 0x8: move 1
hword 0xA: move 2
hword 0xC: move 3
hword 0xD: move 4
hword 0x6 info:
The item is 0x0 if custom held items aren't turned on via the flag in the trainer data.
~EDIT~ Quick update. There's a table located at 0x24F220 that is related to the money that each class gets. The pointer to it is at 0x259CC, and is used by the battle script command 0x5D. From this, I can gather than cmd5D is related to giving away money, even though I have no clue what the pointer after it is for. Anyway, the table is organized in a really strange way.
Code:
byte 0x0: trainer class ID
byte 0x1: money gain rate
hword 0x2: ??? (filler)
Last edited: