I try to do the melee trigger in which you lose if you have no buildings left but i can't find an eventto do "If player X has 0 buildings, ..."
It's such a simple trigger but i can't manage to do it.
First create a unit group variable for all players then do this...
Unit builds a structure/building.. add it to UnitGroupX...
Unit building dies.. remove unit from UnitGroupX... then count units in UnitGroupX.. if equals to 0 then make player lose...
Events: Map initialization
Conditions: None
Actions: Set Default Melee Options For All Players
This action enable the victory conditions as seen in melee maps, which are basically "if you lose all your buildings you're defeated" and "if you lose your CC/Nexus/Hatchery you are revealed to your enemies". The action is already in every melee map you create in the editor by default, among a few other actions (create default units, start the melee AI, give starting resources).
Another alternative would be to do this:
Events: Map init
Conditions: None
Actions:
Repeat Forever [
If - Number of Living Units in Any Units in Entire Map Owned by Player X matching (REQUIRED) Structure (EXCLUDED) Dead,Hidden with at most any amount = 0
Then - End game in Defeat for Player X
Else - Wait Y seconds
]
Hi,
I try to do the melee trigger in which you lose if you have no buildings left but i can't find an eventto do "If player X has 0 buildings, ..." It's such a simple trigger but i can't manage to do it.
Thank you.
First create a unit group variable for all players then do this...
Unit builds a structure/building.. add it to UnitGroupX...
Unit building dies.. remove unit from UnitGroupX... then count units in UnitGroupX.. if equals to 0 then make player lose...
You can also do the following:
Events: Map initialization
Conditions: None
Actions: Set Default Melee Options For All Players
This action enable the victory conditions as seen in melee maps, which are basically "if you lose all your buildings you're defeated" and "if you lose your CC/Nexus/Hatchery you are revealed to your enemies". The action is already in every melee map you create in the editor by default, among a few other actions (create default units, start the melee AI, give starting resources).
Another alternative would be to do this:
Events: Map init
Conditions: None
Actions:
Repeat Forever [
If - Number of Living Units in Any Units in Entire Map Owned by Player X matching (REQUIRED) Structure (EXCLUDED) Dead,Hidden with at most any amount = 0
Then - End game in Defeat for Player X
Else - Wait Y seconds
]