Binary ROM HackingNeed a helping hand or just want to talk about binary ROM hacks? Get comments and answers to any ROM Hacking-related problems, questions or thoughts you have here.
Okay, so I have almost everything I need ready to idiot-proof the start of my romhack.
By idiot-proof, I mean forcing the player to set a healing place as this game (for reasons I wish not to disclose just yet) starts on Route 22, so that if for any reason the player's Pokemon faints before healing at a Pokemon Center, they don't end up in undesirable places within the game (had this happen when I was testing the difficulty of a battle in a different romhack, oof).
For route 22, I need two script tiles, the only difference being which directions the player and NPC need to face each other. I need them to play the event in the spoiler (note that the spoiler event works perfectly fine, I just need something similar to it for the tiles):
'---------
' Strings
'---------
#org 0x800138
= [red_fr]???: Oh, good, you're awake...\nDo you remember what happened?\lA group of thugs attacked you.\lThey knocked you out, and stole\lmost of your Pokemon. I fought\lthem off of you, but I'm afraid\lthey took off with every Pokemon\lyou had, except for your Sneasel.\lWhat's your name?\l...[player]? Nice to meet you, my\lname's Leaf. Now, let's go to the\lPokemon Center, your Sneasel may\lappear fine, but it doesn't hurt\lto let a nurse check it.
I apologize, I did forget to save a copy of the script as it was typed in XSE, but it's a simple enough script that it can still be understood. I can try to retype the original script if it helps.
For the Pokemon Center, this is the script I'm trying to use (this is just one of the directions), but it fails. The tiles are meant to make the player walk back to the tile they're supposed to be on, but it doesn't make them walk back, and sometimes the player will just be stuck until the game is reset.
Spoiler:
#dynamic 0x800400
#org @start
msgbox @no 0x4
closeonkeypress
applymovement 0xFF @back
end
#org @no
= [red_fr]Leaf: Don't leave without\nletting the nurse check on your\lSneasel...
#org @back
#raw 0x13
I have the person events working as desired, now if I can just get these script tiles working and out of the way, I can move on to the easier part of this game's beginning.
I really don't like asking for help with things like this, but I haven't hacked a rom in over a year, and kind of forgot how to do a lot of things. I had to relearn stuff. Any help is greatly appreciated.
__________________
Project Dream Ball founder.
Project Dream Ball intends to help trainers obtain rare Poke Balls and previous gen exclusive ribbons. For more information on Project Dream Ball, you can follow it for updates on Twitter and Tumblr
For route 22, I need two script tiles, the only difference being which directions the player and NPC need to face each other. I need them to play the event in the spoiler (note that the spoiler event works perfectly fine, I just need something similar to it for the tiles):
'---------
' Strings
'---------
#org 0x800138
= [red_fr]???: Oh, good, you're awake...\nDo you remember what happened?\lA group of thugs attacked you.\lThey knocked you out, and stole\lmost of your Pokemon. I fought\lthem off of you, but I'm afraid\lthey took off with every Pokemon\lyou had, except for your Sneasel.\lWhat's your name?\l...[player]? Nice to meet you, my\lname's Leaf. Now, let's go to the\lPokemon Center, your Sneasel may\lappear fine, but it doesn't hurt\lto let a nurse check it.
If you're using a script tile, then some commands such as faceplayer won't work correctly, this is because faceplayer moves the OW you're talking to, but on script tiles you're not interacting with an OW. When using script tiles you need to used the applymovement command any time you want an OW to move. Anyway, here's a 2-in-1 script that you can compile to get the effect you're looking for with some comments:
Spoiler:
#dynamic 0x800000
#org @script1
applymovement 0x1 @Right // In this case, I'm assuming that the OW's number is 0x1 and they're facing right
applymovement 0xFF @Left // Same goes for you, but you can change whichever way you want them to face
goto @Continue
#org @script2
applymovement 0x1 @Left // Movements are flipped, but once again, you can change them to whatever you want
applymovement 0xFF @Right
goto @Continue
#org @Continue
waitmovement 0x0 // Everything from this point on is shared, so there's no need to make two different scripts
msgbox @talk 0x6
setflag 0x828
givepokemon 0xD7 0x5 0x0 0x0 0x0 0x0
setvar 0x4011 0x1 // Variable 0x2000 is dangerous to use. Check out this thread to learn which variables you should use in FR
hidesprite 0x1
hidesprite 0x2
hidesprite 0x3
hidesprite 0x4
warpmuted 0x5 0x4 0xFF 0x7 0x4 // release and end aren't needed, as scripts always ends at a warp
#org @talk
= [red_fr]???: Oh, good, you're awake...\nDo you remember what happened?\lA group of thugs attacked you.\lThey knocked you out, and stole\lmost of your Pokemon. I fought\lthem off of you, but I'm afraid\lthey took off with every Pokemon\lyou had, except for your Sneasel.\lWhat's your name?\l...[player]? Nice to meet you, my\lname's Leaf. Now, let's go to the\lPokemon Center, your Sneasel may\lappear fine, but it doesn't hurt\lto let a nurse check it.
#org @Left
#raw 0x2
#raw 0xFE
#org @Right
#raw 0x3
#raw 0xFE
When you compile it in XSE, you will be given a few different offsets. You will need to copy both script1 and script2 to their respective script tiles.
Quote:
Originally Posted by OpalHeart
For the Pokemon Center, this is the script I'm trying to use (this is just one of the directions), but it fails. The tiles are meant to make the player walk back to the tile they're supposed to be on, but it doesn't make them walk back, and sometimes the player will just be stuck until the game is reset.
Spoiler:
#dynamic 0x800400
#org @start
msgbox @no 0x4
closeonkeypress
applymovement 0xFF @back
end
#org @no
= [red_fr]Leaf: Don't leave without\nletting the nurse check on your\lSneasel...
#org @back
#raw 0x13
The two main issues with this script are both movement related. Here's what it should look like:
Spoiler:
#dynamic 0x800000
#org @start
msgbox @no 0x6 // No need to use msgbox 0x4 and closeonkeypress
applymovement 0xFF @back
waitmovement 0x0 // Need to include waitmovement otherwise the script will terminate before the movements fully play out
end
#org @no
= [red_fr]Leaf: Don't leave without\nletting the nurse check on your\lSneasel...
#org @back
#raw 0x13
#raw 0xFE // You need to include 0xFE at the end of every movement offset to indicate the movements are finished
Hopefully these both help. If you have any more issues, don't hesitate to post them!
I can't believe I forgot about waitmovement for the Pokemon Center event oh my god. 😂
Thank you so much DrFuji. I'm going to try these out as soon as I fix a weird bug I accidentally created in my romhack.
__________________
Project Dream Ball founder.
Project Dream Ball intends to help trainers obtain rare Poke Balls and previous gen exclusive ribbons. For more information on Project Dream Ball, you can follow it for updates on Twitter and Tumblr