- 959
- Posts
- 12
- Years
- Age 25
- he/him
- Fallarbor Town
- Seen Oct 20, 2023
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).
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.
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).
Spoiler:
#dynamic 0xE00000
#freespace 0xFF
#org @start
lock
faceplayer
checkflag 0x2B1
if 0x1 goto @rematch
playsong 0x1C2 0x0
msgbox @first 0x6
trainerbattle 0x3 0x105 0x0 @sidloses
goto @win1
#org @win1
setflag 0x2B1
call @gibberish
msgbox @loss1 0x2
release
end
#org @gibberish
applymovement 0xFF @moveit
waitmovement 0x0
sound 0x8
setmaptile 0x6 0x1 0x344 0x0
setmaptile 0x6 0x2 0x345 0x0
setmaptile 0x0 0x2 0x2DE 0x1
setmaptile 0x1 0x2 0x2DD 0x1
setmaptile 0x2 0x2 0x2DE 0x1
setmaptile 0x3 0x2 0x2DD 0x1
setmaptile 0x4 0x2 0x2DE 0x1
setmaptile 0x8 0x2 0x2DD 0x1
setmaptile 0x9 0x2 0x2DE 0x1
setmaptile 0xA 0x2 0x2DD 0x1
setmaptile 0xB 0x2 0x2DE 0x1
setmaptile 0xC 0x2 0x2DD 0x1
special 0x91
return
#org @rematch
checkflag 0x87F
if 0x0 goto @notagain
checkflag 0x4FB
if 0x1 goto @lost2
playsong 0x1C2 0x0
msgbox @second 0x2
trainerbattle 0x3 0x353 0x0 @sidloses2
goto @win2
#org @notagain
msgbox @loss1 0x6
release
end
#org @win2
setflag 0x4FB
call @gibberish
msgbox @loss2 0x2
release
end
#org @lost2
msgbox @loss2 0x6
release
end
#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!
#org @moveit
#raw 0x14 'Delay5
#raw 0x14 'Delay5
#raw 0xFE 'End of Movements
#freespace 0xFF
#org @start
lock
faceplayer
checkflag 0x2B1
if 0x1 goto @rematch
playsong 0x1C2 0x0
msgbox @first 0x6
trainerbattle 0x3 0x105 0x0 @sidloses
goto @win1
#org @win1
setflag 0x2B1
call @gibberish
msgbox @loss1 0x2
release
end
#org @gibberish
applymovement 0xFF @moveit
waitmovement 0x0
sound 0x8
setmaptile 0x6 0x1 0x344 0x0
setmaptile 0x6 0x2 0x345 0x0
setmaptile 0x0 0x2 0x2DE 0x1
setmaptile 0x1 0x2 0x2DD 0x1
setmaptile 0x2 0x2 0x2DE 0x1
setmaptile 0x3 0x2 0x2DD 0x1
setmaptile 0x4 0x2 0x2DE 0x1
setmaptile 0x8 0x2 0x2DD 0x1
setmaptile 0x9 0x2 0x2DE 0x1
setmaptile 0xA 0x2 0x2DD 0x1
setmaptile 0xB 0x2 0x2DE 0x1
setmaptile 0xC 0x2 0x2DD 0x1
special 0x91
return
#org @rematch
checkflag 0x87F
if 0x0 goto @notagain
checkflag 0x4FB
if 0x1 goto @lost2
playsong 0x1C2 0x0
msgbox @second 0x2
trainerbattle 0x3 0x353 0x0 @sidloses2
goto @win2
#org @notagain
msgbox @loss1 0x6
release
end
#org @win2
setflag 0x4FB
call @gibberish
msgbox @loss2 0x2
release
end
#org @lost2
msgbox @loss2 0x6
release
end
#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!
#org @moveit
#raw 0x14 'Delay5
#raw 0x14 'Delay5
#raw 0xFE 'End of Movements
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.
Last edited: