• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.
  • Create a faction for Warcraft 3 and enter Hive's 19th Techtree Contest: Co-Op Commanders! Click here to enter!
  • Create a void inspired texture for Warcraft 3 and enter Hive's 34th Texturing Contest: Void! Click here to enter!
  • The Hive's 21st Texturing Contest: Upgrade is now concluded, time to vote for your favourite set of icons! Click here to vote!

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