So, I have a pair of boss bars displayed on screen, one displaying a unit's health and the other displaying its energy. I can set it up just fine and everything, but I can't seem to find a way to set the boss bar's current value to whatever the unit's current health or energy is. Is there some option or function I'm just not seeing or something?
UI - Set boss bar <energy bar id> current value to (Integer(((Triggering unit) Energy (Percent) (Current)))) (Do refresh the boss bar)
UI - Set boss bar <energy bar id> maximum value to 100 (Do refresh the boss bar)
you only need to set the maximum once so youd probably put that in an init thing.
UI - Set boss bar <energy bar id> current value to (Integer(((Triggering unit) Energy (Percent) (Current)))) (Do refresh the boss bar)
UI - Set boss bar <energy bar id>maximum value to 100 (Do refresh the boss bar)
you only need to set the maximum once so youd probably put that in an init thing.
Ohhh, I hadn't realized that unit properties were Reals and not Integers. Thanks a bunch! :D
Rollback Post to RevisionRollBack
To post a comment, please login or register a new account.
So, I have a pair of boss bars displayed on screen, one displaying a unit's health and the other displaying its energy. I can set it up just fine and everything, but I can't seem to find a way to set the boss bar's current value to whatever the unit's current health or energy is. Is there some option or function I'm just not seeing or something?
@BanelingAspect: Go
There's a "Set Boss Bar Unit" action or something like that which will automatically update the boss bar whenever the unit's health changes.
Ah, I see. Thanks! :)
Though, is there some way to tie a bar to Energy? This action you pointed out only seems to work for health.
Unit - Any Unit Energy (Percent) changes
<put condition to see if its the "boss" unit>
UI - Set boss bar <energy bar id> current value to (Integer(((Triggering unit) Energy (Percent) (Current)))) (Do refresh the boss bar)
UI - Set boss bar <energy bar id> maximum value to 100 (Do refresh the boss bar)
you only need to set the maximum once so youd probably put that in an init thing.
Ohhh, I hadn't realized that unit properties were Reals and not Integers. Thanks a bunch! :D