Hello.
I'm trying to set it so that the damage dealt by a particular skill is simultaneously added to a variable. In this case, variable 19.
If all went to plan, this would mean that by the end of the battle, variable 19 would be equivalent to all the damage dealt by all uses of that skill.
In the damage formula for the skill being used, I have included:
v[19] =+ z; where z is the actual damage formula
However, rather than constantly adding the value of z on top of v[19]'s existing value, z seems to be replacing the value.
For example, if the skill deals 90 damage one turn, v[19] will be set to 90. If it then deals 100 next turn, it will be set to 100, not 190.
I have tried using v[19] += z; instead, but then the variable doesn't change at all.
Any ideas on what I'm doing wrong?
EDIT: I've discovered the issue and feel silly. I didn't realize that variables need to be set in order to work properly. I assumed that all variables defaulted to 0, so setting a variable to 0 with an event wouldn't make any difference. Well, it did, and now it's working perfectly. Feel free to close this thread.
I'm trying to set it so that the damage dealt by a particular skill is simultaneously added to a variable. In this case, variable 19.
If all went to plan, this would mean that by the end of the battle, variable 19 would be equivalent to all the damage dealt by all uses of that skill.
In the damage formula for the skill being used, I have included:
v[19] =+ z; where z is the actual damage formula
However, rather than constantly adding the value of z on top of v[19]'s existing value, z seems to be replacing the value.
For example, if the skill deals 90 damage one turn, v[19] will be set to 90. If it then deals 100 next turn, it will be set to 100, not 190.
I have tried using v[19] += z; instead, but then the variable doesn't change at all.
Any ideas on what I'm doing wrong?
EDIT: I've discovered the issue and feel silly. I didn't realize that variables need to be set in order to work properly. I assumed that all variables defaulted to 0, so setting a variable to 0 with an event wouldn't make any difference. Well, it did, and now it's working perfectly. Feel free to close this thread.