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

Detecting slot useage and unit removal

Status
Not open for further replies.
Level 4
Joined
Feb 7, 2007
Messages
61
how do i make it to where if the player slot is unused, then remove everything that the player owns.

i dont know how but this is what i got,
  • Untitled Trigger 002
    • Events
      • Map initialization
    • Conditions
      • (Player 1 (Red) slot status) Equal to Is unused
      • (Player 2 (Blue) slot status) Equal to Is unused
      • (Player 3 (Teal) slot status) Equal to Is unused
      • (Player 4 (Purple) slot status) Equal to Is unused
      • (Player 5 (Yellow) slot status) Equal to Is unused
      • (Player 6 (Orange) slot status) Equal to Is unused
      • (Player 7 (Green) slot status) Equal to Is unused
      • (Player 8 (Pink) slot status) Equal to Is unused
      • (Player 9 (Gray) slot status) Equal to Is unused
      • (Player 10 (Light Blue) slot status) Equal to Is unused
      • (Player 11 (Dark Green) slot status) Equal to Is unused
      • (Player 12 (Brown) slot status) Equal to Is unused
    • Actions
 
Level 4
Joined
Feb 7, 2007
Messages
61
thank you, but what do i put for the action part to remove all the units that the unused player owns?

I dont know if this is right, but can it be done like this?

  • Untitled Trigger 002
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Player Group - Pick every player in (All players matching (((Matching player) slot status) Equal to Is unused)) and do (Unit Group - Remove all units of (Units owned by (Matching player)) from (Units in (Entire map) owned by (Matching player)))
 
Last edited by a moderator:
  • Events
    • Map initialization
  • Conditions
  • Actions
    • Player Group - Pick every player in (All players matching (((Matching player) slot status) Equal to Is unused)) and do (Actions)
      • Loop - Actions
        • Unit Group - Pick every unit in (Units owned by (Matching player)) and do (Actions)
          • Loop - Actions
            • Unit - Remove (Picked unit) from the game
This shoud be leakless.
 
Level 4
Joined
Feb 7, 2007
Messages
61
i did that and the players that are unused are still there. Its empty slots, but units i still see the empty slot's units there at the start point. What am i doing wrong?
 
Level 19
Joined
Aug 24, 2007
Messages
2,888
what was its name
something like
Custom script: set bj_wantsDestroyGroup = true
for removing leaks
anyway I rather locals etc
 
Level 4
Joined
Feb 7, 2007
Messages
61
I still dont understand why it does this..



i did that and the players that are unused are still there. Its empty slots, but units i still see the empty slot's units there at the start point. What am i doing wrong?
 
Level 2
Joined
Apr 1, 2006
Messages
10
You should try using a periodic timer, see if that helps, because if it checks at the very beginning of the map, and units are created after that for that player, it could cause problems, this is what you should have:
Code:
Player unused
    Events
        Time - Every 1.00 seconds of game time
    Conditions
    Actions
        Player Group - Pick every player in (All players matching (((Matching player) slot status) Equal to Is unused)) and do (Actions)
            Loop - Actions
                Unit Group - Pick every unit in (Units in (Entire map) owned by (Picked player)) and do (Actions)
                    Loop - Actions
                        Unit - Remove (Picked unit) from the game
 
  • Playing
    • Events
      • Time - Elapsed game time is 1.00 seconds
    • Conditions
    • Actions
      • For each (Integer A) from 1 to 10, do (Actions)
        • Loop - Actions
          • Custom script: set bj_wantDestroyGroup = true
          • Unit Group - Pick every unit in (Units in Playable map area matching ((Owner of (Matching unit)) Equal to (Player((Integer A))))) and 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
                  • Unit - Remove (Picked unit) from the game
                • Else - Actions

I used that in one of my maps and it works nicely.
 
Level 4
Joined
Feb 7, 2007
Messages
61
i think so too, but would it work in the same way, say, an empty slot, and you just start the game, but the empty slot units and stuff are still there in the game.

~~Edit

wait i actually got it and it works

  • Unused Slots Remove
    • Events
      • Time - Every 1.00 seconds of game time
    • Conditions
    • Actions
      • For each (Integer A) from 1 to 10, do (Actions)
        • Loop - Actions
          • Custom script: set bj_wantDestroyGroup = true
          • Unit Group - Pick every unit in (Units in (Playable map area) matching ((Owner of (Matching unit)) Equal to (Player((Integer A))))) and do (Actions)
            • Loop - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • ((Player((Integer A))) slot status) Equal to Is unused
                • Then - Actions
                  • Unit - Remove (Picked unit) from the game
                • Else - Actions
thanks Just_spectating

Thread Solved.
 
Last edited:
Status
Not open for further replies.
Top