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

Pick Every Unit Not picking more than one unit?

Status
Not open for further replies.
Level 8
Joined
Jul 29, 2010
Messages
319
Hi, I'm trying to create a trigger that will set specific boolean variables to true or false depending on whether or not there is a unit present in a specific region at the time, it works fine if there is 1 player because then only 1 unit created, however as soon as there are multiple units in the map, it seems to only pick 1 unit at a time? any and all help is appreciated :D
  • Response
    • Events
      • Dialog - A dialog button is clicked for ReadyUp
    • Conditions
    • Actions
      • Dialog - Hide ReadyUp for (Triggering player)
      • Set PlayerReady[(Player number of (Triggering player))] = True
      • Unit - Create 1 Builder for (Triggering player) at ((Triggering player) start location) facing 0.00 degrees
      • Unit Group - Pick every unit in (Units in (Playable map area)) and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Picked unit) is in (Units in Lane1Spawn <gen>)) Equal to True
            • Then - Actions
              • Set LaneBoolean[1] = True
            • Else - Actions
              • Set LaneBoolean[1] = False
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Picked unit) is in (Units in Lane2Spawn <gen>)) Equal to True
            • Then - Actions
              • Set LaneBoolean[2] = True
            • Else - Actions
              • Set LaneBoolean[2] = False
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Picked unit) is in (Units in Lane3Spawn <gen>)) Equal to True
            • Then - Actions
              • Set LaneBoolean[3] = True
            • Else - Actions
              • Set LaneBoolean[3] = False
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Picked unit) is in (Units in Lane4Spawn <gen>)) Equal to True
            • Then - Actions
              • Set LaneBoolean[4] = True
            • Else - Actions
              • Set LaneBoolean[4] = False
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Picked unit) is in (Units in Lane5Spawn <gen>)) Equal to True
            • Then - Actions
              • Set LaneBoolean[5] = True
            • Else - Actions
              • Set LaneBoolean[5] = False
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Picked unit) is in (Units in Lane6Spawn <gen>)) Equal to True
            • Then - Actions
              • Set LaneBoolean[6] = True
            • Else - Actions
              • Set LaneBoolean[6] = False
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Picked unit) is in (Units in Lane7Spawn <gen>)) Equal to True
            • Then - Actions
              • Set LaneBoolean[7] = True
            • Else - Actions
              • Set LaneBoolean[7] = False
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Picked unit) is in (Units in Lane8Spawn <gen>)) Equal to True
            • Then - Actions
              • Set LaneBoolean[8] = True
            • Else - Actions
              • Set LaneBoolean[8] = False
 
Level 2
Joined
Jun 5, 2018
Messages
9
I think it sets your LaneBooleans back to false if the next picked unit is not in a zone.

Let's say the first unit picked is in Lane1Spawn then LaneBoolean 1 is set to 'true'. But the second picked unit is in Lane3Spawn, it sets the previous Boolean back to False due to your Else statement.

I would have it check the regions itself, whether a unit is in it or not. So: IF region has unit = true THEN set Boolean = true
 
Status
Not open for further replies.
Top