trigger help need to count unit of player 9 on map

Shlomi1515

New Member
Reaction score
2
i need to add condision that if player 9 have 0 units the trigger will turn on

i tired to do this but it doesnt work

Code:
        (Any units in (Entire map) owned by player 9 matching Excluded: Missile, Dead, Hidden, with at most Any Amount) == (Empty unit group)


plz help
 

Shlomi1515

New Member
Reaction score
2
i cant find that condison in my editor can u put some pic and show me where u took the "number of units.....
 

Im_On_56k

Hm...
Reaction score
116
First add a new condition.

Select the type of condition to comparison. By default (for me atleast) the condition is set to (Owner of (Triggering unit)) == 1

Change the owner of part and find Number of Units In Unit Group.

Open up the Unit Group part (should be colored red) and go to function.

Find Units In Region Matching Condition. Change the player to 9 and any other settings you are looking for.

Now there is also another easier way to do this via custom script possibly for use in another trigger or an if statement. (it all depends on how you are going to use this in your map)

Define a local variable called g which is a unit group.

Now add a custom script action and set it to:
JASS:
lv_g = UnitGroup(null,9,null,null,0);
//Change the 0 to a 1 in UnitGroupCount to only count alive units
if (UnitGroupCount(lv_g,0) == 0) {
    //no units !
}
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top