Damage

JM08

New Member
Reaction score
2
whenever one of my units attacks a unit owned by nh, it will only display 0, instead of the actual damage the hostile unit is taking.

Trigger:
  • Damage Done
    • Events
      • Unit - A unit owned by Neutral Hostile Is attacked
    • Conditions
    • Actions
      • Floating Text - Create floating text that reads (String((Integer((Damage taken))))) at (Position of (Triggering unit)) with Z offset 0.00, using font size 8.00, color (0.00%, 100.00%, 0.00%), and 0.00% transparency
      • Floating Text - Change (Last created floating text): Disable permanence
      • Floating Text - Set the velocity of (Last created floating text) to 150.00 towards 90.00 degrees
      • Floating Text - Change the lifespan of (Last created floating text) to 4.00 seconds
      • Floating Text - Change the fading age of (Last created floating text) to 1.33 seconds
 

Larcenist

REP: Respect, Envy, Prosperity?
Reaction score
211
GetEventDamage(), or (Damage taken), doesn't respond to the event "A unit is attacked". You have to use the specific unit event "Unit takes damage" in order to use it.
 

Larcenist

REP: Respect, Envy, Prosperity?
Reaction score
211
Not really. On map init, run a trigger that enumerates all units owned by neutral hostile on the map into a unit group, then pick all units in that unit group and use the action "Add to Damage Done the event (picked unit) takes damage".

Then have another trigger with the event "A unit enters Playable Map Area". Add the condition "Owner of (triggering unit) equal to Neutral Hostile" and then the action "Add to Damage Done the event (triggering unit) takes damage".

As long as neutral hostile doesn't have a hero that respawns multiple times this wont cause an issue at all.
 
General chit-chat
Help Users

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top