So as I was testing my rom, this happens:
So basically, after the battle my playable character freezes and the NPC right next to the character I battled takes over from him. What am I doing wrong?
This is the script of the guy I battled:
#org 0x878F28C
'-----------------------------------
checkflag 0x237
if true jump 0x878F2AC ' Flag is set
trainerbattle 0x1 0x8 0x0 0x878F2B5 0x878F2D6 0x878F2A8
end
#org 0x878F2AC
'-----------------------------------
msgbox 0x878F301 ' You might even be ab...
callstd MSG_LOCK ' Built-in lock command
end
#org 0x878F2A8
'-----------------------------------
setflag 0x237
end
#org 0x878F2B5
= Prepare to get your butt kicked!
#org 0x878F2D6
= Maybe I should try punching you\nnext time!
#org 0x878F301
= You might even be able to\nchallenge our sensei!
And this is the script of the guy right next to it. The basic idea is that I have to beat the two guys next to him first before i can challenge him, and it USED to work when I tested it outside of the cave :(
#org 0x878F3F9
'-----------------------------------
lock
faceplayer
checkflag 0x237
if true jump 0x878F40E ' Flag is set
msgbox 0x878F4EB ' My name is ANTHONY! ...
callstd MSG_LOCK ' Built-in lock command
release
end
#org 0x878F40E
'-----------------------------------
checkflag 0x238
if true jump 0x878F421 ' Flag is set
msgbox 0x878F491 ' So, you managed to b...
callstd MSG_LOCK ' Built-in lock command
release
end
#org 0x878F421
'-----------------------------------
checkflag 0x239
if true call 0x878F468 ' Flag is set
call 0x878F431
release
end
#org 0x878F468
'-----------------------------------
msgbox 0x878F57F ' I really enjoyed our...
callstd MSG_YESNO ' Yes/No message
compare LASTRESULT NO
if == jump 0x878F487 ' Equal To
trainerbattle 0x3 0xA 0x0 0x878F6F2
release
end
#org 0x878F487
'-----------------------------------
msgbox 0x878F6BB ' I'll be training her...
callstd MSG_LOCK ' Built-in lock command
release
end
#org 0x878F431
'-----------------------------------
trainerbattle 0x1 0xA 0x0 0x878F5BE 0x878F62C 0x878F444
return
#org 0x878F444
'-----------------------------------
checkflag 0x239
if false call 0x878F44F ' Flag is unset
release
end
#org 0x878F44F
'-----------------------------------
msgbox 0x878F642 ' You're the real deal...
callstd MSG_NOCLOSE ' Non-closing message
copyvarifnotzero 0x8000 FOCUSBAND
copyvarifnotzero 0x8001 0x1
callstd MSG_OBTAIN ' Obtained the XXXXXX!
setflag 0x239
release
end
#org 0x878F4EB
= My name is ANTHONY! I'm a P1\nGrand Prix Champion from the\lKANTO region. I don't take on\lrookies. If you wish to challenge\lme, beat my pupils first!
#org 0x878F491
= So, you managed to beat one of my\npupils. Impressive. But can you\lbeat the other one too?
#org 0x878F57F
= I really enjoyed our battle. I am\nalways in for another round!
#org 0x878F6F2
= I bite the dust again.
#org 0x878F6BB
= I'll be training here for a while\nif you ever need me.
#org 0x878F5BE
= I enjoyed how you smashed my\npupils to pulp. But I'm in a\lcompletely different league.\lPrepare to be crushed!
#org 0x878F62C
= I can't believe it...
#org 0x878F642
= You're the real deal, kid. This is\na gift from me to you. May it help\lyou on your journey in the most\luncertain moments.
Truth be told, All the scripts I tested before in the hometown stop working in that cave. I also made a script where I could have a re-match with someone, and it worked fine before. So I implement it in my real game (i use backups to try my scripts first) and now all of a sudden it doesn't work anymore all of a sudden. What happens is either the game thinks that you're having two battles at once and it calls the same pokémon twice in a double battle, or it immediately freezes when I approach the trainer. I'll share that script as well, cause you never know if anyone finds what's wrong with it all of a sudden.
#dyn 0x740000
#org @begin
lock
faceplayer
trainerbattle 0x0 005 0x0 @intro @defeat
compare LASTRESULT 1
if true call @second
msgbox @afterwards
callstd msg_normal
release
end
#org @second
msgbox @yesornoquestion
callstd MSG_YESNO
compare LASTRESULT NO
if == jump @nomessage
trainerbattle 0x03 005 0x0 @loseagaintext
release
end
#org @nomessage
msgbox @nomessage1
callstd MSG_normal
release
end
#org @yesornoquestion
= Let's battle again!
#org @intro
= Get ready for the show!
#org @defeat
= Show's over...
#org @afterwards
= You outclassed me.
#org @nomessage1
= Fine. You know where to find\me!
#org @loseagaintext
= You're too strong.
So basically, after the battle my playable character freezes and the NPC right next to the character I battled takes over from him. What am I doing wrong?
This is the script of the guy I battled:
#org 0x878F28C
'-----------------------------------
checkflag 0x237
if true jump 0x878F2AC ' Flag is set
trainerbattle 0x1 0x8 0x0 0x878F2B5 0x878F2D6 0x878F2A8
end
#org 0x878F2AC
'-----------------------------------
msgbox 0x878F301 ' You might even be ab...
callstd MSG_LOCK ' Built-in lock command
end
#org 0x878F2A8
'-----------------------------------
setflag 0x237
end
#org 0x878F2B5
= Prepare to get your butt kicked!
#org 0x878F2D6
= Maybe I should try punching you\nnext time!
#org 0x878F301
= You might even be able to\nchallenge our sensei!
And this is the script of the guy right next to it. The basic idea is that I have to beat the two guys next to him first before i can challenge him, and it USED to work when I tested it outside of the cave :(
#org 0x878F3F9
'-----------------------------------
lock
faceplayer
checkflag 0x237
if true jump 0x878F40E ' Flag is set
msgbox 0x878F4EB ' My name is ANTHONY! ...
callstd MSG_LOCK ' Built-in lock command
release
end
#org 0x878F40E
'-----------------------------------
checkflag 0x238
if true jump 0x878F421 ' Flag is set
msgbox 0x878F491 ' So, you managed to b...
callstd MSG_LOCK ' Built-in lock command
release
end
#org 0x878F421
'-----------------------------------
checkflag 0x239
if true call 0x878F468 ' Flag is set
call 0x878F431
release
end
#org 0x878F468
'-----------------------------------
msgbox 0x878F57F ' I really enjoyed our...
callstd MSG_YESNO ' Yes/No message
compare LASTRESULT NO
if == jump 0x878F487 ' Equal To
trainerbattle 0x3 0xA 0x0 0x878F6F2
release
end
#org 0x878F487
'-----------------------------------
msgbox 0x878F6BB ' I'll be training her...
callstd MSG_LOCK ' Built-in lock command
release
end
#org 0x878F431
'-----------------------------------
trainerbattle 0x1 0xA 0x0 0x878F5BE 0x878F62C 0x878F444
return
#org 0x878F444
'-----------------------------------
checkflag 0x239
if false call 0x878F44F ' Flag is unset
release
end
#org 0x878F44F
'-----------------------------------
msgbox 0x878F642 ' You're the real deal...
callstd MSG_NOCLOSE ' Non-closing message
copyvarifnotzero 0x8000 FOCUSBAND
copyvarifnotzero 0x8001 0x1
callstd MSG_OBTAIN ' Obtained the XXXXXX!
setflag 0x239
release
end
#org 0x878F4EB
= My name is ANTHONY! I'm a P1\nGrand Prix Champion from the\lKANTO region. I don't take on\lrookies. If you wish to challenge\lme, beat my pupils first!
#org 0x878F491
= So, you managed to beat one of my\npupils. Impressive. But can you\lbeat the other one too?
#org 0x878F57F
= I really enjoyed our battle. I am\nalways in for another round!
#org 0x878F6F2
= I bite the dust again.
#org 0x878F6BB
= I'll be training here for a while\nif you ever need me.
#org 0x878F5BE
= I enjoyed how you smashed my\npupils to pulp. But I'm in a\lcompletely different league.\lPrepare to be crushed!
#org 0x878F62C
= I can't believe it...
#org 0x878F642
= You're the real deal, kid. This is\na gift from me to you. May it help\lyou on your journey in the most\luncertain moments.
Truth be told, All the scripts I tested before in the hometown stop working in that cave. I also made a script where I could have a re-match with someone, and it worked fine before. So I implement it in my real game (i use backups to try my scripts first) and now all of a sudden it doesn't work anymore all of a sudden. What happens is either the game thinks that you're having two battles at once and it calls the same pokémon twice in a double battle, or it immediately freezes when I approach the trainer. I'll share that script as well, cause you never know if anyone finds what's wrong with it all of a sudden.
#dyn 0x740000
#org @begin
lock
faceplayer
trainerbattle 0x0 005 0x0 @intro @defeat
compare LASTRESULT 1
if true call @second
msgbox @afterwards
callstd msg_normal
release
end
#org @second
msgbox @yesornoquestion
callstd MSG_YESNO
compare LASTRESULT NO
if == jump @nomessage
trainerbattle 0x03 005 0x0 @loseagaintext
release
end
#org @nomessage
msgbox @nomessage1
callstd MSG_normal
release
end
#org @yesornoquestion
= Let's battle again!
#org @intro
= Get ready for the show!
#org @defeat
= Show's over...
#org @afterwards
= You outclassed me.
#org @nomessage1
= Fine. You know where to find\me!
#org @loseagaintext
= You're too strong.
Last edited: