HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Generic Unit Event - Takes Damage

07-03-2004, 06:19 AM#1
raejin
Is there a reason why there's no way for a trigger event to fire when any unit takes damage? There's a "specific unit - takes damage" event, but not under generic... is there a workaround for this, or a custom editor that has that as a trigger add-in?

Thanks,
- R
07-03-2004, 06:42 AM#2
GaDDeN
Try this:

Code:
Event: Every 1 sec
Conditions: -
Actions:Set hpinteger to 0
           Pick every unit in (playable map region) and do actions
                  Actions: set HpChecker[HpInteger] to current hp of picked unit.
                              set CheckedUnit[HpInteger] to (picked unit]
                              set hpinteger to hpinteger+1
           Wait 0.9 sec
                             For each integer A between 0-hpinteger
                             If hp of CheckedUnit[integer a] less than Hpchecker[integer a] then (actions)
--- AT THIS POINT CHECKED UNIT[INTEGER A] HAS TAKEN DAMAGE ---

Im kinda tired so i cant promise you this works. But i know the idea itself works; its basically what your asking for but manually triggered instead of the built-in trigger events in the editor.
07-03-2004, 06:51 AM#3
Ninja73
Hmm, well it would b ez if the unit was dieing, but just taking damage... Well, assuming a unit is attacking it just use generic unit is attacked. However if ur using triggers then u could just add ur actions to the triggers doing the damage.
07-03-2004, 08:00 AM#4
Anitarf
Unfortunately, there is no generic "unit takes damage" trigger. If you need this to work for just a few units on your map (like checking when one of the heroes takes damage), then you can just add a specific unit event to a trigger whenever a hero of that type that needs this trigger enters the map. If you need this to work for all units in the map then you have a problem. There's no accurate way to get this working. another approximation would be possible if you only wanted to check when a unit attacked by a single hero-type takes damage from that hero; in that case, you could use some buffing attack ability (like cold arrows) and use a fast periodic trigger to check when will tha attacked unit (stored in a variable) get the buff.
07-03-2004, 02:15 PM#5
raejin
Oh man I'm retarded, "Advanced - Any Unit Takes Damage" has been staring me in the face since I started using WEU two weeks ago, but I was too busy scrolling through generic unit events to see it down the bottom, hahah.

Thanks for the help!