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

[Trigger] Kick player team if alone?

Status
Not open for further replies.

Kazeon

Hosted Project: EC
Level 34
Joined
Oct 12, 2011
Messages
3,449
Add all players in each team to their own player group.

When player leaves remove that player for the group and then check if player group is empty.

so that means we need to make 4 some player group variables? As far as I know group variables with array are malfunctioned
 
so that means we need to make 4 player group variables? As far as I know group variables with array are malfunctioned

You need to make as many player groups as there are teams.

They are not malfunctioning.
They are one of the few variables that have to be initialized to the value you want them to be in the variable editor.
Or with custom script.

Example: Player group array is called teamsPG
Lets say it is set to one in variable editor that means teamsPG[0] and teamsPG[1] are initialized. If you want to initialize teamsPG[2] do below code.

  • set teamsPG[2] = CreateForce()
 
Add all players in each team to their own player group.

When player leaves remove that player for the group and then check if player group is empty.

Also this belongs in the World Editor Help Zone. Please read rules of posting and what questions are acceptable on what forums

If it's so simple where is the condition for empty player group?
 
  • pl1
    • Events
      • Player - Player 1 (Red) leaves the game
    • Conditions
    • Actions
      • Unit - Remove Paladin 0000 <gen> from the game
      • Player Group - Remove Player 1 (Red) from Team_ALLY
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Number of players in Team_HORDE) Equal to 0
        • Then - Actions
          • Game - Pause the game
          • Dialog - Show victory for Player 1 (Red)
          • Dialog - Show victory for Player 2 (Blue)
          • Dialog - Show victory for Player 3 (Teal)
          • Dialog - Show victory for Player 4 (Purple)
          • Dialog - Show victory for Player 5 (Yellow)
          • Dialog - Show victory for Player 6 (Orange)
        • Else - Actions
I guess this si the right trigger.
 
Yes but there is a better way to do it. The way you have it you need 12 triggers for 12 players.

At start of game split players into groups then remove when necessary.

Example:

  • event
    • game start
  • conditions
  • Actions
    • set players 1 to 6 in group[1]
    • set players 7 to 12 in group[2]
    • // Or however you want to sort them
  • Remove players that aren't playing
  • events
    • player 1 to 12 leaves game
  • conditions
  • Actions
    • Set tempPlayer = triggering Player
    • if tempPlayer is in group[1]
    • then
      • Player Group - Remove tempPlayer from group[1]
      • if number of players in group[1] less than 1
      • then
        • Pick all players in group[2]
          • Show victory to picked player
      • else
    • else
      • Player Group - Remove tempPlayer from group[2]
      • if number of players in group[2] less than 1
      • then
        • Pick all players in group[1]
          • Show victory to picked player
      • else
 
Status
Not open for further replies.
Top