- 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)
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: