• 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.
  • The Hive's 22nd Icon Contest: Creep Abilities is now concluded, time to vote for your favourite set of icons! Click here to vote!
  • ✅ The POLL for Hive's Texturing Contest #34 is OPEN! Vote for the TOP 3 SKINS! 🔗Click here to cast your vote!
  • ✅ The POLL for Hive's Techtree Contest #20 is OPEN! Vote for the TOP 3 FACTIONS! 🔗Click here to cast your vote!

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
 
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.
 
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?
 
what was its name
something like
Custom script: set bj_wantsDestroyGroup = true
for removing leaks
anyway I rather locals etc
 
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?
 
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.
 
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.
Back
Top