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

Player Count

Status
Not open for further replies.
Level 9
Joined
Apr 7, 2010
Messages
480
I'm trying to make a Mob count limit; Constant-number x (number of playing and user controlled player)

my problem is i can't find the right trigger to set the number of players.
 
Level 5
Joined
Jan 5, 2012
Messages
116
Create a player group variable and make this trigger (My player group is called User_Players):

  • Reset User Group
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Player Group - Remove all players from User_Players
      • Player Group - Pick every player in (All players controlled by a User player) and do (If (((Picked player) slot status) Equal to Is playing) then do (Player Group - Add (Picked player) to User_Players) else do (Do nothing))
You should also run this trigger every 5 seconds to see if anyone has left the game.
 
Last edited:
Level 16
Joined
May 1, 2008
Messages
1,605
Peon Power!

Moin moin =)

  • 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
          • ((Picked player) slot status) Equal to Is playing
        • Then - Actions
          • Set Integer = (Integer + 1)
          • Player Group - Add (Picked player) to PlayerGroup
        • Else - Actions
@ Rawerd: Player Groups except the (All Players)-Player group create a leak, same as (Number of Player in User_Players). Also this Do Nothing action should be deleted ._.
Edit: The integer variable is your player number variable btw

Greetings and Peace
Dr. Boom
 
Status
Not open for further replies.
Top