• 🏆 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!

removing empty spaces

Status
Not open for further replies.
Level 4
Joined
Jun 14, 2008
Messages
72
so at the begining of the game, the goal is to remove all units owned by a open slot when the game starts EG. if player 2 is empty and game starts remove all units owned by player 2. the problem is that it sees empty slots as players... is there a way to remove them?
 
um, there's PlayerSlotStatus conditions, along with Player Controller conditions. so you add a function like this

  • Player Group - Pick every player in (All players matching ((((Matching player) controller) Not equal to User) and (((Matching player) slot status) Not equal to Is playing))) 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
 
Level 14
Joined
Aug 31, 2009
Messages
775
Remove the "All players matching ((Matching Player) controller) not equal to User" and leave in the other condition and see if that works.

You can also check the status "Player Slot is Empty" as an OR along with the last condition and this might catch the correct effect.
 
Level 19
Joined
Feb 25, 2009
Messages
2,004
  • Trigger
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Set EmptySlots = (All players matching ((((Matching player) controller) Not equal to User) and (((Matching player) slot status) Not equal to Is playing)))
      • Player Group - Pick every player in EmptySlots and do (Actions)
        • Loop - Actions
          • Custom script: set bj_wantDestroyGroup = true
          • Unit Group - Pick every unit in (Units owned by (Picked player)) and do (Actions)
            • Loop - Actions
              • Unit - Hide (Picked unit)
              • Unit - Add a 1.00 second Generic expiration timer to (Picked unit)
      • Custom script: call DestroyForce (udg_EmptySlots)
Removes unit owned by player which slots are open and/or are AI's.
 
Level 4
Joined
Jun 14, 2008
Messages
72
well this one also did nothing but if i switch the and to or it deletes the computer but leaves the blank spaces
 
Last edited:
Level 6
Joined
Mar 22, 2009
Messages
276
  • Events
    • Map Initialization
  • Conditions
  • Actions
    • Set EmptySlots = (All players controlled by a (None) player)
    • Player Group - Pick every player in EmptySlots and do (Actions)
      • Loop - Actions
        • Custom script: set bj_wantDestroyGroup = true
        • Unit Group - Pick every unit in (Units owned by (Picked player)) and do (Actions)
        • Loop - Actions
          • Unit Remove (Picked Unit)
    • Custom script: call DestroyForce (udg_EmptySlots)
if that didn't work I'll post another method, much longer but will surely work.
 
Level 11
Joined
Aug 1, 2009
Messages
714
  • Events
    • Map Initialization
  • Conditions
  • Actions
    • Set EmptySlots = (All players controlled by a (None) player)
    • Player Group - Pick every player in EmptySlots and do (Actions)
      • Loop - Actions
        • Custom script: set bj_wantDestroyGroup = true
        • Unit Group - Pick every unit in (Units owned by (Picked player)) and do (Actions)
        • Loop - Actions
          • Unit Remove (Picked Unit)
    • Custom script: call DestroyForce (udg_EmptySlots)
if that didn't work I'll post another method, much longer but will surely work.

Obviously I think his won't work. Look at the
  • Player Group - Pick every player in EmptySlots and do (Actions)
    • Loop - Actions
      • Custom script: set bj_wantDestroyGroup = true
      • Unit Group - Pick every unit in (Units owned by (Picked player)) and do (Actions)
      • Loop - Actions
        • Unit Remove (Picked Unit)
Look at this line of custom script
  • Custom script: set bj_wantDestroyGroup = true
I think it deletes the player group and won't trigger the (Picked player)
Try this
  • Events
    • Map Initialization
  • Conditions
  • Actions
    • Set EmptySlots = (All players controlled by a (None) player)
    • Player Group - Pick every player in EmptySlots 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)
    • Custom script: set bj_wantDestroyGroup = true
    • Custom script: call DestroyForce (udg_EmptySlots)
 
Level 14
Joined
Aug 31, 2009
Messages
775
Calling the wantDestroyGroup after creating the unit group won't do anything.

Personally, I use:

  • Custom script: set bj_wantDestroyGroup = true
  • Unit Group - Pick Every Unit in (Playable Map Area)
    • General (If then Else)
      • If - Conditions
        • (Owner of (Picked Unit)) slot status equal to Is Playing
        • (Owner of (Picked Unit)) controller equal to User
      • Then - Actions
      • Else - Actions
        • Unit - Remove (Picked Unit) from the game
 
Level 4
Joined
Jun 14, 2008
Messages
72
I figured it out on my own it just took alot of fiddleing with and intead of removing the units i created the exact same units in reigons

  • unit creator
    • Events
      • Map initialization
    • 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) controller) Equal to User) and (((Picked player) slot status) Equal to Is playing)
            • Then - Actions
              • Unit - Create 1 Unit picker for (Picked player) at ((Picked player) start location) facing Default building facing degrees
            • Else - Actions
              • Do nothing
:grin:
 
Level 11
Joined
Aug 1, 2009
Messages
714
I figured it out on my own it just took alot of fiddleing with and intead of removing the units i created the exact same units in reigons

  • unit creator
    • Events
      • Map initialization
    • 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) controller) Equal to User) and (((Picked player) slot status) Equal to Is playing)
            • Then - Actions
              • Unit - Create 1 Unit picker for (Picked player) at ((Picked player) start location) facing Default building facing degrees
            • Else - Actions
              • Do nothing
:grin:

This trigger will be make your loading screen a little longer.
So look at my trigger here. It is not leaky and doesn't make my loading long.

  • Map Initialization Not Leaky
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Set Making_Point = (Center of Roshan Make Region <gen>)
      • Unit - Create 1 Skill - Dummy Unit for Neutral Hostile at Making_Point facing 0.00 degrees
      • Custom script: call RemoveLocation (udg_Making_Point)
      • Set Making_Point = (Center of Roshan Make Region <gen>)
      • Unit - Create 1 Skill - Dummy Unit for Neutral Hostile at Making_Point facing 0.00 degrees
      • Custom script: call RemoveLocation (udg_Making_Point)
You MUST set the point for every unit and remove it.
 
Status
Not open for further replies.
Top