Removing an abesnt players units??

Callmebob

New Member
Reaction score
1
Hey all,

I'm sure this is commonly asked, and that the answer is idiotically simple, but I can't seem to figure it out.

What I'm making is a maze game, or an "escape" if you will.
After 2 seconds the players hero's all spawn at the start of my first level, no duh. What I can't seem to figure is how to have a trigger check if a slot is occupied, and remove the hero if that slot is in fact, empty.

*Note*: I only know my way around GUI, because I simply don't have the time or the need to learn JASS. So advice of the GUI sort would be most appreciated.

Thanks in advance!
 

cleeezzz

The Undead Ranger.
Reaction score
268
Code:
Untitled Trigger 001
    Events
        Time - Elapsed game time is 5.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 Temp_Group = (Units owned by (Player((Integer A))))
                        Unit Group - Pick every unit in Temp_Group and do (Actions)
                            Loop - Actions
                                Unit - Remove (Picked unit) from the game
                        Custom script:   call DestroyGroup(udg_Temp_Group)
                    Else - Actions

that removes units not controlled by a player at 5 seconds into the game, im sure you can take this and incorporate it into your spawning system.

even better cuz it is spawning, this will only spawn units for players in the game

Code:
Untitled Trigger 001
    Events
        Time - Elapsed game time is 5.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) Equal to User
                        ((Player((Integer A))) slot status) Equal to Is playing
                    Then - Actions
                        Set Temp_Point = Center of (Playable map area)
                        Unit - Create 1 Footman for Player 1 (Red) at (Temp_Point) facing Default building facing degrees
                        call RemoveLocation(udg_Temp_Point)
                    Else - Actions
 

Callmebob

New Member
Reaction score
1
I seem to be a bit confused.

What are the "if" condition types? I've looked through the various types I thought it would be, and I can't seem to get ((Player ((Integer A))) controller ect.

It's right in front of me I know it.
 

Joccaren

You can change this now in User CP.
Reaction score
54
Just do a if then else:
Event: game time equal to 5 seconds
Condition:
Action:
If: If (player 1 red) is playing equal to false
Then: Do nothing
Else: Spawn 1 (Hero Type) for (player1 red)

For multiple players, add another If then else for each player.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top