Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
So I'm trying to make a seemingly simple trigger that defeats a player when they are all out of units, This is what I have now and I cant really figure out why its not working, any help would be appreciated.
You should use a periodic timer as an event. Also make sure you turn off the trigger so it won't overloop.
Another solution, is to remove the dying unit from the unit group and then check when the number of units in that unit group equal to 0
The reason the first trigger did not work is because the condition cannot ever be true under normal game mechanics. When a unit dies it goes into a decay state where it still exists as a unit as far as searches go but is mechanically treated as dead. As such the unit group would always have more than 1 unit.
In any case using a condition like that is not a good idea due to the unit group leak. You will need to run the test inside the trigger actions so one can destroy the group and prevent the leak.
In this context a periodic timer should be the last resort ever. Following what DSG said about dead units, you need to set a group variable: set Player2Group = All units of (Units owned by Player 2 (Blue)) matching condition (Matching unit is alive) Equal to True)
And then check the number of units in the group, if less than 1 = boom defeat
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.