• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

[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.
 
Level 31
Joined
Jul 10, 2007
Messages
6,306
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