- 36
- Posts
- 10
- Years
- United States
- Seen Dec 7, 2022
I am trying to get a script together where the players rival appears, walks toward the player, has a battle, and then walks away and disappears.
Every aspect works so far except after the battle ends the script comes to a hard stop and the sprite is back where it was initially.
If i walk back on the tile that should trigger the event the rival sprite walks toward me (like he did the first time) and then walks away and disappears for good like he was supposed to after the battle.
Is there a specific command I need to include after trainerbattle to ensure that the script plays onward?
Do I need to use the trainerbattle 0x1 command when including a battle in a tile script?
Here is the script I used.
Every aspect works so far except after the battle ends the script comes to a hard stop and the sprite is back where it was initially.
If i walk back on the tile that should trigger the event the rival sprite walks toward me (like he did the first time) and then walks away and disappears for good like he was supposed to after the battle.
Is there a specific command I need to include after trainerbattle to ensure that the script plays onward?
Do I need to use the trainerbattle 0x1 command when including a battle in a tile script?
Here is the script I used.
Spoiler:
#dynamic 0x904000
#org @start
lockall
checkflag 0x202
if 0x1 goto @done
showsprite 0x01
applymovement 0x01 @move1
waitmovement 0x0
call @battle
setflag 0x202
applymovement 0x01 @move2
waitmovement 0x0
hidesprite 0x01
releaseall
end
#org @battle
trainerbattle 0x0 0x169 0x0 @before @after
return
#org @done
releaseall
end
#org @before
= before
#org @after
= after
#org @move1
#raw 0x10
#raw 0x10
#raw 0x10
#raw 0x10
#raw 0x10
#raw 0xFE
#org @move2
#raw 0x1
#raw 0x11
#raw 0x11
#raw 0x11
#raw 0x11
#raw 0x11
#raw 0xFE
#org @start
lockall
checkflag 0x202
if 0x1 goto @done
showsprite 0x01
applymovement 0x01 @move1
waitmovement 0x0
call @battle
setflag 0x202
applymovement 0x01 @move2
waitmovement 0x0
hidesprite 0x01
releaseall
end
#org @battle
trainerbattle 0x0 0x169 0x0 @before @after
return
#org @done
releaseall
end
#org @before
= before
#org @after
= after
#org @move1
#raw 0x10
#raw 0x10
#raw 0x10
#raw 0x10
#raw 0x10
#raw 0xFE
#org @move2
#raw 0x1
#raw 0x11
#raw 0x11
#raw 0x11
#raw 0x11
#raw 0x11
#raw 0xFE