• 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.
  • Our friends from the Johto Times are hosting a favorite Pokémon poll - and we'd love for you to participate! Click here for information on how to vote for your favorites!
  • Serena, Kris, Dawn, Red - which Pokémon protagonist is your favorite? Let us know by voting in our grand final favorite protagonist poll!
  • 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.

Setting variables to the value of other variables?

  • 17
    Posts
    3
    Years
    • Seen Dec 14, 2022
    So I'm trying to build a command that saves the value of the variable VAR_0x8004 to another variable, so that if the player leaves and changes the 0x8004 value (since it is used elsewhere), the follow-up commands will still run properly. I tried this:
    Spoiler:

    but it doesn't seem to be working, as I have a follow-up script that only does stuff if VAR_FOSSIL_CHOICE is set to a specific set of values, and that script doesn't do anything right now. Is there a way to set the value of VAR_FOSSIL_CHOICE equal to the value of VAR_0x8004 at this specific moment?
     
    So I'm trying to build a command that saves the value of the variable VAR_0x8004 to another variable, so that if the player leaves and changes the 0x8004 value (since it is used elsewhere), the follow-up commands will still run properly. I tried this:

    but it doesn't seem to be working, as I have a follow-up script that only does stuff if VAR_FOSSIL_CHOICE is set to a specific set of values, and that script doesn't do anything right now. Is there a way to set the value of VAR_FOSSIL_CHOICE equal to the value of VAR_0x8004 at this specific moment?

    You'll want to use copyvar instead. That takes the value being held by the source variable and gives it to the destination variable, whereas setvar just takes the number given, which VAR_0x8004 is technically just 32772, which acts as a pointer to the actual data held by the variable.
     
    Back
    Top