• Just a reminder that providing specifics on, sharing links to, or naming websites where ROMs can be accessed is against the rules. If your post has any of this information it will be removed.
  • Ever thought it'd be cool to have your art, writing, or challenge runs featured on PokéCommunity? Click here for info - we'd love to spotlight your work!
  • It's time to vote for your favorite Pokémon Battle Revolution protagonist in our new weekly protagonist poll! Click here to cast your vote and let us know which PBR protagonist you like most.
  • 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
    3
    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
     
    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:
    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