The PokéCommunity Forums  

Go Back   The PokéCommunity Forums > Fan Games > Binary ROM Hacking
Reload this Page Script How to write a "walk over script"?

Notices
For all updates, view the main page.

Binary ROM Hacking Need 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.

Ad Content
Reply
 
Thread Tools
  #1   Link to this post, but load the entire thread.  
Old February 15th, 2018 (3:20 AM). Edited February 15th, 2018 by DTD.
DTD DTD is offline
 
Join Date: Dec 2016
Gender: Male
Posts: 13
Probably everyone had that moment when then try so desperately to get out of Pallet Town but got stopped by the mighty professor Oak. So my question is how do I write a script like that, you know, a script that actives once and once only when you "step on" a specific tile. I know the question is vague, so to make it a little bit clearer, let just say I want to write a simple script like this: " when the player step on "the tile", a message box appear that said : that's the right spot". How do I write such a script like that in gen 3 fire red?
Reply With Quote
  #2   Link to this post, but load the entire thread.  
Old February 15th, 2018 (3:33 PM).
Avara's Avatar
Avara Avara is offline
 
Join Date: Dec 2011
Gender: Female
Nature: Relaxed
Posts: 1,305
Quote:
Originally Posted by DTD View Post
Probably everyone had that moment when then try so desperately to get out of Pallet Town but got stopped by the mighty professor Oak. So my question is how do I write a script like that, you know, a script that actives once and once only when you "step on" a specific tile. I know the question is vague, so to make it a little bit clearer, let just say I want to write a simple script like this: " when the player step on "the tile", a message box appear that said : that's the right spot". How do I write such a script like that in gen 3 fire red?
Not sure how familiar you are with AdvanceMap, but if you open Pallet Town and click the "Events" tab you'll see these little green "S"s (I cannot think of a better description for these right now lol) on top of the tiles where Oak's script triggers - you'll have to make use of those =) You'll need to use a variable in your script. Let's look at Oak's Pallet Town trigger:



If you open that script in XSE, you'll see a line that reads setvar 0x4050 0x1. Notice how in the above image, the "Var Number" box also contains the number 4050 and in the "Value" box it's 0. This means that this script will only run when var 4050's value is 0. During Oak's script, var 4050 is set to 1, which ensures the script doesn't repeat.

This post contains a lot of info on what many of FireRed's variables are used for and which numbers are safe to use. More on how to use variables here. Hope this helped <3
__________________
Reply With Quote
  #3   Link to this post, but load the entire thread.  
Old February 15th, 2018 (8:08 PM).
DTD DTD is offline
 
Join Date: Dec 2016
Gender: Male
Posts: 13
I was eager to have an answer when I posted this question, but answer from Avara herself and right the day after? Wow, seems like I have posted at the right place. And yes, your answer does help a lot, as I managed to write the script I asked for yesterday. Thank you very much :P

Sorry to bother you again, but I still have one question though. In the thread "Flags, Vars, and Script Tiles", karatekid552 written
Quote:
In general, only vars 0x4011-0x40FF are the safe
I really don't know anything about hexadecimal stuff, so what are the values between these two.. number(?)
Reply With Quote
  #4   Link to this post, but load the entire thread.  
Old February 20th, 2018 (8:05 AM).
Avara's Avatar
Avara Avara is offline
 
Join Date: Dec 2011
Gender: Female
Nature: Relaxed
Posts: 1,305
Quote:
Originally Posted by DTD View Post
I was eager to have an answer when I posted this question, but answer from Avara herself and right the day after? Wow, seems like I have posted at the right place. And yes, your answer does help a lot, as I managed to write the script I asked for yesterday. Thank you very much :P

Sorry to bother you again, but I still have one question though. In the thread "Flags, Vars, and Script Tiles", karatekid552 written


I really don't know anything about hexadecimal stuff, so what are the values between these two.. number(?)
No bother at all, glad you managed to get your script done!

Hex is often used in scripting - XSE has a decimal to hex converter built in if you ever need to work out what the hex equivalent of any number is =) It uses 0–9 to represent values zero to nine, and A, B, C, D, E, F to represent values ten to fifteen.

So, values between 4011-40FF would include:

Code:
0x4011
0x4012
0x4013
0x4014
0x4015
0x4016
0x4017
0x4018
0x4019
0x401A
0x401B
0x401C
0x401D
0x401E
0x401F
0x4020
...
and so on.
__________________
Reply With Quote
Reply

Quick Reply

Join the conversation!

Create an account to post a reply in this thread, participate in other discussions, and more!

Create a PokéCommunity Account
Ad Content

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -8. The time now is 9:17 AM.