• 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.

[Other] Variables to use

  • 12
    Posts
    2
    Years
    • Seen Sep 11, 2021
    So I have been seeing that the only safe variables you can use are 0x4011 through 0x40FF. Since 40FF is 16639 and 4011 is 16401, does that mean there are only 238 variables to use? Sorry if this is well known information I am new
     
  • 222
    Posts
    6
    Years
    • Seen Nov 18, 2023
    So I have been seeing that the only safe variables you can use are 0x4011 through 0x40FF. Since 40FF is 16639 and 4011 is 16401, does that mean there are only 238 variables to use? Sorry if this is well known information I am new

    Yes and no. Many variables are already in use by the game, so there's technically less.

    Here is a list of FireRed variables, it's for a different kind of project and so it looks a little weird but you can still use it as a reference for your hack to see what variables are available.

    On the right you will see the numbers you are used to (for example 0x4020) and on the left you will see what it is used for (for example VAR_REPEL_STEP_COUNT). If a variable number is something like "VAR_0x4B9" that means it is a completely safe variable to use because it is not used by the original game.

    Basically, 0x4000 to 0x400F are temporary variables that you can safely use in scripts and stuff for commands, but it is reset to 0 on every map load and so you shouldn't store anything important in it. Vars 0x4010 to 0x401F are variables that help make certain NPCs in the overworld have differing appearances. You shouldn't use them for storing regular information. Everything else is a "normal" variable although many are used for stuff already. Don't use any of the "special" variables which start at 0x8000 since they are not saved and get edited by commands often. They aren't safe for storing stuff.

    The number of variables may seem a little limiting but remember you still have a lot of flags you can be using as well!
     
    Last edited:
  • 12
    Posts
    2
    Years
    • Seen Sep 11, 2021
    Thanks for helping me out. Do you think if I got rid of the scripts associated with some of the variables (Such as removing Professor Oak's don't go out into Route 1 script) I could use that variable?
     
    Back
    Top