I use several units which get % increases and decreases to life and shields from a permanent behaviour. Everything works fine except that they are sometimes randomly healed to full life. I think this bug has been in the game for a while now and I wonder if there are any workarounds?
I have thought about using upgrades, but their values only modify the current stats right? Plus upgrades count for all units of a player and I'd have to seriously adjust code, duplicate and replace units for that to work out.
Behaviors that change vitals tend to fully recharge a unit's vitals when applied, or if an upgrade was applied to a behavior that changed max vitals. I don't really remember what caused it, haven't used the editor in months...
My workaround was to apply the behavior/upgrade via triggers, but before I applied it, I stored all 3 of the affected unit's current vital percents in variables, then after it was applied, I set the unit's vitals back to the stored values. This method might not be as effective depending on your map, like if it has a lot of units and/or the behavior is applied en masse.
If you use an upgrade, it's going to be harder to store the vital %s for all affected units, but if it's a behavior, it's gonna be much easier.
Behaviors don't store vital %. If you apply a 200 life behavior to a 300 life unit that's currently on 1 life, then it'll have 201 life.
If you modify the vitals of a behavior via upgrades or catalog values, then the behavior will "reset" for affected units. It must be a bug, but I don't think it's going away any time soon.
I'd recommend using triggers for hero stat systems, or upgrades for mass stat changes. Behaviors are just too clunky to make a good leveling system out of. At least currently.
I am using vital maximum fraction and I am not changing that value. The behaviour in question is also permanent and is never removed or reapplied. The bug still does happen.
I will try your suggested band aid fix by storing %life+shields before I apply any other upgrades to the unit. At least this way I can fix it for my heroes maybe.
I have added triggers to store and restore life percentages just before and after life changing upgrades are applied, but the bug is still present. It also seems to affect different players and always at the same time. This is highly annoying!
Rollback Post to RevisionRollBack
To post a comment, please login or register a new account.
I use several units which get % increases and decreases to life and shields from a permanent behaviour. Everything works fine except that they are sometimes randomly healed to full life. I think this bug has been in the game for a while now and I wonder if there are any workarounds?
I have thought about using upgrades, but their values only modify the current stats right? Plus upgrades count for all units of a player and I'd have to seriously adjust code, duplicate and replace units for that to work out.
Behaviors that change vitals tend to fully recharge a unit's vitals when applied, or if an upgrade was applied to a behavior that changed max vitals. I don't really remember what caused it, haven't used the editor in months...
My workaround was to apply the behavior/upgrade via triggers, but before I applied it, I stored all 3 of the affected unit's current vital percents in variables, then after it was applied, I set the unit's vitals back to the stored values. This method might not be as effective depending on your map, like if it has a lot of units and/or the behavior is applied en masse.
If you use an upgrade, it's going to be harder to store the vital %s for all affected units, but if it's a behavior, it's gonna be much easier.
Behaviors don't store vital %. If you apply a 200 life behavior to a 300 life unit that's currently on 1 life, then it'll have 201 life.
If you modify the vitals of a behavior via upgrades or catalog values, then the behavior will "reset" for affected units. It must be a bug, but I don't think it's going away any time soon.
I'd recommend using triggers for hero stat systems, or upgrades for mass stat changes. Behaviors are just too clunky to make a good leveling system out of. At least currently.
I am using vital maximum fraction and I am not changing that value. The behaviour in question is also permanent and is never removed or reapplied. The bug still does happen.
I will try your suggested band aid fix by storing %life+shields before I apply any other upgrades to the unit. At least this way I can fix it for my heroes maybe.
I have added triggers to store and restore life percentages just before and after life changing upgrades are applied, but the bug is still present. It also seems to affect different players and always at the same time. This is highly annoying!