- 19
- Posts
- 5
- Years
- Seen Jan 9, 2022
Hey all, glad you stopped by! Title is explanatory enough; I want to have an event script continue running after a trainer battle. I've tried everything I can think of to no avail. I then reverse-engineered a script from the base game where the player battles his rival. The only thing different I could see was that the script called the trainer battle and then returned to the main body. I tried that, and the script still ends. I also tried changing the trainer battle type from the usual 0x0 to the rival's 0x9 just to see what it would do, and nothing changed. Here's my code:
TL;DR of that code: an NPC is startled by the player, grabs some fossils (the hidesprite commands), battles the player, gives the player the Helix Fossil, and runs off.
Anyone have any past experience with this, or maybe some experimental ideas? I'm stumped. Thanks all for reading <3
Spoiler:
#dynamic 0x800000
#org @start
lock
applymovement 0x3 @first
waitmovement 0x0
pause 0x060
msgbox @hello 0x6
applymovement 0x3 @gather
pause 0x010
hidesprite 0x1
hidesprite 0x2
waitmovement 0x3
call @battle
msgbox @incentive 0x6
getplayerpos 0x4014 0x4015
compare 0x4015 0x25
if 0x1 goto @top
goto @bottom
#org @top
applymovement 0x3 @topMove
waitmovement 0x3
fanfare 0x13E
giveitem 0x165 0x1 MSG_OBTAIN
waitfanfare
msgbox @goodbye 0x6
applymovement 0x3 @topMoveOut
waitmovement 0x3
sound 0x09
hidesprite 0x3
setflag 0x02F
setvar 0x408B 0x1
release
end
#org @bottom
applymovement 0x3 @bottomMove
waitmovement 0x3
fanfare 0x13E
giveitem 0x165 0x1 MSG_OBTAIN
waitfanfare
msgbox @goodbye 0x6
applymovement 0x3 @bottomMoveOut
waitmovement 0x3
sound 0x09
hidesprite 0x3
setflag 0x02F
setvar 0x408B 0x1
release
end
#org @battle
trainerbattle 0x0 0x01 0x0 @challenge @defeat
return
#org @first
#raw 0x62
#raw 0x03
#raw 0xFE
#org @hello
= [red_fr]A child? I would have thought my\nTRIED brethren had the strength to\lhalt any intruder.\pIt would appear I was incorrect.\pWhatever you want here--it is no\nmatter! These are for THE TRIED!
#org @gather
#raw 0x1F
#raw 0x1F
#raw 0x1E
#raw 0x20
#raw 0x1D
#raw 0x20
#raw 0xFE
#org @challenge
= [red_fr]Now to deal with you!
#org @defeat
= It would appear once more that I\nwas incorrect. You show promise.
#org @incentive
= [red_fr]That promise may prove fruitful.\pAs such, I'll allow you to walk\naway with one of these relics.\pPerhaps the more... "Religious"\none should mozy its way into your\lpockets.
#org @topMove
#raw 0x13
#raw 0xFE
#org @goodbye
= [red_fr]When you look at this relic of\nold, I hope you think of THE\lTRIED.\pIn due time, perhaps you'll join\nus as a higher-ranking member.\pFarewell, child.
#org @topMoveOut
#raw 0x12
#raw 0x12
#raw 0x11
#raw 0x11
#raw 0xFE
#org @bottomMove
#raw 0x10
#raw 0x13
#raw 0xFE
#org @bottomMoveOut
#raw 0x12
#raw 0x12
#raw 0x11
#raw 0x11
#raw 0x11
#raw 0xFE
#org @start
lock
applymovement 0x3 @first
waitmovement 0x0
pause 0x060
msgbox @hello 0x6
applymovement 0x3 @gather
pause 0x010
hidesprite 0x1
hidesprite 0x2
waitmovement 0x3
call @battle
msgbox @incentive 0x6
getplayerpos 0x4014 0x4015
compare 0x4015 0x25
if 0x1 goto @top
goto @bottom
#org @top
applymovement 0x3 @topMove
waitmovement 0x3
fanfare 0x13E
giveitem 0x165 0x1 MSG_OBTAIN
waitfanfare
msgbox @goodbye 0x6
applymovement 0x3 @topMoveOut
waitmovement 0x3
sound 0x09
hidesprite 0x3
setflag 0x02F
setvar 0x408B 0x1
release
end
#org @bottom
applymovement 0x3 @bottomMove
waitmovement 0x3
fanfare 0x13E
giveitem 0x165 0x1 MSG_OBTAIN
waitfanfare
msgbox @goodbye 0x6
applymovement 0x3 @bottomMoveOut
waitmovement 0x3
sound 0x09
hidesprite 0x3
setflag 0x02F
setvar 0x408B 0x1
release
end
#org @battle
trainerbattle 0x0 0x01 0x0 @challenge @defeat
return
#org @first
#raw 0x62
#raw 0x03
#raw 0xFE
#org @hello
= [red_fr]A child? I would have thought my\nTRIED brethren had the strength to\lhalt any intruder.\pIt would appear I was incorrect.\pWhatever you want here--it is no\nmatter! These are for THE TRIED!
#org @gather
#raw 0x1F
#raw 0x1F
#raw 0x1E
#raw 0x20
#raw 0x1D
#raw 0x20
#raw 0xFE
#org @challenge
= [red_fr]Now to deal with you!
#org @defeat
= It would appear once more that I\nwas incorrect. You show promise.
#org @incentive
= [red_fr]That promise may prove fruitful.\pAs such, I'll allow you to walk\naway with one of these relics.\pPerhaps the more... "Religious"\none should mozy its way into your\lpockets.
#org @topMove
#raw 0x13
#raw 0xFE
#org @goodbye
= [red_fr]When you look at this relic of\nold, I hope you think of THE\lTRIED.\pIn due time, perhaps you'll join\nus as a higher-ranking member.\pFarewell, child.
#org @topMoveOut
#raw 0x12
#raw 0x12
#raw 0x11
#raw 0x11
#raw 0xFE
#org @bottomMove
#raw 0x10
#raw 0x13
#raw 0xFE
#org @bottomMoveOut
#raw 0x12
#raw 0x12
#raw 0x11
#raw 0x11
#raw 0x11
#raw 0xFE
TL;DR of that code: an NPC is startled by the player, grabs some fossils (the hidesprite commands), battles the player, gives the player the Helix Fossil, and runs off.
Anyone have any past experience with this, or maybe some experimental ideas? I'm stumped. Thanks all for reading <3