• 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.
  • The Hive's 22nd Icon Contest: Creep Abilities is now concluded, time to vote for your favourite set of icons! Click here to vote!
  • ✅ The POLL for Hive's Texturing Contest #34 is OPEN! Vote for the TOP 3 SKINS! 🔗Click here to cast your vote!
  • ✅ The POLL for Hive's Techtree Contest #20 is OPEN! Vote for the TOP 3 FACTIONS! 🔗Click here to cast your vote!

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)))
 
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)
 
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)
 
Alright this is what I end up with in the end.

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

Is that correct?
 
Aahh now it all makes much more sense. Thank you very much Pharaoh_ for your excellent help.
(+REP)
 
  • 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.
Back
Top