I learned through these forums that a way to manually more points to an attribute (like WC3 Strength) was to actually add a new behavior that was a permanent buff which then added the appropriate attribute point (so one stack of say "Add Strength" would add 1 point of "Strength" to the unit).
However, using the function that revives units, these buffs are not preserved and thus any additional permanent stat increases outside of the veterancy behavior are not kept.
Naturally I tried to find a work around in my revive trigger by making a variable that represents the stack count of the attribute "Strength" and then after reviving adding the difference between the variable and the current stack count of strength via "Add Strength" behavior. However, this method does not work because the stack count does not include the attribute points added via buffs (so while the unit displays say 25 Strength, the actual stack count might just be 10, with the other 15 added on by some trigger, event, etc.).
So, I tried the next step of instead of counting the strength points to count how many buffs of "Add Strength" were on the unit, save it as a variable and then essentially repeat the previous algorithm. However, no matter how many stacks of the buff "Add Strength" I give to a unit, the stack count of that behavior always returns as a 0.
The only other solution I have entertained is counting the actual unit fields (hitpoints, armor, attack speed) and modifiying them via the stat adding behaviors accordingly based on what a unit's stats are without the buffs (say a unit has 100 health before dying and revives with just 80, meaning 20 pts of health were added via "Add Strength" and if each pt health = 1 pt of Add Strength (= 1 pt of Strength), then I need to add 20 behaviors of Add Strength to the revived unit). The problem with this method is that it lacks generalization...I need to know the exact base stats of each hero for those that are modified by the attributes. This can of course be forced (make every hero have the same values for those stats and create them via attributes, i.e. a hero has a vital base of 0 but starts with 10 strength/10 base health).
Hi everyone,
I learned through these forums that a way to manually more points to an attribute (like WC3 Strength) was to actually add a new behavior that was a permanent buff which then added the appropriate attribute point (so one stack of say "Add Strength" would add 1 point of "Strength" to the unit).
However, using the function that revives units, these buffs are not preserved and thus any additional permanent stat increases outside of the veterancy behavior are not kept.
Naturally I tried to find a work around in my revive trigger by making a variable that represents the stack count of the attribute "Strength" and then after reviving adding the difference between the variable and the current stack count of strength via "Add Strength" behavior. However, this method does not work because the stack count does not include the attribute points added via buffs (so while the unit displays say 25 Strength, the actual stack count might just be 10, with the other 15 added on by some trigger, event, etc.).
So, I tried the next step of instead of counting the strength points to count how many buffs of "Add Strength" were on the unit, save it as a variable and then essentially repeat the previous algorithm. However, no matter how many stacks of the buff "Add Strength" I give to a unit, the stack count of that behavior always returns as a 0.
The only other solution I have entertained is counting the actual unit fields (hitpoints, armor, attack speed) and modifiying them via the stat adding behaviors accordingly based on what a unit's stats are without the buffs (say a unit has 100 health before dying and revives with just 80, meaning 20 pts of health were added via "Add Strength" and if each pt health = 1 pt of Add Strength (= 1 pt of Strength), then I need to add 20 behaviors of Add Strength to the revived unit). The problem with this method is that it lacks generalization...I need to know the exact base stats of each hero for those that are modified by the attributes. This can of course be forced (make every hero have the same values for those stats and create them via attributes, i.e. a hero has a vital base of 0 but starts with 10 strength/10 base health).
I would appreciate any help, thanks!