View Single Post
September 19th, 2011 (1:41 PM).
Originally Posted by
Besides, the battle ram data might turn "empty" after the battle ends (happens with G/S/C at least)
I don't know about the actual data for enemy Pokemon, but if it's a trainer battle, the arguments passed to the trainerbattle command remains in RAM after the battle.
trainer battles go through that command. The effect where a trainer spots and walks to you is actually a "secret" script.)
So OP would need to copy the data for the enemy team -- six 100-byte (0x64) structures, the first of which is located at 0x0202402C. These structures store the full Pokemon data, including stat, health, and status information (with the possible exceptions of confusion and attraction).
The trainerbattle arguments should still be saved in RAM, so OP need only call a (heavily-modified) version of repeattrainerbattle. Modifications would need to be made to ensure that the Trainer sends out the Pokemon they were actually battling with earlier (since Trainers can switch out). (You'll also need to keep track of how many of their four items the Trainer has used, and restore that information upon initiating the battle.)
EDIT: Just in case anyone plans on analyzing battle ASM by looking at the trainer battle commands... Know that "trainerbattle" only
a battle -- and then it runs a script that calls "repeattrainerbattle". "Repeattrainerbattle" actually starts the battle (better name woulda been "dotrainerbattle").
Joined Jul 2010
View Public Profile
Send a private message to Missingyep
Find all posts by Missingyep
Find threads started by Missingyep
Ignore Posts by Missingyep