• 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.

removing [non-controlled] units

Status
Not open for further replies.
Level 3
Joined
Sep 15, 2008
Messages
31
how do you remove non-used units in the beginning of the game? (units that aren't controlled)

thx to anyone who gives me the trigger for it
 
Level 12
Joined
Mar 26, 2005
Messages
790
  • Untitled Trigger 001
    • Events
    • Map Initialization
    • Conditions
    • Actions
      • Player Group - Pick every player in (All players controlled by a None player) and do (Actions)
        • Loop - Actions
          • Unit Group - Pick every unit in (Units owned by (Picked player)) and do (Actions)
            • Loop - Actions
              • Unit - Remove (Picked unit) from the game

there may be some leaks, i guess you can solve it out
 
Level 14
Joined
Nov 4, 2006
Messages
1,241
  • Events
    • Map Initalization
  • Conditions
  • Actions
    • For each (Integer A) from 1 to 12, do (Actions)
      • Loop - Actions
        • If (((Player((Integer A))) slot status) equal to unused) then do (Unitgroup - Pick every unit in (Units owned by (Player((Integer A)))) and do (Unit - Remove (Picked unit) from the game)) else do (Do nothing)
lol too slow :/
 
Last edited:
Status
Not open for further replies.
Top