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

How to assess the number of playing players in the game?

Status
Not open for further replies.
Level 3
Joined
Feb 27, 2011
Messages
39
There is an event "Player - Leaves game", however what if the player never was there eg. the host started with a number of players below maximum? I would need to turn the number of players into a variable, is this possible?
"number of players in all players controlled by a user" gives a weird number of maximum user players from player properties minus 1 ??
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,285
Yes it is possible.
Firstly you need an integer global to keep track of this number.

Next you need to count all the players that have a slot state of "playing" and a map controler of "user".
Simply make the integer global equal to that. Everytime a player leaves you logically decriment it by 1.

It is important that they be bother playing and a user otherwise it may count AI players.
 
Status
Not open for further replies.
Top