Hey,
I have a struct with some stuff that I am using for a custom stat system. I am not sure why, whether I am getting the syntax wrong, or some other logical error, but I can't save/read values correctly.
I have the following code in my map header:
And then I have a function that does these actions when I type "-test"
My output is:
Dodge Chance for P1 = 20
Dodge Chance for P2 = 20
So its overriding the value or I am reading it incorrectly or something. Any ideas?
Thanks
-enyeas
I have a struct with some stuff that I am using for a custom stat system. I am not sure why, whether I am getting the syntax wrong, or some other logical error, but I can't save/read values correctly.
I have the following code in my map header:
JASS:
struct heroData
integer MeleeDamageModifier = 0
integer SpellDamageModifier = 0
integer DodgeChance = 0
endstruct
globals
heroData array hData
endglobals
And then I have a function that does these actions when I type "-test"
JASS:
private function Actions takes nothing returns nothing
set hData[0].DodgeChance = 10
set hData[1].DodgeChance = 20
call MessageAll("Dodge Chance for P1 = "+I2S(hData[0].DodgeChance))
call MessageAll("Dodge Chance for P2 = "+I2S(hData[1].DodgeChance))
endfunction
My output is:
Dodge Chance for P1 = 20
Dodge Chance for P2 = 20
So its overriding the value or I am reading it incorrectly or something. Any ideas?
Thanks
-enyeas