So you want to make and break alliances with chat commands? Well, it's quite simple. Though I don't know why you would want to write down your own player number? (I'm guessing that the idea with the first P1 or P8). You can get the triggering player (the player that is typing the message) in the trigger, so you couldn't make alliances for other players other than yourself.
But here's an example:
-
Events
-
Player - Player 1 (Red) types a chat message containing ! as A substring
-
Player - Player 2 (Blue) types a chat message containing ! as A substring
-
Player - Player 3 (Teal) types a chat message containing ! as A substring
-
Player - Player 4 (Purple) types a chat message containing ! as A substring
-
----- Etc. for all players. ------
-
Conditions
-
Actions
-
For each (Integer MakeYourOwnLoopInteger) from 1 to AmountOfPlayers, do (Actions)
-
Loop - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
(Substring((Entered chat string), 2, 5)) Equal to ally
-
(Substring((Entered chat string), 7, 8)) Equal to (String(MakeYourOwnLoopInteger))
-
Then - Actions
-
Player - Make (Triggering player) treat (Player(MakeYourOwnLoopInteger)) as an Ally with shared vision
-
Player - Make (Player(MakeYourOwnLoopInteger)) treat (Triggering player) as an Ally with shared vision
-
Else - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
(Substring((Entered chat string), 2, 7)) Equal to unally
-
(Substring((Entered chat string), 9, 10)) Equal to (String(MakeYourOwnLoopInteger))
-
Then - Actions
-
Player - Make (Triggering player) treat (Player(MakeYourOwnLoopInteger)) as an Enemy
-
Player - Make (Player(MakeYourOwnLoopInteger)) treat (Triggering player) as an Enemy
-
Else - Actions