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

[Trigger] Custom non-custom Win/lose

Status
Not open for further replies.
Level 2
Joined
Jul 22, 2015
Messages
15
I want to remove the "Enforce win / lose conditions" trigger so that I can use a custom town hall for my custom race. BUT! I want the normal win / lose conditions still apply. So I want it so that if a player doesn't own any town halls or workers they lose. I can't figure out how to do this... I've heard people talk about unit counts, but I can't figure out how to set them up and make them apply to this sort of thing.
 
Level 21
Joined
Nov 4, 2013
Messages
2,016
Back in the old days when I was a little novice, I used to do this thing of counting the buildings you have. However, now I've discovered that you can use Integer Comparison to check the number of buildings you still have. If they are 0, you clearly lose.
The event will be "A unit Dies", the condition will be the integer comparison thing, the actions will be "Defeat".
 
Level 4
Joined
Jul 25, 2014
Messages
57
Solution

Pick every unit of the specific player in a unit group. If the picket unit is not equal to the town hall or a worker remove it from the group. If the number of picked units after this is equal to 0 make the player defeat. Also the event should be a unit dies. This way it´ll be like in real melee maps.
 
Status
Not open for further replies.
Top