• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

[Trigger] help making an ability?

Status
Not open for further replies.
Level 2
Joined
Sep 20, 2008
Messages
8
I wanted an aura, any unit under its effect would explode when it dies.

Any aura should work, can set which units it effects under options. No problem there.

I figure this has to be done with triggers and something like:

event
Unit gains buff (whatever)
action
add aoe explosion on death to triggering unit

There doesn't seem to be any way to have "gains buff" as an event though so I thought:

event
unit is attacked
condition
has buff (whatever)
event
add aoe explosion on death to triggering unit

and another trigger to remove the ability if they don't have the buff from the aura.

This actually seemed to work. Was wondering if it can be done differently or better?

Also the most important thing for me with this doesn't work. I wanted there to be a nice explosion when they died. I put a nice explosion effect on aoe explosion and it didn't show anything. That skill doesn't allow effects or something. I can't think of a way to trigger the effect in either.

something like:
unit dies
has buff
do this

doesn't seem to work since they must lose the buffs when they die thus they never have a buff after being killed.
 
Level 22
Joined
Dec 31, 2006
Messages
2,216
You can use a periodic timer which checks all units on the map and add the units that got the buff to a group and remove units from the group that no longer got the buff. And on another trigger you have the event "unit dies" and a condition that checks if the dying unit is in the group and if it is you create some neat effects at the location of the unit and remove the unit from the group.
 
Level 28
Joined
Mar 25, 2008
Messages
2,955
I really don't know if dead units are removed from a unit group or not.
If so, it wouldn't work..

Next is that dying units don't have buffs.
You could give them a custom value when they gain the buff (and either way round, set the cv to 0 if they lose it) and check for the cv if a unit dies
 
Level 5
Joined
Jan 6, 2006
Messages
106
@Squiggy: i don't think units are removed from unit groups if they die

Exactly. Units are NOT removed from unit groups when they die, or else how can we still use the "Pick" function on them even when they are dead? Units are only removed from unit groups when they are REMOVED.

BTW, a periodic trigger checking if the unit is dead or not works wonders. That's what I usually use.
 
Status
Not open for further replies.
Top