- 199
- Posts
- 13
- Years
- Seen Jul 18, 2016
So I am trying to make a script that starts an alternate trainer battle in emerald if a flag has been set.
Basically, I am making an E4 rematch where they have upgraded teams and such.
Here is my current script. Also the alternate trainer battle starts phoebe's battle. Just a placeholder to test.
and here is what it looks like after compiling it.
Why does the part in bold appear?
The script works fine when tested unless you talk to the npc a second time, at which it tries to warp
the player it seems.
Basically, I am making an E4 rematch where they have upgraded teams and such.
Here is my current script. Also the alternate trainer battle starts phoebe's battle. Just a placeholder to test.
Spoiler:
#freespace 0xFF
#dynamic 0xE43710
#org @start
lock
faceplayer
checkflag 0x4FB
if 0x1 goto @beaten
checkflag 0x864
if 0x0 goto @battle1
checkflag 0x864
if 0x1 goto @battle2
#org @beaten
= 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 @battle1
playsong 0x1C2 0x0
msgbox @intro 0x4
trainerbattle 0x3 0x105 0x0 @after
goto @defeat
#org @battle2
playsong 0x1C2 0x0
msgbox @intro 0x4
trainerbattle 0x3 0x106 0x0 @after
goto @defeat
#org @after
= Well, how do you like that? I lost!\nEh, it was fun, so it doesn't matter.
#org @intro
= 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!
return
#org @defeat
setflag 0x4FB
call @setmaptile
msgbox @beaten 0x4
release
end
#org @setmaptile
applymovement MOVE_PLAYER @move
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 @move
#raw 0x14 'Delay5
#raw 0x14 'Delay5
#raw 0xFE 'End of Movements
#dynamic 0xE43710
#org @start
lock
faceplayer
checkflag 0x4FB
if 0x1 goto @beaten
checkflag 0x864
if 0x0 goto @battle1
checkflag 0x864
if 0x1 goto @battle2
#org @beaten
= 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 @battle1
playsong 0x1C2 0x0
msgbox @intro 0x4
trainerbattle 0x3 0x105 0x0 @after
goto @defeat
#org @battle2
playsong 0x1C2 0x0
msgbox @intro 0x4
trainerbattle 0x3 0x106 0x0 @after
goto @defeat
#org @after
= Well, how do you like that? I lost!\nEh, it was fun, so it doesn't matter.
#org @intro
= 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!
return
#org @defeat
setflag 0x4FB
call @setmaptile
msgbox @beaten 0x4
release
end
#org @setmaptile
applymovement MOVE_PLAYER @move
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 @move
#raw 0x14 'Delay5
#raw 0x14 'Delay5
#raw 0xFE 'End of Movements
and here is what it looks like after compiling it.
Spoiler:
'---------------
#org 0xE445B8
lock
faceplayer
checkflag 0x4FB
if 0x1 goto 0x8E445D6
checkflag 0x864
if 0x0 goto 0x8E44660
checkflag 0x864
if 0x1 goto 0x8E4467C
'---------------
#org 0xE445D6
warpteleport2 0xD9 0xE0 0xE0 0xB8 0xDDE0
'---------------
#org 0xE44660
playsong 0x1C2 0x0
msgbox 0x8E446E4 MSG_KEEPOPEN '"Welcome, challenger!\nI'm SIDNEY o..."
trainerbattle 0x3 0x105 0x0 0x8E44698
goto 0x8E447E2
'---------------
#org 0xE4467C
playsong 0x1C2 0x0
msgbox 0x8E446E4 MSG_KEEPOPEN '"Welcome, challenger!\nI'm SIDNEY o..."
trainerbattle 0x3 0x106 0x0 0x8E44698
goto 0x8E447E2
'---------------
#org 0xE447E2
setflag 0x4FB
call 0x8E447F5
msgbox 0x8E445D6 MSG_KEEPOPEN '"Well, listen to what this loser ha..."
release
end
'---------------
#org 0xE447F5
applymovement MOVE_PLAYER 0x8E44873
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
'---------
' Strings
'---------
#org 0xE446E4
= 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 0xE44698
= Well, how do you like that? I lost!\nEh, it was fun, so it doesn't matter.
#org 0xE445D6
= 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!
'-----------
' Movements
'-----------
#org 0xE44873
#raw 0x14 'Delay5
#raw 0x14 'Delay5
#raw 0xFE 'End of Movements
#org 0xE445B8
lock
faceplayer
checkflag 0x4FB
if 0x1 goto 0x8E445D6
checkflag 0x864
if 0x0 goto 0x8E44660
checkflag 0x864
if 0x1 goto 0x8E4467C
'---------------
#org 0xE445D6
warpteleport2 0xD9 0xE0 0xE0 0xB8 0xDDE0
'---------------
#org 0xE44660
playsong 0x1C2 0x0
msgbox 0x8E446E4 MSG_KEEPOPEN '"Welcome, challenger!\nI'm SIDNEY o..."
trainerbattle 0x3 0x105 0x0 0x8E44698
goto 0x8E447E2
'---------------
#org 0xE4467C
playsong 0x1C2 0x0
msgbox 0x8E446E4 MSG_KEEPOPEN '"Welcome, challenger!\nI'm SIDNEY o..."
trainerbattle 0x3 0x106 0x0 0x8E44698
goto 0x8E447E2
'---------------
#org 0xE447E2
setflag 0x4FB
call 0x8E447F5
msgbox 0x8E445D6 MSG_KEEPOPEN '"Well, listen to what this loser ha..."
release
end
'---------------
#org 0xE447F5
applymovement MOVE_PLAYER 0x8E44873
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
'---------
' Strings
'---------
#org 0xE446E4
= 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 0xE44698
= Well, how do you like that? I lost!\nEh, it was fun, so it doesn't matter.
#org 0xE445D6
= 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!
'-----------
' Movements
'-----------
#org 0xE44873
#raw 0x14 'Delay5
#raw 0x14 'Delay5
#raw 0xFE 'End of Movements
Why does the part in bold appear?
The script works fine when tested unless you talk to the npc a second time, at which it tries to warp
the player it seems.