Uncle
Warcraft Moderator
- Joined
- Aug 10, 2018
- Messages
- 8,351
I'm trying to detect the Player's chosen Color at the start of the game.
I tested this as Player 1 in the Game Lobby and changed my color to Purple but for whatever reason the game is still assigning me Red's color.
I modified the conditions and removed the empty string check:
Edit:
In the meantime I found a fix by calculating how many Colors the game detects for a given player. If it detects more than 1 color than I know that you've changed for example Player 1 from Red to something else.
-
Player Colors Setup
-

Events
-


Map initialization
-
-

Conditions
-

Actions
-


Set VariableSet Colors[1] = |cffff0303
-


Set VariableSet Colors[2] = |cff0042ff
-


Set VariableSet Colors[3] = |cff1ce6b9
-


Set VariableSet Colors[4] = |cff540081
-


Set VariableSet Colors[5] = |cfffffc00
-


Set VariableSet Colors[6] = |cfffe8a0e
-


Set VariableSet Colors[7] = |cff20c000
-


Set VariableSet Colors[8] = |cffe55bb0
-


Set VariableSet Colors[9] = |cff959697
-


Set VariableSet Colors[10] = |cff7ebff1
-


Set VariableSet Colors[11] = |cff106246
-


Set VariableSet Colors[12] = |cff4a2a04
-


Set VariableSet Colors[13] = |cff9b0000
-


Set VariableSet Colors[14] = |cff0000c3
-


Set VariableSet Colors[15] = |cff00eaff
-


Set VariableSet Colors[16] = |cffbe00fe
-


Set VariableSet Colors[17] = |cffebcd87
-


Set VariableSet Colors[18] = |cfff8a48b
-


Set VariableSet Colors[19] = |cffbfff80
-


Set VariableSet Colors[20] = |cffdcb9eb
-


Set VariableSet Colors[21] = |cff282828
-


Set VariableSet Colors[22] = |cffebf0ff
-


Set VariableSet Colors[23] = |cff00781e
-


Set VariableSet Colors[24] = |cffa46f33
-


For each (Integer A) from 1 to 24, do (Actions)
-



Loop - Actions
-




If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-





If - Conditions
-






Player_Color[1] Equal to <Empty String>
-






(Color of Player 1 (Red)) Equal to (Color of (Player((Integer A))))
-
-





Then - Actions
-






Set VariableSet Player_Color[1] = Colors[(Integer A)]
-






Game - Display to (All players) for 30.00 seconds the text: (Player Color #: + (String((Integer A))))
-
-





Else - Actions
-
-
-
-
-
I tested this as Player 1 in the Game Lobby and changed my color to Purple but for whatever reason the game is still assigning me Red's color.
I modified the conditions and removed the empty string check:
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-

If - Conditions
-


(Color of Player 1 (Red)) Equal to (Color of (Player((Integer A))))
-
-

Then - Actions
-


Set VariableSet Player_Color[1] = Colors[(Integer A)]
-


Game - Display to (All players) for 30.00 seconds the text: (Player Color #: + (String((Integer A))))
-
-
Edit:
In the meantime I found a fix by calculating how many Colors the game detects for a given player. If it detects more than 1 color than I know that you've changed for example Player 1 from Red to something else.
-
Player Colors Setup
-

Events
-


Map initialization
-
-

Conditions
-

Actions
-


Set VariableSet Colors[1] = |cffff0303
-


Set VariableSet Colors[2] = |cff0042ff
-


Set VariableSet Colors[3] = |cff1ce6b9
-


Set VariableSet Colors[4] = |cff540081
-


Set VariableSet Colors[5] = |cfffffc00
-


Set VariableSet Colors[6] = |cfffe8a0e
-


Set VariableSet Colors[7] = |cff20c000
-


Set VariableSet Colors[8] = |cffe55bb0
-


Set VariableSet Colors[9] = |cff959697
-


Set VariableSet Colors[10] = |cff7ebff1
-


Set VariableSet Colors[11] = |cff106246
-


Set VariableSet Colors[12] = |cff4a2a04
-


Set VariableSet Colors[13] = |cff9b0000
-


Set VariableSet Colors[14] = |cff0000c3
-


Set VariableSet Colors[15] = |cff00eaff
-


Set VariableSet Colors[16] = |cffbe00fe
-


Set VariableSet Colors[17] = |cffebcd87
-


Set VariableSet Colors[18] = |cfff8a48b
-


Set VariableSet Colors[19] = |cffbfff80
-


Set VariableSet Colors[20] = |cffdcb9eb
-


Set VariableSet Colors[21] = |cff282828
-


Set VariableSet Colors[22] = |cffebf0ff
-


Set VariableSet Colors[23] = |cff00781e
-


Set VariableSet Colors[24] = |cffa46f33
-


-------- --------
-


-------- Player 1 --------
-


Set VariableSet Color_Fix = 0
-


For each (Integer A) from 1 to 24, do (Actions)
-



Loop - Actions
-




If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-





If - Conditions
-






(Color of Player 1 (Red)) Equal to (Color of (Player((Integer A))))
-
-





Then - Actions
-






Set VariableSet Color_Fix = (Color_Fix + 1)
-
-





Else - Actions
-
-
-
-


If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-



If - Conditions
-




Color_Fix Equal to 1
-
-



Then - Actions
-




Set VariableSet Player_Color[1] = Colors[1]
-
-



Else - Actions
-




For each (Integer A) from 1 to 24, do (Actions)
-





Loop - Actions
-






If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-







If - Conditions
-








(Integer A) Not equal to 1
-








Player_Color[1] Equal to <Empty String>
-








(Color of Player 1 (Red)) Equal to (Color of (Player((Integer A))))
-
-







Then - Actions
-








Set VariableSet Player_Color[1] = Colors[(Integer A)]
-
-







Else - Actions
-
-
-
-
-
-
-
Last edited:

