Units appear when player isn't playing?

Vince

New Member
Reaction score
0
How would I get it so that when a player isn't playing, his units don't appear?
For example, when I'm testing my map by myself there's 11 other units, 1 unit owned by each player.
 

UlquiorrA

New Member
Reaction score
0
Trigger:
  • Red Unused
    • Events
      • Time - Every 0.01 seconds of game time
    • Conditions
      • (Player 1 (Red) slot status) Equal to Is unused
    • Actions
      • Trigger - Turn off (This trigger)
      • Unit - Remove (The unit) <gen> from the game


do the same for the other 10 players
 

Gtam

Lerning how to write and read!! Yeah.
Reaction score
164
Yes its better and more efficiant do it Scary Nachos way
 

cleeezzz

The Undead Ranger.
Reaction score
268
Trigger:
  • Untitled Trigger 003
    • Events
      • Time - Elapsed game time is 1.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))) controller) Not equal to User
              • ((Player((Integer A))) slot status) Not equal to Is playing
            • Then - Actions
              • Set Test_Group = (Units owned by (Player((Integer A))))
              • Unit Group - Pick every unit in Test_Group and do (Actions)
                • Loop - Actions
                  • Unit - Remove (Picked unit) from the game
              • Custom script: call DestroyGroup(udg_Test_Group)
            • Else - Actions


this will remove all units owned by players not playing.
 

Vince

New Member
Reaction score
0
Trigger:
  • Untitled Trigger 003
    • Events
      • Time - Elapsed game time is 1.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))) controller) Not equal to User
              • ((Player((Integer A))) slot status) Not equal to Is playing
            • Then - Actions
              • Set Test_Group = (Units owned by (Player((Integer A))))
              • Unit Group - Pick every unit in Test_Group and do (Actions)
                • Loop - Actions
                  • Unit - Remove (Picked unit) from the game
              • Custom script: call DestroyGroup(udg_Test_Group)
            • Else - Actions


this will remove all units owned by players not playing.

Thanks for the detailed answer, but it didn't work:( Could it be because I don't have the script?
 

Gtam

Lerning how to write and read!! Yeah.
Reaction score
164
Post your trigger and no it will work without the script but then it leaks
 

cleeezzz

The Undead Ranger.
Reaction score
268
post it anyway, you might have the If/then/else outside the integer a loop
 

Vince

New Member
Reaction score
0
Here ya go, thanks for helping!
Trigger:
  • Events
    • Time - Elapsed game time is 1.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))) controller) Not equal to User
              • ((Player((Integer A))) slot status) Not equal to Is playing
            • Then - Actions
              • Set Group = (Units owned by (Player((Integer A))))
              • Unit Group - Pick every unit in Group and do (Actions)
                • Loop - Actions
                  • Unit - Remove (Picked unit) from the game
              • Custom script: call DestroyGroup(udg_Group)
            • Else - Actions
 

Pandamonium

New Member
Reaction score
0
Or you can instead of placing the unit directly on map, you can spawn it in a region if the player is playing. You would have to do a lot of identical triggers but it works.
 

Gtam

Lerning how to write and read!! Yeah.
Reaction score
164
Take away the user check condition not needed.
 

-=Swift=-

New Member
Reaction score
2
Is it possible that he didn't make the necessary variables?
Maybe not, he did change the variable name in his own trigger..
 

Gtam

Lerning how to write and read!! Yeah.
Reaction score
164
Thx man and remember to +rep those who help
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top