Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
Untitled Trigger 002

Events


Player - Player 1 (Red) types a chat message containing color yellow as An exact match

Conditions

Actions


Player - Change color of Player 1 (Red) to Yellow, Changing color of existing units
Unit group - Pick every units in (Units selected by (Triggering player)) and do (Actions)

Unit - Change color of (Picked unit) to Yellow

Skip remaining actions
I'm sorry. But how did you make "Unit group - Pick every units in..." is that an action?
Initialization

Events


Map initialization

Conditions

Actions


Set i = 1


Set ColorString[i] = color red


Set Color[i] = Red


Set Player[i] = Player 1 (Red)


Set i = (i + 1)


Set ColorString[i] = color blue


Set Color[i] = Blue


Set Player[i] = Player 2 (Blue)


Set i = (i + 1)


Set ColorString[i] = color teal


Set Color[i] = Teal


Set Player[i] = Player 3 (Teal)


Set i = (i + 1)


Set ColorString[i] = color purple


Set Color[i] = Purple


Set Player[i] = Player 4 (Purple)


Set i = (i + 1)


Set ColorString[i] = color yellow


Set Color[i] = Yellow


Set Player[i] = Player 5 (Yellow)


Set i = (i + 1)


Set ColorString[i] = color orange


Set Color[i] = Orange


Set Player[i] = Player 6 (Orange)


Set i = (i + 1)


Set ColorString[i] = color green


Set Color[i] = Green


Set Player[i] = Player 7 (Green)


Set i = (i + 1)


Set ColorString[i] = color pink


Set Color[i] = Pink


Set Player[i] = Player 8 (Pink)


-------- Add all the color, color string and players you need --------


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



Loop - Actions




For each (Integer B) from 1 to i, do (Actions)





Loop - Actions






Trigger - Add to Change Color <gen> the event (Player - Player[(Integer A)] types a chat message containing ColorString[(Integer B)] as An exact match)
Change Color

Events

Conditions

Actions


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



Loop - Actions




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





If - Conditions






(Entered chat string) Equal to ColorString[(Integer A)]





Then - Actions






Player - Change color of (Triggering player) to Color[(Integer A)], Changing color of existing units





Else - Actions
ok thank you very much
You do not even need to store players, there is a Convert Player Index To Player function and another Get Player Color function you can use unless you change them.
What does he mean by that?
Init

Events


Map initialization

Conditions

Actions


Set i = 1


Set ColorString[i] = color red


Set Color[i] = Red


Set i = (i + 1)


Set ColorString[i] = color blue


Set Color[i] = Blue


Set i = (i + 1)


Set ColorString[i] = color teal


Set Color[i] = Teal


Set i = (i + 1)


Set ColorString[i] = color purple


Set Color[i] = Purple


Set i = (i + 1)


Set ColorString[i] = color yellow


Set Color[i] = Yellow


Set i = (i + 1)


Set ColorString[i] = color orange


Set Color[i] = Orange


Set i = (i + 1)


Set ColorString[i] = color green


Set Color[i] = Green


Set i = (i + 1)


Set ColorString[i] = color pink


Set Color[i] = Pink


-------- Add all the color, color string and players you need --------


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



Loop - Actions




For each (Integer B) from 1 to i, do (Actions)





Loop - Actions






Trigger - Add to Change Color <gen> the event (Player - (Player((Integer A))) types a chat message containing ColorString[(Integer B)] as An exact match)
Initialization

Events


Map initialization

Conditions

Actions


Set ColorString[1] = red


Set ColorString[2] = blue


Set ColorString[3] = teal


Set ColorString[4] = purple


Set ColorString[5] = yellow


Set ColorString[6] = orange


Set ColorString[7] = green


Set ColorString[8] = pink


-------- Add all the color, color string and players you need --------


Set i = 8 or what the amount of players is


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



Loop - Actions




Set ColorString[(Integer A)] = (color + ColorString[(Integer A)])




For each (Integer B) from 1 to i, do (Actions)





Loop - Actions






Trigger - Add to Change Color <gen> the event (Player - (Player((Integer B))) types a chat message containing ColorString[(Integer A)] as An exact match)
Change Color

Events

Conditions

Actions


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



Loop - Actions




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





If - Conditions






(Entered chat string) Equal to ColorString[(Integer A)]





Then - Actions






Unit Group - Pick every unit in (Units currently selected by (Triggering player)) and do (Actions)







Loop - Actions








Unit - Change color of (Picked unit) to (Color of (Player((Integer A))))





Else - Actions
Actions
For each (Integer A) from 1 to i, do (Actions)
Loop - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Entered chat string) Equal to ColorString[(Integer A)]
Then - Actions
Unit Group - Pick every unit in (Units currently selected by (Triggering player)) and do (Actions)
Loop - Actions
Unit - Change color of (Picked unit) to (Color of (Player((Integer A))))
Else - Actions
Surely. This is what TC wanted, only the selected units shall change color, not the player or his/her other units. It does leak a group but it's marginally, the event is not frequent and GUI users do not get it anyway.
