Binary ROM HackingNeed a helping hand or just want to talk about binary ROM hacks? Get comments and answers to any ROM Hacking-related problems, questions or thoughts you have here.
Note: I'm not sure if this post is big enough to have it's own thread or if this belongs to the script help thread. Mods, please move this to wherever you feel it belongs.
In the rematch system that I'm working on for Emerald, I've come across a major oversight; if you lose a battle on the first E4 run to anybody after defeating Sidney, you will get stuck in the first arena the next time you enter. Here is an example of the script. All the others are formatted the same. 0x4FB was the original flag used for the initial battle with Sidney, and has been moved to be set after the rematch (because it resets after every champion win).
#org @second
= Yo!\pI was waiting for you, Champion.\pNo matter who wins, no hard\nfeelings!\pLet's get our most excellent\nbattle underway!
#org @loss2
= Heh[.] I really knew you were the\nstrongest[.]\pWell, hurry up and get out of\nhere!\lEverybody else is still\lwaiting for you!
#org @first
= Welcome, challenger!\nI'm Sidney of the Elite Four.\pI like that look you're giving me.\nI guess you'll give me a good match.\lThat's good! Looking real good!\pAll right! You and me, let's enjoy\na battle that can only be staged\lhere in the Pokémon League!
#org @sidloses
= Well, how do you like that? I lost!\nEh, it was fun, so it doesn't matter.
#org @sidloses2
= Well, well, I lose again!
#org @loss1
= Well, listen to what this loser has\nto say.\pYou've got what it takes to go far.\nNow, go on to the next room and enjoy\lyour next battle!
For example, when the player defeats Sidney (sets flag 0x2B1) but loses to Phoebe, he/she will become stuck at Sidney upon re-entering because 0x2B1 was not cleared, causing the script to go right to @rematch then @notagain instead of going to the trainerbattle against ID 0x105. What I would like to do is to be able to clear all of the first match flags for all four trainers (0x2B1 to 0x2B4) if the player happens to white out to anyone after defeating Sidney. Help would be greatly appreciated. Thank you!
EDIT: Nevermind, I figured out that it was much better to check for flag 0x87F (set after the first League win) after the faceplayer command, then use 0x4FB for both of the matches. This way, the script is redirected to the rematch battle as long as the player has entered the hall of fame.
__________________
"All dreams are but another reality. Never forget..."