- 6
- Posts
- 11
- Years
- Seen Jul 8, 2021
Edit:
I fixed this myself, by going and setting the flag (in this case 0x200) after the first rival battle, before the 2nd script started
I then cleared the flag later on in a very simple script that looks like this
Just put this on a script at someplace the player HAS to walk, and you're good, or put it in a conversation :)
Hello everyone!
I'm working on my first romhack, but I have a problem.
At the start, after the first rival battle, I have a script that's a bit different and gives a lot of items, that's all good and works as it should, it looks like this:
The problem is, that right after this script ends, a later script is playing, which should play on a later map, it looks like this:
This one is assigned to the same sprite, but not the same var number or unknown number in AM.
Does anyone know what could cause this problem? I am thinking a way might be setting the flag right after the rival battle and then clearing it before the 2nd encounter.
I fixed this myself, by going and setting the flag (in this case 0x200) after the first rival battle, before the 2nd script started
I then cleared the flag later on in a very simple script that looks like this
Spoiler:
Code:
#dynamic 0x800000
#org @start
clearflag 0x200
end
Hello everyone!
I'm working on my first romhack, but I have a problem.
At the start, after the first rival battle, I have a script that's a bit different and gives a lot of items, that's all good and works as it should, it looks like this:
Spoiler:
Code:
'---------------
#org 0x8009D6
lockall
checkflag 0x829
if 0x1 goto 0x88013B2
setvar 0x4002 0x2
goto 0x816930B
'---------------
#org 0x8013B2
release
end
'---------------
#org 0x16930B
textcolor 0x0
playsong 0x13B 0x0
applymovement 0x8 0x81A75ED
waitmovement 0x0
applymovement MOVE_PLAYER 0x81A75E9
waitmovement 0x0
msgbox 0x8801133 MSG_NORMAL '"Yo! Let's test these bad boys\nIf ..."
closeonkeypress
applymovement 0x4 0x81A75F1
waitmovement 0x0
compare 0x4031 0x0
if 0x1 goto 0x81693D2
compare 0x4031 0x1
if 0x1 goto 0x816944D
compare 0x4031 0x2
if 0x1 goto 0x816935A
end
'---------------
#org 0x1693D2
compare 0x4002 0x1
if 0x1 goto 0x81693F4
compare 0x4002 0x2
if 0x1 goto 0x8169404
compare 0x4002 0x3
if 0x1 goto 0x8169414
end
'---------------
#org 0x16944D
compare 0x4002 0x1
if 0x1 goto 0x816946F
compare 0x4002 0x2
if 0x1 goto 0x816947F
compare 0x4002 0x3
if 0x1 goto 0x816948F
end
'---------------
#org 0x16935A
compare 0x4002 0x1
if 0x1 goto 0x816937C
compare 0x4002 0x2
if 0x1 goto 0x816938C
compare 0x4002 0x3
if 0x1 goto 0x816939C
end
'---------------
#org 0x1693F4
goto 0x8169424
'---------------
#org 0x169404
goto 0x8169424
'---------------
#org 0x169414
goto 0x8169424
'---------------
#org 0x16946F
goto 0x816949F
'---------------
#org 0x16947F
goto 0x816949F
'---------------
#org 0x16948F
goto 0x816949F
'---------------
#org 0x16937C
goto 0x81693AC
'---------------
#org 0x16938C
goto 0x81693AC
'---------------
#org 0x16939C
goto 0x81693AC
'---------------
#org 0x169424
trainerbattle 0x9 0x148 0x3 0x818DDEA 0x818DE1A
goto 0x81694C2
'---------------
#org 0x16949F
trainerbattle 0x9 0x147 0x3 0x818DDEA 0x818DE1A
goto 0x81694C2
'---------------
#org 0x1693AC
trainerbattle 0x9 0x146 0x3 0x818DDEA 0x818DE1A
goto 0x81694C2
'---------------
#org 0x1694C2
special 0x0
msgbox 0x88011B1 MSG_NORMAL '"Here, goodies from my grandmother."
checkitem 0x2 0x1
compare LASTRESULT 0x1
if 0x3 goto 0x8801089
closeonkeypress
playsong 0x13C 0x0
compare 0x4002 0x1
if 0x1 call 0x8169504
compare 0x4002 0x2
if 0x1 call 0x8169516
compare 0x4002 0x3
if 0x1 call 0x8169528
hidesprite 0x84F
nop
warpmuted 0x95 0x16 0x8 0xFF4F 0x5300
updatemoney 0x16 0x8 0x51
gotostd 0x0
'---------------
#org 0x801089
special 0x16F
setflag 0x828
setflag 0x829
fanfare 0x13E
msgbox 0x8801194 MSG_NORMAL '"Obtained the national dex."
giveitem 0x2 0x20 MSG_OBTAIN
giveitem 0x15 0x10 MSG_OBTAIN
fanfare 0x13E
waitfanfare
msgbox 0x8801267 MSG_NORMAL '"I'll get you back!\nCya!"
checkflag 0x200
if 0x1 goto 0x8801110
msgbox 0x8801361 MSG_NORMAL '"[rival]: Yo [player]\nWelcome to J..."
applymovement 0x9 0x8801244
waitmovement 0x0
pause 0x30
msgbox 0x88014A2 MSG_NORMAL '"I see you're freeloading!\pIf we u..."
playsong 0x13E 0x0
applymovement 0x9 0x8801344
applymovement MOVE_PLAYER 0x8801344
waitmovement 0x0
hidesprite 0x9
setflag 0x200
warp 0x6 0x4 0x1 0x0 0x0
fadesong 0x12C
release
end
'---------------
#org 0x169504
applymovement 0x8 0x816953A
applymovement MOVE_PLAYER 0x8169553
waitmovement 0x8
return
'---------------
#org 0x169516
applymovement 0x8 0x816954A
applymovement MOVE_PLAYER 0x8169553
waitmovement 0x8
return
'---------------
#org 0x169528
applymovement 0x8 0x8169542
applymovement MOVE_PLAYER 0x8169559
waitmovement 0x8
return
'---------------
#org 0x801110
hidesprite 0x9
release
end
'---------
' Strings
'---------
#org 0x801133
= Yo! Let's test these bad boys\nIf you win, you can have a bit\pof the package I received earlier
#org 0x18DDEA
= Damn, well played!
#org 0x18DE1A
= [rival]: Yeah!\nAm I great or what?
#org 0x8011B1
= Here, goodies from my grandmother.
#org 0x801194
= Obtained the national dex.
#org 0x801267
= I'll get you back!\nCya!
#org 0x801361
= [rival]: Yo [player]\nWelcome to Juelsminde
#org 0x8014A2
= I see you're freeloading!\pIf we use your flaming hair\nto cook, we can save electricity\p Anyways, follow me <3
'-----------
' Movements
'-----------
#org 0x1A75ED
#raw 0x2D 'Face Down (Delayed)
#raw 0xFE 'End of Movements
#org 0x1A75E9
#raw 0x2E 'Face Up (Delayed)
#raw 0xFE 'End of Movements
#org 0x1A75F1
#raw 0x0 'Face Down
#raw 0xFE 'End of Movements
#org 0x801244
#raw 0x10 'Step Down (Normal)
#raw 0x10 'Step Down (Normal)
#raw 0x10 'Step Down (Normal)
#raw 0x10 'Step Down (Normal)
#raw 0xFE 'End of Movements
#org 0x801344
#raw 0x58 'Jump in Place (Facing Left/Right)
#raw 0x11 'Step Up (Normal)
#raw 0x11 'Step Up (Normal)
#raw 0x11 'Step Up (Normal)
#raw 0x11 'Step Up (Normal)
#raw 0x11 'Step Up (Normal)
#raw 0x11 'Step Up (Normal)
#raw 0x13 'Step Right (Normal)
#raw 0x13 'Step Right (Normal)
#raw 0x13 'Step Right (Normal)
#raw 0x13 'Step Right (Normal)
#raw 0x13 'Step Right (Normal)
#raw 0x13 'Step Right (Normal)
#raw 0x13 'Step Right (Normal)
#raw 0x13 'Step Right (Normal)
#raw 0x13 'Step Right (Normal)
#raw 0x13 'Step Right (Normal)
#raw 0x13 'Step Right (Normal)
#raw 0x13 'Step Right (Normal)
#raw 0x13 'Step Right (Normal)
#raw 0x13 'Step Right (Normal)
#raw 0x13 'Step Right (Normal)
#raw 0x13 'Step Right (Normal)
#raw 0x11 'Step Up (Normal)
#raw 0x11 'Step Up (Normal)
#raw 0x11 'Step Up (Normal)
#raw 0x11 'Step Up (Normal)
#raw 0xFE 'End of Movements
#org 0x16953A
#raw 0x13 'Step Right (Normal)
#raw 0x10 'Step Down (Normal)
#raw 0x10 'Step Down (Normal)
#raw 0x10 'Step Down (Normal)
#raw 0x10 'Step Down (Normal)
#raw 0x10 'Step Down (Normal)
#raw 0x1B 'Delay4
#raw 0xFE 'End of Movements
#org 0x169553
#raw 0x1C 'Delay5
#raw 0x1B 'Delay4
#raw 0x30 'Face Right (Delayed)
#raw 0x1C 'Delay5
#raw 0x2D 'Face Down (Delayed)
#raw 0xFE 'End of Movements
#org 0x16954A
#raw 0x13 'Step Right (Normal)
#raw 0x10 'Step Down (Normal)
#raw 0x10 'Step Down (Normal)
#raw 0x10 'Step Down (Normal)
#raw 0x12 'Step Left (Normal)
#raw 0x10 'Step Down (Normal)
#raw 0x10 'Step Down (Normal)
#raw 0x1B 'Delay4
#raw 0xFE 'End of Movements
#org 0x169542
#raw 0x12 'Step Left (Normal)
#raw 0x10 'Step Down (Normal)
#raw 0x10 'Step Down (Normal)
#raw 0x10 'Step Down (Normal)
#raw 0x10 'Step Down (Normal)
#raw 0x10 'Step Down (Normal)
#raw 0x1B 'Delay4
#raw 0xFE 'End of Movements
#org 0x169559
#raw 0x1C 'Delay5
#raw 0x1B 'Delay4
#raw 0x2F 'Face Left (Delayed)
#raw 0x1C 'Delay5
#raw 0x2D 'Face Down (Delayed)
#raw 0xFE 'End of Movements
The problem is, that right after this script ends, a later script is playing, which should play on a later map, it looks like this:
Spoiler:
Code:
'---------------
#org 0x8010C1
checkflag 0x200
if 0x1 goto 0x8801110
msgbox 0x8801361 MSG_NORMAL '"[rival]: Yo [player]\nWelcome to J..."
applymovement 0x9 0x8801244
waitmovement 0x0
pause 0x30
msgbox 0x88014A2 MSG_NORMAL '"I see you're freeloading!\pIf we u..."
playsong 0x13E 0x0
applymovement 0x9 0x8801344
applymovement MOVE_PLAYER 0x8801344
waitmovement 0x0
hidesprite 0x9
setflag 0x200
warp 0x6 0x4 0x1 0x0 0x0
fadesong 0x12C
release
end
'---------------
#org 0x801110
hidesprite 0x9
release
end
'---------
' Strings
'---------
#org 0x801361
= [rival]: Yo [player]\nWelcome to Juelsminde
#org 0x8014A2
= I see you're freeloading!\pIf we use your flaming hair\nto cook, we can save electricity\p Anyways, follow me <3
'-----------
' Movements
'-----------
#org 0x801244
#raw 0x10 'Step Down (Normal)
#raw 0x10 'Step Down (Normal)
#raw 0x10 'Step Down (Normal)
#raw 0x10 'Step Down (Normal)
#raw 0xFE 'End of Movements
#org 0x801344
#raw 0x58 'Jump in Place (Facing Left/Right)
#raw 0x11 'Step Up (Normal)
#raw 0x11 'Step Up (Normal)
#raw 0x11 'Step Up (Normal)
#raw 0x11 'Step Up (Normal)
#raw 0x11 'Step Up (Normal)
#raw 0x11 'Step Up (Normal)
#raw 0x13 'Step Right (Normal)
#raw 0x13 'Step Right (Normal)
#raw 0x13 'Step Right (Normal)
#raw 0x13 'Step Right (Normal)
#raw 0x13 'Step Right (Normal)
#raw 0x13 'Step Right (Normal)
#raw 0x13 'Step Right (Normal)
#raw 0x13 'Step Right (Normal)
#raw 0x13 'Step Right (Normal)
#raw 0x13 'Step Right (Normal)
#raw 0x13 'Step Right (Normal)
#raw 0x13 'Step Right (Normal)
#raw 0x13 'Step Right (Normal)
#raw 0x13 'Step Right (Normal)
#raw 0x13 'Step Right (Normal)
#raw 0x13 'Step Right (Normal)
#raw 0x11 'Step Up (Normal)
#raw 0x11 'Step Up (Normal)
#raw 0x11 'Step Up (Normal)
#raw 0x11 'Step Up (Normal)
#raw 0xFE 'End of Movements
This one is assigned to the same sprite, but not the same var number or unknown number in AM.
Does anyone know what could cause this problem? I am thinking a way might be setting the flag right after the rival battle and then clearing it before the 2nd encounter.
Last edited: