• Our software update is now concluded. You will need to reset your password to log in. In order to do this, you will have to click "Log in" in the top right corner and then "Forgot your password?".
  • Welcome to PokéCommunity! Register now and join one of the best fan communities on the 'net to talk Pokémon and more! We are not affiliated with The Pokémon Company or Nintendo.

[Script] How to write a "walk over script"?

DTD

13
Posts
7
Years
    • Seen Apr 15, 2018
    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?
     
    Last edited:
    1,309
    Posts
    12
    Years
    • She/Her
    • Seen Nov 24, 2023
    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:

    How to write a "walk over script"?


    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
     

    DTD

    13
    Posts
    7
    Years
    • Seen Apr 15, 2018
    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
    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(?)
     
    1,309
    Posts
    12
    Years
    • She/Her
    • Seen Nov 24, 2023
    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.
     
    Back
    Top