unit count in region

andrei009

Member
Reaction score
1
how can I check if an unit type is not in the region?

let's say that my hero arrive in a place where he must kill n enemy's to open a gate , how can i do that?
 

kaboo

New Member
Reaction score
45
Code:
if number of living units owned by player X in kill zone{region} equal to 0
 then open gate
 

jomik

New Member
Reaction score
17
Just have to check type too..
Trigger:
  • Check
    • Events
    • Conditions
    • Actions
      • Set tempGroup = (Units in (YourRegion) matching ((((Matching unit) is alive) Equal to True) and (((Unit-type of (Matching unit)) Equal to UnitToBeKilled) and ((Owner of (Matching unit)) Equal to YourEnemy))))
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Number of units in tempGroup) Equal to 0
        • Then - Actions
          • -------- All Dead --------
        • Else - Actions
      • Custom script: call DestroyGroup(udg_tempGroup)


Since you asked it so it'd only trigger when a certain unit-type isn't present in the region. This is what you need, no leaks
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top