Hey guys, i'm making custom ui and have a problem with health bar, when unit has attributes which increasing unit's health. So my health bar showing unit's current health, for example 675 with attribute bonus as current and 225 as max. The problem is my current health is more than max health (675/225) in such case. I tried to find something that wil define unit's max health, and take in count attributes but found nothing. Help someone?
Yes, that was my mistake it was default. Now im trying put to work another stuff. I need update my status bar where weapon damage is shown. So i have status bar with following information: health, energy, damage reduction, weapon damage. I have first update-trigger when any unit selected, and second when health energy or damage reduction changed, but i didnt find anything to detect when my weapon damage changed.....
You should run a periodic event instead of all those events firing it off, because technically your health will change 32 times a second, because that is the game loop for Sc2. (If healing etc).
Instead run a trigger 10 times a second to update that information, whilst it might seem excessive, in the long run its less game loops. That way you don't need to detect when the damage changes, you just set it to the damage 10 times a second. The timing of the periodic event is up to you, I found that 10 is a good time, you could push it down to 8, (which is once every 4 game loops), but i wouldn't do it slower than that cause you are gonna run into chocky updating.
Rollback Post to RevisionRollBack
To post a comment, please login or register a new account.
Hey guys, i'm making custom ui and have a problem with health bar, when unit has attributes which increasing unit's health. So my health bar showing unit's current health, for example 675 with attribute bonus as current and 225 as max. The problem is my current health is more than max health (675/225) in such case. I tried to find something that wil define unit's max health, and take in count attributes but found nothing. Help someone?
Unit Property - Life Maximum. (Maximum Life - Current) : Make sure its not default.
Yes, that was my mistake it was default. Now im trying put to work another stuff. I need update my status bar where weapon damage is shown. So i have status bar with following information: health, energy, damage reduction, weapon damage. I have first update-trigger when any unit selected, and second when health energy or damage reduction changed, but i didnt find anything to detect when my weapon damage changed.....
You should run a periodic event instead of all those events firing it off, because technically your health will change 32 times a second, because that is the game loop for Sc2. (If healing etc).
Instead run a trigger 10 times a second to update that information, whilst it might seem excessive, in the long run its less game loops. That way you don't need to detect when the damage changes, you just set it to the damage 10 times a second. The timing of the periodic event is up to you, I found that 10 is a good time, you could push it down to 8, (which is once every 4 game loops), but i wouldn't do it slower than that cause you are gonna run into chocky updating.