- 8
- Posts
- 6
- Years
- Seen Sep 28, 2022
So I am still desperate failing to find out what's wrong with my script for my Emerald based hack. It is supposed to activate, when you step on a certain script in the OW.
What I want the script to do is: First to check that the event hasnt happened yet and to make sure that a certain sprite is hidden until one has fought the rival in Rustboro City.
Once that is done, stepping on the script shall make you (/the protagonist) notice (#raw 0x56) that a new person is on the map who wants to battle you. Screen fades black, you are slightly warped, screen turns normal, and the person appears and walks towards you. Blabla and Battle. After you win, the person gives you an item and walks away and disappears again (hidesprite 0x23).
By experimenting, I could figure out that the script would hide the sprite when neither flag 0x23 nor 0xD3 are set. As it is supposed to do. Only when flag 0xD3 is activated, the according subscript freezes the game.
The Script:
EDIT/Solved: I had to figure out that all my problems were mostly caused by a too great tile-distance of the script and the NPC. I assumed warping the player closer to the NPC would avoid that. It did not though. Fixing OW positions "fixed" the script.
What I want the script to do is: First to check that the event hasnt happened yet and to make sure that a certain sprite is hidden until one has fought the rival in Rustboro City.
Once that is done, stepping on the script shall make you (/the protagonist) notice (#raw 0x56) that a new person is on the map who wants to battle you. Screen fades black, you are slightly warped, screen turns normal, and the person appears and walks towards you. Blabla and Battle. After you win, the person gives you an item and walks away and disappears again (hidesprite 0x23).
By experimenting, I could figure out that the script would hide the sprite when neither flag 0x23 nor 0xD3 are set. As it is supposed to do. Only when flag 0xD3 is activated, the according subscript freezes the game.
The Script:
Spoiler:
#dynamic 0x800000
#freespace 0xFF
#org @start
checkflag 0x23 //the flag is off in the beginning
if 0x1 goto @end1
checkflag 0xD3 //assures that the main purpose only activates after battling the rival in Rustboro City
if 0x1 goto @battle
hidesprite 0x23
release
end
#org @end1
hidesprite 0x23
release
end
#org @battle
lock
applymovement 0xFF @moveEX
waitmovement 0x0
fadescreen 0x1
showsprite 0x23
warp 0x0 0x13 0xFF 0x17 0x2C //moves the hero into another location on the same map
fadescreen 0x0
applymovement 0x23 @movetohero
waitmovement 0x0
msgbox @text1 0x6
trainerbattle 0x1 0x287 0x0 @beforeb @afterb @laterb
release
end
#org @laterb
msgbox @textafter 0x6
giveitem 0x1DB 0x1 MSG_Obtain
msgbox @bye 0x6
applymovement 0x23 @runaway
waitmovement 0x0
hidesprite 0x23
setflag 0x23
release
end
Movements:
Strings:
#freespace 0xFF
#org @start
checkflag 0x23 //the flag is off in the beginning
if 0x1 goto @end1
checkflag 0xD3 //assures that the main purpose only activates after battling the rival in Rustboro City
if 0x1 goto @battle
hidesprite 0x23
release
end
#org @end1
hidesprite 0x23
release
end
#org @battle
lock
applymovement 0xFF @moveEX
waitmovement 0x0
fadescreen 0x1
showsprite 0x23
warp 0x0 0x13 0xFF 0x17 0x2C //moves the hero into another location on the same map
fadescreen 0x0
applymovement 0x23 @movetohero
waitmovement 0x0
msgbox @text1 0x6
trainerbattle 0x1 0x287 0x0 @beforeb @afterb @laterb
release
end
#org @laterb
msgbox @textafter 0x6
giveitem 0x1DB 0x1 MSG_Obtain
msgbox @bye 0x6
applymovement 0x23 @runaway
waitmovement 0x0
hidesprite 0x23
setflag 0x23
release
end
Movements:
Spoiler:
#org @moveEX
#raw 0x56
#raw 0xFE
#org @movetohero
#raw 0x09
#raw 0x09
#raw 0x09
#raw 0x09
#raw 0x09
#raw 0x09
#raw 0x09
#raw 0x09
#raw 0xFE
#org @runaway
#raw 0x15
#raw 0x15
#raw 0x15
#raw 0x15
#raw 0x15
#raw 0x15
#raw 0x15
#raw 0x15
#raw 0x15
#raw 0xFE
#raw 0x56
#raw 0xFE
#org @movetohero
#raw 0x09
#raw 0x09
#raw 0x09
#raw 0x09
#raw 0x09
#raw 0x09
#raw 0x09
#raw 0x09
#raw 0xFE
#org @runaway
#raw 0x15
#raw 0x15
#raw 0x15
#raw 0x15
#raw 0x15
#raw 0x15
#raw 0x15
#raw 0x15
#raw 0x15
#raw 0xFE
Strings:
Spoiler:
#org @text1
= There you are again! I'm glad to\nmeet you here. I spent the past\ldays training my Pokémon a lot.\lLet me show you how to battle like\la champ!
#org @beforeb
= Let's get it started!
#org @afterb
= Aaargh...
#org @textafter
= I can't believe that I have lost.\nI guess I still have to grow...\lbut don't worry. I will challange\lyou again. You should keep the\ltraining! Maybe this TM can help\lyou.
#org @bye
= I got to jet. See you soon!
= There you are again! I'm glad to\nmeet you here. I spent the past\ldays training my Pokémon a lot.\lLet me show you how to battle like\la champ!
#org @beforeb
= Let's get it started!
#org @afterb
= Aaargh...
#org @textafter
= I can't believe that I have lost.\nI guess I still have to grow...\lbut don't worry. I will challange\lyou again. You should keep the\ltraining! Maybe this TM can help\lyou.
#org @bye
= I got to jet. See you soon!
EDIT/Solved: I had to figure out that all my problems were mostly caused by a too great tile-distance of the script and the NPC. I assumed warping the player closer to the NPC would avoid that. It did not though. Fixing OW positions "fixed" the script.
Last edited: