activate a trigger when unit group = 0

MissKerrigan

Active Member
Reaction score
23
Hello,

I did this before but I forgotten! (omg)

I want to activate a trigger when a unit group goes empty
Can someone clear me up? :)


MissKerrigan
 

X-maul

AKA: Demtrod
Reaction score
201
If you got a trigger that adds the units, you can just add a wait function that checks for the condition if the amount of living units in unit group = 0

Othervise you could have a periodic trigger, that will run every 1 second, and then set the condition to amount of living units in unit group = 0.
Then remember to turn off the trigger when it activates, and reactivate it in the end.
 

X-maul

AKA: Demtrod
Reaction score
201
Did you read my reply? There is no such event.
You will have to settle with a trigger that got a wait for condition action, or a periodic trigger that checks if the unit group is empty.

Personally I'd use the wait, as it's most likely something that checks when all units of a group of units you spawned, are dead. If thats the case, just add the wait right after you spawned them, and then you put your actions after the wait (or run another trigger after it)
 

MissKerrigan

Active Member
Reaction score
23
alright I get it now! I searched over and over in the events, but it seems it wasnt there haha!
 

Dave312

Censored for your safe viewing
Reaction score
269
I personally would use the Unit Dies event and add another condition which checks if the unit belongs to the unit group.
 

X-maul

AKA: Demtrod
Reaction score
201
Then nothing will happen, but if it's an action that would happen after some units are spawned, I'd use a wait with a condition, as that will be the simplest and most efficient.

But if you are not removing any units, but instead killing them, you can use Dave312's method for the same result.
 

MissKerrigan

Active Member
Reaction score
23
Alright, if the last unit of the unit group is removed, you must be game over, is this so hard?

I JUST want make a trigger:


1. UNIT GROUP LIVES is '0'

2. END GAME for player


is this impossible?
 

X-maul

AKA: Demtrod
Reaction score
201
Make a periodic trigger that runs every 1 sec, with a condition that checks if the unit group is empty, then end game for player if it is.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      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