• 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!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

conditions help

Status
Not open for further replies.
Level 2
Joined
Jun 28, 2010
Messages
6
i need help making a condition for an existing trigger

conditions: make it so that multiple (specific) units need to die in order to cause a destructible to automatically die
(when all 4 units die, this destructible is destroyed. This destructibles death causes the game to end)
 
Last edited:
Level 13
Joined
Mar 24, 2010
Messages
950
yeah that or just assign those 4 units to a unit var and everytime one of those 4 dies do a check to see if they are all dead if so then kill destructible this way theres no possible leaking from a unit group.
 
I think i have a better way; Every death check the number of unit in the group 'living units owned by player', units is your unit and player is the player they belong to.

If the count is zero kill the destructable to end the game.

  • Unit Death
    • Events
      • Unit - A unit Dies
    • Conditions
      • (Number of living (Unit-type of YourUnit) units owned by OwningPlayer) Equal to 0
    • Actions
      • Destructible - Kill Destructable
 
Level 37
Joined
Mar 6, 2006
Messages
9,243
Bond009 is absolutely correct. Zeatherann's solution will cause a unit group leak.

Here are Bond009's words in a triggerized form:

  • Untitled Trigger 007
    • Events
      • Unit - A unit Dies
    • Conditions
      • (Peasant 0001 <gen> is dead) Equal to True
      • (Peasant 0008 <gen> is dead) Equal to True
      • (Peasant 0010 <gen> is dead) Equal to True
      • (Peasant 0009 <gen> is dead) Equal to True
    • Actions
      • Trigger - Turn off (This trigger)
      • Game - Display to (All players) the text: True
 
Level 13
Joined
May 11, 2008
Messages
1,198
what i've always done is change the lumber/gold/food count for a player that doesn't use that resource. so when the total resource count of that player for that resource type is that number that gets changed every time the one of the units dies reaches that total that means all of them have died then you can end the game. i used this and still use it in my tag map, TDHT.
 
Status
Not open for further replies.
Top