Skeetendo

’Cause all games were better on the GBC

You are not logged in.

#1 2012-12-30 18:32:13

piuchester
New member
Registered: 2012-12-30
Post 1/2

Adding pokémon to trainers (R/B)

Hi.
I've been skimming the hex data in Pokémon Red and want to give a few trainers more pokémon. Mainly gym leaders.

I know a bit of hex, so I've gone and lost myself into searching the data. It's now welcoming at least (I could understand at least that it's like: [trainers: level, poke1, poke2, poke3... 00, (new trainer)] and [important trainers: level1, poke1, level2, poke2... 00, FF, (new trainer)].

It's enough for me to change pokémon, but not to add more to the trainers, because it takes a few more bytes.

This leaves me with 2 options:

1-remove 2 pokemon from an unimportant trainer for each pokemon I want to give to a gym leader (and break half of the pointers in this way)
2-repoint the whole table.

However, I'm completely blind on that one. I don't know where I can find safe free data, nor where are the game pointers that allow me to do this surgery.
I know you guys have documented a lot of things (I've been using this and this in my journey, having found the first one here in the forums), and I hope someone can give me some lights on this matter

Offline

#2 2012-12-30 19:26:48

Miksy91
Member
Registered: 2010-10-16
Post 1,391/2,311

Re: Adding pokémon to trainers (R/B)

Looks like there is a pointer table to the trainer datas used by each trainer group (Youngster, Bug Catcher, ...) starting at 0x39D3B.
For instance, the two first bytes of this pointer table are 99 5D used for looking for pokemon data for trainer group 01 at 0x39D99.
The next two bytes (CE 5D) are used for looking the pokemon data for trainer group 02 from 0x39DCE.

To be able to have more space for pokemon data for certain gym leaders for instance, you should be able to make it possible simply by changing the pointers leading to trainer groups used by those gym leaders point to blank space in the same rom bank and fill out the pokemon data there.

Trainer groups are separated from each other by different images used during battle. "Leader" and "Leader" are different trainer groups if another one uses Brock's battle sprite and the other one Misty's. So you could assume trainer group, "Leader" of which pointer leads to pokemon data used by Brock, contains only pokemon data of one trainer (because you can't encounter two trainers in the game that both use battle sprite of Brock).
You can also notice this by the following pointer in the pointer table (most likely) pointing one byte ahead of the data where the pokemon data used by Brock ends.

Last edited by Miksy91 (2012-12-30 19:35:00)

Offline

Board footer

Powered by FluxBB