• 🏆 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] Help trigger not working

Status
Not open for further replies.
Level 6
Joined
Sep 26, 2007
Messages
114
Hi
i need some help with this trigger its ment to remove unused player buildings/units

  • Noplayer
    • Events
      • Time - Elapsed game time is 5.00 seconds
    • Conditions
    • Actions
      • Player Group - Pick every player in (All players) and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Picked player) slot status) Equal to Is unused
            • Then - Actions
              • Unit Group - Pick every unit in (Units owned by (Picked player)) and do (Unit - Remove (Picked unit) from the game)
            • Else - Actions
              • Do nothing
      • Trigger - Turn off (This trigger)
 
Level 9
Joined
Oct 17, 2007
Messages
547
Try using integer loop, "For every integer A from 1 to 12 do actions"
The conditions should be "(Player((Integer A))) slot status Not equal to Is playing"

Keep in mind that you leak a unit group everytime that loop runs, so set the group to a variable and destroy it at the end of the loop.
 
Level 5
Joined
Apr 12, 2007
Messages
158
It is under Player Slot Status Comparison which uses Conversion - Convert Player Index to Player.
 
Level 6
Joined
Sep 26, 2007
Messages
114
ok whats wrong with this as its still not working
  • No player
    • Events
      • Time - Elapsed game time is 2.00 seconds
    • Conditions
    • Actions
      • For each (Integer A) from 1 to 12, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Player((Integer A))) slot status) Not equal to Is playing
            • Then - Actions
              • Set Unit_group[0] = (Units in (Playable map area) owned by (Picked player))
              • Unit Group - Pick every unit in Unit_group[0] and do (Unit - Remove (Picked unit) from the game)
              • Custom script: call DestroyGroup(udg_Unit_group[0])
            • Else - Actions
              • Do nothing
      • Trigger - Turn off (This trigger)
 
Level 6
Joined
Sep 26, 2007
Messages
114
hey thank got it to work :)

  • No player
    • Events
      • Time - Elapsed game time is 5.00 seconds
    • Conditions
    • Actions
      • For each (Integer A) from 1 to 12, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Player((Integer A))) slot status) Not equal to Is playing
            • Then - Actions
              • Set Unit_group[0] = (Units in (Playable map area) owned by (Player((Integer A))))
              • Unit Group - Pick every unit in Unit_group[0] and do (Unit - Remove (Picked unit) from the game)
              • Custom script: call DestroyGroup(udg_Unit_group[0])
            • Else - Actions
      • Trigger - Turn off (This trigger)
 
Status
Not open for further replies.
Top