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

[Trigger] Checking the number of units in a bunker

Status
Not open for further replies.
Level 9
Joined
Jun 22, 2012
Messages
472
Hey there!

I need help at a step of one of my triggers. I need to check the number of units in a bunker (a kind of orc "farm", I don't have the name in English) but I don't know how to do so... It's maybe quite simple but I don't find the solution alone...

Thanks in advance, I hope I'm clear enough!
 
Level 26
Joined
Aug 18, 2009
Messages
4,097
  • Set c = 0
  • Player Group - Pick every player in (All players) and do (Actions)
    • Loop - Actions
      • Custom script: set bj_wantDestroyGroup = true
      • Unit Group - Pick every unit in (Units owned by (Picked player)) and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • 'IF'-Conditions
              • ((Picked unit) is loaded into <transporter>) Gleich True
            • 'THEN'-Actions
              • Set c = (c + 1)
            • 'ELSE'-Actions
  • Game - Display to (All players) the text: (String(c))
 
Status
Not open for further replies.
Top