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

Detecting Amount of Players.

Status
Not open for further replies.
Level 3
Joined
Jun 30, 2010
Messages
75
Alright. So I'm at point where I'm very confused. I can't seem to find out how I detect the amount of players there are in a game. The only way I can think of is alot of triggers that probably would not work. What I would do was that I checked if red was there, then moved onto to blue and so on until it stops with players. But the problem is, some players leave for example teal open because they don't like teal.
Do any of you have any good way to solve my issue. Please tell me if you want me to elaborate it more. (I'm a really desperate gnome right now :S)
 
  • For each (IntegerA) from 1 to 12, do (Actions)
    • Loop - Actions
      • If (All conditions are true) then do (Actions) else do (Actions)
        • If - Conditions
          • ((Player((Integer A))) slot status) Equal to Is playing
        • Then - Actions
          • Set PlayerCount = (PlayerCount + 1)
        • Else - Actions
    • Game - Display to (All players) the text: (Number of Players is Equal to + (String(PlayersCount)))
 
Level 3
Joined
Jun 30, 2010
Messages
75
o_O I'm not that good with variables, sorry, but would you mind explaining it a bit more? :)
(Sorry if I'm being a pain in the ass)
 
Level 3
Joined
Jun 30, 2010
Messages
75
I can't seem to get the part where I add one to player count to work :S It always set index to 0 :O
(Note; I really do suck at variables that hard ;D)
 
Level 3
Joined
Jun 30, 2010
Messages
75
Alright this is what I end up with in the end.

Set PlayerCount[0] = PlayerCount[(Integer A)]

Is that correct?
 
Level 3
Joined
Jun 30, 2010
Messages
75
Aahh now it all makes much more sense. Thank you very much Pharaoh_ for your excellent help.
(+REP)
 
Level 7
Joined
Apr 3, 2009
Messages
318
  • For each (IntegerA) from 1 to 12, do (Actions)
    • Loop - Actions
      • If (All conditions are true) then do (Actions) else do (Actions)
        • If - Conditions
          • ((Player((Integer A))) slot status) Equal to Is playing
        • Then - Actions
          • Set PlayerCount = (PlayerCount + 1)
        • Else - Actions
    • Game - Display to (All players) the text: (Number of Players is Equal to + (String(PlayersCount)))

Bloody genius, as always :thumbs_up:
 
Status
Not open for further replies.
Top