• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

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 63
Joined
Jan 18, 2005
Messages
27,197
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