Hi all,
I am new to the forum and have been looking for an easy way to show damage being done to a "unit" (in this case a unit variable containing my hero). So keep in mind that this is my first attempt.
While this GUI trigger is not perfect it doesn't leak and seems to work with a small margin for error (the error being that if your hero is regenerating life it is factored into the output)
I have seen some other ways of doing a % life floating text but I wanted just the life loss to be shown.
--variables--
Hero (Unit, set to my hero unit in another trigger)
Life1 (Integer, set to the current life of "Hero" before the wait)
Damage (Integer, set to the difference between "Life1" and current life of "Hero" after the wait)
damgtext (Floating Text, set to the text created in this trigger)
-Eamon
I am new to the forum and have been looking for an easy way to show damage being done to a "unit" (in this case a unit variable containing my hero). So keep in mind that this is my first attempt.
While this GUI trigger is not perfect it doesn't leak and seems to work with a small margin for error (the error being that if your hero is regenerating life it is factored into the output)
I have seen some other ways of doing a % life floating text but I wanted just the life loss to be shown.
--variables--
Hero (Unit, set to my hero unit in another trigger)
Life1 (Integer, set to the current life of "Hero" before the wait)
Damage (Integer, set to the difference between "Life1" and current life of "Hero" after the wait)
damgtext (Floating Text, set to the text created in this trigger)
-
Damage indicator
-
Events
- Unit - A unit Is attacked
-
Conditions
- ((Triggering unit) is A Hero) Equal to True
-
Actions
- Trigger - Turn off (This trigger)
- Floating Text - Destroy damgtext
- Set Life1 = (Integer((Life of Hero)))
- Wait 0.50 seconds
- Set Damage = ((Integer((Life of Hero))) - Life1)
- Floating Text - Create floating text that reads (String(Damage)) above Hero with Z offset 0.00, using font size 10.00, color (100.00%, 0.00%, 0.00%), and 0.00% transparency
- Set damgtext = (Last created floating text)
- Wait 0.50 seconds
- Floating Text - Destroy damgtext
- Trigger - Turn on (This trigger)
-
Events
-Eamon