• 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 Group Issue

Level 13
Joined
Sep 25, 2013
Messages
717
EDIT: Okay I solved it. I didn't realize I needed to not only check for if a player is a "user" but also check if they are "playing".

  • Untitled Trigger 004
    • Events
      • Time - Elapsed game time is 1.00 seconds
    • Conditions
    • Actions
      • Set VariableSet tempInteger = 1
      • For each (Integer A) from 1 to 6, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Player(tempInteger)) controller) Equal to Computer
            • Then - Actions
              • Player Group - Add (Player(tempInteger)) to TeamAI_PlayerGroup
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • ((Player(tempInteger)) controller) Equal to User
                  • ((Player(tempInteger)) slot status) Equal to Is playing
                • Then - Actions
                  • Player Group - Add (Player(tempInteger)) to TeamReal_PlayerGroup
                • Else - Actions
          • Set VariableSet tempInteger = (tempInteger + 1)
      • Game - Display to (All players) the text: (AI Players Team: + (String((Number of players in TeamAI_PlayerGroup))))
      • Game - Display to (All players) the text: (Real Players Team: + (String((Number of players in TeamReal_PlayerGroup))))
I am trying to make 2 separate player groups: one for computer controlled players and one for user/real players. When I test my map with just me and one computer player (my map can have up to 6 players), this trigger accurately counts the amount of computer players, but always says there are 5 user/real players even though I am the only real player in the game. The other 4 player slots I have left empty when creating the game.
What am I doing wrong? Thank you!

  • Untitled Trigger 004
    • Events
      • Time - Elapsed game time is 1.00 seconds
    • Conditions
    • Actions
      • Set VariableSet tempInteger = 1
      • For each (Integer A) from 1 to 6, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Player(tempInteger)) controller) Equal to Computer
            • Then - Actions
              • Player Group - Add (Player(tempInteger)) to TeamAI_PlayerGroup
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • ((Player(tempInteger)) controller) Equal to User
                • Then - Actions
                  • Player Group - Add (Player(tempInteger)) to TeamReal_PlayerGroup
                • Else - Actions
          • Set VariableSet tempInteger = (tempInteger + 1)
      • Game - Display to (All players) the text: (AI Players Team: + (String((Number of players in TeamAI_PlayerGroup))))
      • Game - Display to (All players) the text: (Real Players Team: + (String((Number of players in TeamReal_PlayerGroup))))
 
Last edited:
Top