• 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.

[Solved] Multiple Victory Trigger

Status
Not open for further replies.
Level 2
Joined
Aug 30, 2011
Messages
14
I need help making a trigger that when multiple buildings die the team killing the buildings win and the team that lost the buildings lose. Any help would be great thanks.
 
So this is for a trigger right?

Are all of these buildings the same type? If same, count units of type owned by each player on team.

count player1 + count player2 + count player3

if the count is 0, they lose.

If it's of multiple types, an easy way is to enumerate over units of type UNIT_TYPE_BUILDING. If the count between all players on that team is 0, that team loses.



There are better ways to do this. If all of the buildings are of the same type and you have a set number at the start (don't build any new), then you can just register an any unit dies event and subtract # of buildings on team every time a unit dies.

If you can build them, you can increase count of buildings on team every time a new building is finished.
 
Level 2
Joined
Aug 30, 2011
Messages
14
Yes it is for a Victory Trigger. For example, you have a townhall and a farm, how would i make it so you must destroy both buildings to achieve victory?
 
Status
Not open for further replies.
Top