Attack event help :O

Status
Not open for further replies.
So, how would I go about catching all attacks by units?

EVENT_PLAYER_UNIT_ATTACKED only works if the attack has a target

EVENT_PLAYER_UNIT_ISSUED_ORDER and all of the variants work, but the orders are only issued one time. If the order is something like attack ground with a canon tower, you're screwed ; P.

I've run out of ideas on how to accomplish this ; (.


I guess the only thing I can't seem to capture is attacks from an attackground order.

Any help would be appreciated ; D.


edit
IDEA!!

On attackground order, create a tiny invisible unit at the point and have the thing attack that instead. On create, link that unit to the attacker so that future orders can just move the unit. On deindex, recycle the invis unit.
 
Last edited:
Level 10
Joined
Jul 12, 2009
Messages
321
For the instant a projectile is fired, I know of two ways:
- A dummy unit casting Mana Flare covering the whole map and give each unit a default-on Searing Arrows in a disabled spellbook, catching the damage event from the dummy (requires every unit to be damage vulnerable, spell vulnerable, and have mana), or
- Give each unit a Barrage ability with 0 missile speed (instant) which is able to target only a damage-detecting dummy.

These are different from "unit is attacked", though. (They may be valuable on their own...)

For the instant a projectile hits ground from an Artillery attack type:
- Give the unit Disease Cloud (Meat Wagon), and detect when an associated dummy unit-type enters the map. Sadly, this ability does not trigger a summons event, so finding the owner is a matter of guesswork by owner of the dummy, position of the dummy, and position of attackground orders.

I like your attackground replacement idea.
 
Status
Not open for further replies.
Top