• 🏆 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!

Need help with a condition

Status
Not open for further replies.
Level 12
Joined
Oct 28, 2019
Messages
457
Its simple to say, but dont know how to do.

When a player unit enter in a region, if dont have any enemies units in this area the action is on.

need a condition like this

"""number of living units in a region owned by player x less then or equal to 1"""
 
Level 25
Joined
Sep 26, 2009
Messages
2,373
Something like this?

  • Custom script: set bj_wantDestroyGroup = true
  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
      • (Number of units in (Units in (Playable map area) matching ((((Matching unit) is alive) Equal to True) and ((Owner of (Matching unit)) Equal to Player 1 (Red))))) Less than or equal to 1
    • Then - Actions
      • -------- do stuff --------
    • Else - Actions
If so, that's Integer comparison -> Unit - Count units in unit group.
As for the unit group itself, that's 'Units in region matching condition'.

The custom script
  • Custom script: set bj_wantDestroyGroup = true
is there to prevent memory leak from creating a unit group
 
Status
Not open for further replies.
Top