• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

[Trigger] Need help making a health box for a boss

Status
Not open for further replies.
Level 4
Joined
Sep 22, 2011
Messages
70
For my map, I have multiple bosses, with a very large amount of health, so much that the normal wc3 health number box when u target him glitches and just shows blank.

So what I want, is somekind of box or window or something, that shows up to players that are attacking the boss, that displays his health, preferably in this format: Current/Max (%) however any format will do fine. But I don't know how to do this, please help.

Must be GUI please. Thanks.
 
Level 20
Joined
Jul 14, 2011
Messages
3,213
The best idea that comes to my mind is:

1) Create a floating text over the boss that reads 'Concatenated Strings:
String 1: Concatenated Strings again
String 1-1: |cffff0000 <- Red code
String 1-2: Arithmetic (Current BOSS Life x (Arithmetic: 100 / Boss MAX Life)
String 2: %|r
2) Set FloatingTextVariable = Last created floating text

3) Every 0.03 of gametime
- Change the text of FloatingTextVariable to Arithmetic (Current BOSS Life x (Arithmetic: 100 / Boss MAX Life)

You could add the Unit Life to a Integer variable an use that integer instead... =)

Remember to destroy the Floating Text when the boss dies.
 
Level 4
Joined
Sep 22, 2011
Messages
70
awsome, thanks alot. I was heading in this same general direction with floating text myself, but i was basically just having it update the % of his health every 1.00sec, witht he floating text having a 0.90sec lifespan, this will work better, thanks.
 
Level 4
Joined
Sep 22, 2011
Messages
70
question, How do I destroy the variable FloatingTextVariable when I'm done with it? IE when the boss dies, I obv wont need it anymore.
 
Level 4
Joined
Sep 22, 2011
Messages
70
quick question, how do I make the text move with the boss? he's not stationary, and from time to time teleports to a random spot within his fighting room, but the text just stays above where he starts at, is there any way to move it without having to re-create it entierly?
 
Level 2
Joined
Jan 19, 2011
Messages
19
In the same trigger that updates the health, move the text to the boss. I think there ís a GUI command for moving texts.
 
Status
Not open for further replies.
Top