< >
Hello, guest! Please log in or register.

The PokéCommunity

Go Back     The PokéCommunity Forums > ROM Hacking > Research & Development Research Trainers and Trainer's Pokémon

Notices

Research & Development Got a well-founded knack with ROM hacking? Love reverse-engineering the Pokémon games? Or perhaps you love your assembly language. This is the spot for polling and gathering your ideas, and then implementing them! Share your hypothesis, get ideas from others, and collaborate to create!
Research & Development programs in this forum are subject to moderator approval before they are displayed.

Reply Post Reply
 
Thread Tools
  #1    
Old January 25th, 2016 (3:11 PM). Edited February 9th, 2016 by NewDenverCity.
NewDenverCity's Avatar
NewDenverCity NewDenverCity is offline
 
Join Date: Apr 2014
Location: Antarctica
Gender: Male
Nature: Calm
Posts: 195
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.
http://www.pokecommunity.com/showpos...48&postcount=6

Pokémon data
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.
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.
Code:
byte 0x0: trainer class ID
byte 0x1: money gain rate
hword 0x2: ??? (filler)
The table does not go in order of both trainer class or the money gain rate, but rather seems to be completely arbitrary.
Reply With Quote

Relevant Advertising!

  #2    
Old February 9th, 2016 (11:54 AM).
Telinc1's Avatar
Telinc1 Telinc1 is offline
Weirdo Extraordinaire
 
Join Date: Jun 2013
Location: Sofia, Bulgaria
Gender: Male
Nature: Bold
Posts: 161
By the way, I've got something to add about byte 0x1C - it's a bitfield. daniilS explains what each bit does in this post.
Speaking of which, his post documents 32 bits total, so I'm pretty sure the 0x1C-0x1F range is actually a word, and not a byte with three unused ones after it.

Check out my hacks by clicking on the userbar!
Check out my new website (this link now works!)!
Reply With Quote
  #3    
Old February 9th, 2016 (6:35 PM).
NewDenverCity's Avatar
NewDenverCity NewDenverCity is offline
 
Join Date: Apr 2014
Location: Antarctica
Gender: Male
Nature: Calm
Posts: 195
Quote:
Originally Posted by Telinc1 View Post
By the way, I've got something to add about byte 0x1C - it's a bitfield. daniilS explains what each bit does in this post.
Speaking of which, his post documents 32 bits total, so I'm pretty sure the 0x1C-0x1F range is actually a word, and not a byte with three unused ones after it.
Thanks, I edited the OP, totally forgot about that post.
Reply With Quote
  #4    
Old 4 Weeks Ago (1:26 PM).
rhapsodian_pixo rhapsodian_pixo is offline
 
Join Date: Jul 2013
Gender: Male
Posts: 86
I was searching a way to edit the Pokémon trainers' abilitie... Cuz when i set a politoed, for ex, It sets the first one abilitie and not the second (drizzle)
Do u have any idea?
Reply With Quote
  #5    
Old 4 Weeks Ago (2:06 PM).
azurile13 azurile13 is offline
 
Join Date: Mar 2015
Posts: 328
Quote:
Originally Posted by rhapsodian_pixo View Post
I was searching a way to edit the Pokémon trainers' abilitie... Cuz when i set a politoed, for ex, It sets the first one abilitie and not the second (drizzle)
Do u have any idea?
http://www.pokecommunity.com/showpos...2&postcount=45
Go to the OP of that thread for the full routine and setup.
Reply With Quote
Reply Post Reply
Quick Reply

Sponsored Links
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


  All times are GMT -8. The time now is 1:21 PM.


Contact Us Archive Privacy Statement Terms of Service Top