• 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.

Show damage over unit.. someone already done it?

Status
Not open for further replies.
Level 4
Joined
Nov 22, 2004
Messages
62
because I DID
i dont wanna u guys think im the one cuz im not.
i NEVER EVER found a map/spell/system/post about this.
"when the unit attacks the damage it causes appears over the enemy unit " AKA final fantasy.

well everyboddy knows the Damage Taken event response can only work with predetermined units.

i did a turn around, thanks to the map Damage meters.

i submited the map here.

im only posting cuz i wanna know if anyone ever thought/done it without JASS. and btw its very simple ( in dont know how i never thought about it...)
and it works with any units anytime anywhere.
(units DONT need to be placed before map initialization).

Variables:

Target
damagetaken

Triggers:

check attacked unit
Events
Time - Every 0.01 seconds of game time
Unit - A unit Is attacked
Conditions
Actions
Set target[(Player number of (Owner of (Attacking unit)))] = (Attacked unit)
Trigger - Run add <gen> (checking conditions)

add
Events
Conditions
Actions
Trigger - Add to attack <gen> the event (Unit - target[(Player number of (Owner of (Attacking unit)))] Takes damage)
Trigger - Add to clear <gen> the event (Unit - target[(Player number of (Owner of (Attacking unit)))] Dies)

check hit
Events
Conditions
Actions
Set damagetaken[(Player number of (Owner of (Attacking unit)))] = (Damage taken)

attack
Events
Conditions
Actions
Floating Text - Create floating text that reads (String((Integer((Damage taken))))) above (Attacked unit) with Z offset 0.00, using font size 10.00, color (100.00%, 100.00%, 100.00%), and 0.00% transparency
Floating Text - Set the velocity of (Last created floating text) to 64.00 towards 90.00 degrees
Floating Text - Change (Last created floating text): Disable permanence
Floating Text - Change the lifespan of (Last created floating text) to 1.00 seconds
Floating Text - Change the fading age of (Last created floating text) to 0.50 seconds

clear
Events
Unit - A unit Dies
Conditions
target Equal to (Dying unit)
Actions
Set damagetaken = 0.00

there it is.

please give credit if use. =D
 
Level 4
Joined
Nov 22, 2004
Messages
62
in case anyonee says, i tried removing the "add" trigger cuz it seems useless, but removing it for me made the system not work.

and the variable "damageaken" seems useless to. but sam story as above, removing it for me caused it not to work. feel free to upgrade this system.
 
Status
Not open for further replies.
Top