• 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!
  • Which Pokémon Masters protagonist do you like most? Let us know by casting a vote in our Masters favorite protagonist poll here!
  • Red, Hilda, Paxton, or Kellyn - which Pokémon protagonist is your favorite? Let us know by voting in our 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.

[Script] Sum 2 Variables

  • 9
    Posts
    4
    Years
    • Seen Dec 15, 2021
    Hi

    How can I add up values of 2 variables?

    For example, if I have a value stored in 0x800D and another in 0x8000 how can I load into 0x800D the sum of those 2 numbers?
    Addvar require a variable and a constant value, so I have no idea how to do it

    Thanks

    EDIT: I'm using pokefirered source code, so I solved my problem by creating a new script command that I called "sumvars" wich takes 2 vars and sum the value of the second into the first

    I'm not sure if that solution is sure neither it's the most optimal, but it worked by editing only 3 files (asm/macros/event.inc, data/script_cmd_table.inc and src/scrcmd)
     
    Last edited:
    Back
    Top