In a map I'm working on, I want the player to have to kill four Zerg Hives...in order to win. But I can not figure out how to do this. As of now, the destruction of ANY of the four Hives will result in a victory for the player...but I want it to only give the player a victory if all four Hives have been destroyed.
The easiest way I've found to do this is as follows.
Firstly you need to make a variable in the trigger editor. Just right click on the left-hand side, scroll down to the "New ->" option and create a new variable.
It should automatically be an integer and you need to set the basic value to 4 by dodubleclicking the "Intial Value" option in the right-hand box. After that create a new trigger and make the event "Unit Dies". Double click the event and click the value button. Scroll down the list of possible units and select your first hive. Then hit ok and go to actions. Make a new action "Modify Variable" have it subtract one from the variable. Copy paste the whole trigger and make 3 extra copies each one for a different hive. After that make a new trigger with a "Periodic Event" and set it to every 1 second of game time This event could be anything that triggers when you want the player to achieve victory, any unit dies, for instance. (I say that because if you have it be every one second it wont let you play past victory...you'll see what i mean if you test this.) Then go to actions and create a new "If Then Else" action. Into the If box make a condition "Within Bounds" Change the value to the variable you made and for the bounds "0 <= "Variable _<= 0"
Then create a new "End Game" action in the "Then" box and it should be automatically set to Victory for player 1.
If you still need help send me a PM and ill try and help you out.