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!
You are using an out of date browser. It may not display this or other websites correctly. You should upgrade or use an alternative browser.
Triggers
Chat System v1.1.0.w3x
Variables
Chat
Initialization
Chat
Chat (Cont)
Not displaying chat in game
Commands with command confirmation
Commands
Kartenspezifischen eigenen Skript-Code unten eingeben. Dieser Text wird in das Karten-Skript nach der Deklaration der Variablen und vor jeglichem Auslöser-Code eingefügt.
Name
Type
is_array
initial_value
ColourString
string
Yes
PrivateGroup
force
Yes
tempGroup
force
No
This is quite straightforward. The first part gives the colour strings to be used in the whole game, used in the Chat trigger.
The next part adds each player to his/her own private chat group, so that they can see their own private chat.
The next part is entirely self explanatory. It simply displays commands and features of the system, and their function.
The next part of it is for a "quest" displaying each player's number, to be used for the -add#/-remove# command, for the private chat list. Not everyone knows each player's number, which is why this "quest" exists, as well as the -nl/-nlist command.
Initialization
Events
Map initialization
Conditions
Actions
Set Variable Set ColourString[1] = "|CFFFF0303"
Set Variable Set ColourString[2] = "|CFF0042FF"
Set Variable Set ColourString[3] = "|CFF1CB619"
Set Variable Set ColourString[4] = "|CFF540081"
Set Variable Set ColourString[5] = "|CFFFFFF01"
Set Variable Set ColourString[6] = "|CFFFE8A0E"
Set Variable Set ColourString[7] = "|CFF20C000"
Set Variable Set ColourString[8] = "|CFFE55BB0"
Set Variable Set ColourString[9] = "|CFF959697"
Set Variable Set ColourString[10] = "|CFF7EBFF1"
Set Variable Set ColourString[11] = "|CFF106246"
Set Variable Set ColourString[12] = "|CFF4E2A04"
For each (Integer A) from 1 to 12 , do (Actions)
Loop - Actions
Player Group - Add (Player((Integer A))) to PrivateGroup[(Integer A)]
Quest - Create a Optional quest titled Chat with the description The game's chat system is custom. Refer to the commands above to fully understand it.Please note that F12 (Chat) can be used to show your possible private chat, or allied chat should you be in All chat. , using icon path ReplaceableTextures\CommandButtons\BTNNeutralManaShield.blp
Quest - Create a quest requirement for (Last created quest) with the description to talk to all, use a . in front of everything you say. (ex: .<msg>)
Quest - Create a quest requirement for (Last created quest) with the description talking to Allies is automatic.
Quest - Create a quest requirement for (Last created quest) with the description p to talk to your private chat group (ex: -p<message>)
Quest - Create a quest requirement for (Last created quest) with the description removeall - removes all people from your private chat list
Quest - Create a quest requirement for (Last created quest) with the description addall - adds all people to your private chat list
Quest - Create a quest requirement for (Last created quest) with the description privlist - displays your private chat list.
Quest - Create a quest requirement for (Last created quest) with the description nl/-nlist - displays each player's number (used for -add#/-remove#)
Quest - Create a quest requirement for (Last created quest) with the description add# - adds the specified number player to your private chat list.
Quest - Create a quest requirement for (Last created quest) with the description remove# - removes the specified number player to your private chat list.
Quest - Create a quest requirement for (Last created quest) with the description note that the commands are case sensitive.
Quest - Create a Optional quest titled Player Numbers with the description Either use this list for your private chat, or use the command -nl/-nlist. , using icon path ReplaceableTextures\CommandButtons\BTNNeutralManaShieldOff.blp
For each (Integer A) from 1 to 12 , do (Actions)
Loop - Actions
Set Variable Set tempGroup = (Player group((Player((Integer A)))))
Player Group - Pick every player in tempGroup and do (Actions)
Loop - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
And - All (Conditions) are true
Conditions
((Player((Integer A))) controller) Equal to User
((Player((Integer A))) slot status) Equal to Is playing
Then - Actions
Quest - Create a quest requirement for (Last created quest) with the description (ColourString[(Integer A)] + ((Name of (Player((Integer A)))) + (|r - + (String((Player number of (Player((Integer A)))))))))
Else - Actions
Custom script: call DestroyForce (udg_tempGroup)
The triggering of this system is quite simple.
Event: obvious. When any player types anything, the trigger runs a check if the message did not have any of the messages in the string (substrings referring to a part of a string, ie. sub of a string. The substring takes the first number and begins the substring there and ends at the second number). Should this pass, the first check is if the message contains a -p at the start (first two letters), which is the command for a private chat. Should this condition be true, the message displayed to the players inside the variable player group PrivateGroup[number of triggering player(ie. person saying something)] will be the following 'formula':
[ |cffD6AE12(Private) - |r ] - the first concenate string (concenate strings are a series of strings). The text in front of the bracket is the colour code in which (Private) will be coloured, (Private) refers to the fact that this is a private message. |r displays the end of the colour string.
[ + ColourString[(Player number of (Triggering player))]) ] - the second concenate string. This will decide the colour of the player's name in the private message. ColourString[] is an array variable (ie a 'stack' of variables of the same type) which has 12 values. Each of these 12 values is set at the very beginning of the game, player 1 (red)'s, [1], is set to red, player 2 (blue)'s, [2], is set to blue and so on. This way, the trigger takes the player's number and puts it into this array, giving the correct colour for the player name.
[ + Name of (Triggering player) ] - this is the third part. The name of the player in the message will be decided by it - its colour already decided by the string before this one.
[ + (|r: ] - this is a simple colour string stop and :, displaying the end of the player name (and the colour of it) and the start of the message, with a : and a space (giving a less cluttered look)
[ + Substring(Entered chat string), 3, 90) ] - this is the most important part of the action. It displays the actual message.
Chat
Events
Player - Player 1 (Red) types a chat message containing (Unexpected type: 'stringnoformat') as A substring
Player - Player 2 (Blue) types a chat message containing (Unexpected type: 'stringnoformat') as A substring
Player - Player 3 (Teal) types a chat message containing (Unexpected type: 'stringnoformat') as A substring
Player - Player 4 (Purple) types a chat message containing (Unexpected type: 'stringnoformat') as A substring
Player - Player 5 (Yellow) types a chat message containing (Unexpected type: 'stringnoformat') as A substring
Player - Player 6 (Orange) types a chat message containing (Unexpected type: 'stringnoformat') as A substring
Player - Player 7 (Green) types a chat message containing (Unexpected type: 'stringnoformat') as A substring
Player - Player 8 (Pink) types a chat message containing (Unexpected type: 'stringnoformat') as A substring
Player - Player 9 (Gray) types a chat message containing (Unexpected type: 'stringnoformat') as A substring
Player - Player 10 (Light Blue) types a chat message containing (Unexpected type: 'stringnoformat') as A substring
Player - Player 11 (Dark Green) types a chat message containing (Unexpected type: 'stringnoformat') as A substring
Player - Player 12 (Brown) types a chat message containing (Unexpected type: 'stringnoformat') as A substring
Conditions
Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
And - All (Conditions) are true
Conditions
(Substring((Entered chat string), 1, 7)) Not equal to -remove
(Substring((Entered chat string), 1, 4)) Not equal to -add
(Substring((Entered chat string), 1, 9)) Not equal to -privlist
(Substring((Entered chat string), 1, 6)) Not equal to -nlist
(Substring((Entered chat string), 1, 3)) Not equal to -nl
Then - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Substring((Entered chat string), 1, 2)) Equal to -p
Then - Actions
Game - Display to PrivateGroup[(Player number of (Triggering player))] the text: ((|cffD6AE12(Private) |r + ColourString[(Player number of (Triggering player))]) + ((Name of (Triggering player)) + (|r: + (Substring((Entered chat string), 3, 90)))))
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Substring((Entered chat string), 1, 1)) Equal to .
Then - Actions
Game - Display to (All players) the text: ((|cffD6AE12(All) |r + ColourString[(Player number of (Triggering player))]) + ((Name of (Triggering player)) + (|r: + (Substring((Entered chat string), 2, 90)))))
Else - Actions
Game - Display to (All allies of (Triggering player).) the text: ((|cffD6AE12(Allies) |r + ColourString[(Player number of (Triggering player))]) + ((Name of (Triggering player)) + (|r: + (Entered chat string))))
Else - Actions
(last line) ... [ + Substring(Entered chat string), 3, 90) ] - this is the most important part of the action. It displays the actual message. ...
This message will be displayed to the player group already decided and explained earlier on, along with the rest of the string, the 3, 90 is deciding the start and end of the message. 3 is after -p (which are 1, 2) and 90 is the maximum amount of characters allowed in a message, thus giving a quite long message length limit.
The All and Allies chat follow the same rule, with some exceptions:
- Player group displayed to - All displays the message to, well, ALL players. Allies only displays it to allies of the typist.
- The last part of the concenate strings (Substring(Entered chat string), #, #) - varies as in the All chat, only a . is needed to cause this, while allies is the default chat and displays all characters entered.
As you may notice, the system also does not display normal WC3 chat in game. This is because of the fact that in Advanced > Game Interface, the 5 Chat Recipient message fields have been filled with spaces, this many:
' '
If you wish to export this system to a different map, you will need to change those fields as well.
NOTE: The only difference between the normal Commands trigger and this trigger is that this one returns a confirmation message when an -add or -remove command is carried out.
The triggering of this is extremely simple as well. If you know anything about substrings, it will come quite naturally, if not, the Chat comments should be enough.
The first command is the -add: -add1-12 or -addall. -addall is the first check, and will simply take all players from 1-12 and do the actions that if they are playing and are a user (ie, not computer), they will be added to the triggering player's PrivateGroup, to which private chat is displayed with -p. -add# is simply that it will take the 5th letter of the chat command, the number being added, and run the checks for playing & user and then add this player to the triggering player's group. The next action is simply the confirmation return message, which also displays the player's colour, should the person make a mistake.
The next part, -remove, is the precise same, other than the fact that it removes players instead of adding them. During the -removeall command, ALL players are first removed, then the triggering player is put back, so that this player can see their own chat once again. For the single number removal, it also checks that the number is not the triggering player's number.
-privlist takes all the players in the triggering player's PrivateGroup and displays a message with their colour string & name to the triggering player, showing all the people in their private chat list.
-nl/-nlist simply displays the 2nd quest during Initialization.
And that's already it! :- )!
Commands with command confirmation
Events
Player - Player 1 (Red) types a chat message containing (Unexpected type: 'stringnoformat') as A substring
Player - Player 2 (Blue) types a chat message containing (Unexpected type: 'stringnoformat') as A substring
Player - Player 3 (Teal) types a chat message containing (Unexpected type: 'stringnoformat') as A substring
Player - Player 4 (Purple) types a chat message containing (Unexpected type: 'stringnoformat') as A substring
Player - Player 5 (Yellow) types a chat message containing (Unexpected type: 'stringnoformat') as A substring
Player - Player 6 (Orange) types a chat message containing (Unexpected type: 'stringnoformat') as A substring
Player - Player 7 (Green) types a chat message containing (Unexpected type: 'stringnoformat') as A substring
Player - Player 8 (Pink) types a chat message containing (Unexpected type: 'stringnoformat') as A substring
Player - Player 9 (Gray) types a chat message containing (Unexpected type: 'stringnoformat') as A substring
Player - Player 10 (Light Blue) types a chat message containing (Unexpected type: 'stringnoformat') as A substring
Player - Player 11 (Dark Green) types a chat message containing (Unexpected type: 'stringnoformat') as A substring
Player - Player 12 (Brown) types a chat message containing (Unexpected type: 'stringnoformat') as A substring
Conditions
Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Substring((Entered chat string), 1, 4)) Equal to -add
Then - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Substring((Entered chat string), 5, 7)) Equal to all
Then - 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
((Player((Integer A))) slot status) Equal to Is playing
((Player((Integer A))) controller) Equal to User
Then - Actions
Player Group - Add (Player((Integer A))) to PrivateGroup[(Player number of (Triggering player))]
Else - Actions
Game - Display to (Player group((Triggering player))) the text: |cffD6AE12All players succesfully added to your private chat list.|r
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
And - All (Conditions) are true
Conditions
(Integer((Substring((Entered chat string), 5, 5)))) Greater than 0
(Substring((Entered chat string), 5, 5)) Not equal to (String((Player number of (Triggering player))))
Then - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
And - All (Conditions) are true
Conditions
((Player((Integer((Substring((Entered chat string), 5, 5)))))) slot status) Equal to Is playing
((Player((Integer((Substring((Entered chat string), 5, 5)))))) controller) Equal to User
Then - Actions
Player Group - Add (Player((Integer((Substring((Entered chat string), 5, 5)))))) to PrivateGroup[(Player number of (Triggering player))]
Game - Display to (Player group((Triggering player))) the text: ((ColourString[(Integer((Substring((Entered chat string), 5, 5))))] + (Name of (Player((Integer((Substring((Entered chat string), 5, 5)))))))) + |r |cffD6AE12has been succesfully added to your private chat list.|r)
Else - Actions
Else - Actions
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Substring((Entered chat string), 1, 7)) Equal to -remove
Then - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Substring((Entered chat string), 8, 10)) Equal to all
Then - Actions
For each (Integer A) from 1 to 12 , do (Actions)
Loop - Actions
Player Group - Remove (Player((Integer A))) from PrivateGroup[(Player number of (Triggering player))] .
Player Group - Add (Player((Player number of (Triggering player)))) to PrivateGroup[(Player number of (Triggering player))]
Game - Display to (Player group((Triggering player))) the text: |cffD6AE12All players succesfully removed from your private chat list.|r
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Substring((Entered chat string), 8, 8)) Not equal to (String((Player number of (Triggering player))))
(Integer((Substring((Entered chat string), 8, 8)))) Greater than 0
Then - Actions
Player Group - Remove (Player((Integer((Substring((Entered chat string), 8, 8)))))) from PrivateGroup[(Player number of (Triggering player))] .
Game - Display to (Player group((Triggering player))) the text: ((ColourString[(Integer((Substring((Entered chat string), 8, 8))))] + (Name of (Player((Integer((Substring((Entered chat string), 8, 8)))))))) + |r |cffD6AE12has been succesfully removed from your chat list.|r)
Else - Actions
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Or - Any (Conditions) are true
Conditions
(Substring((Entered chat string), 1, 9)) Equal to -privlist
Then - Actions
Game - Display to (Player group((Triggering player))) the text: |cffD6AE12Your private chat list is:|r
Player Group - Pick every player in PrivateGroup[(Player number of (Triggering player))] and do (Actions)
Loop - Actions
Game - Display to (Player group((Triggering player))) the text: ((- + ColourString[(Player number of (Picked player))]) + ((Name of (Picked player)) + |r))
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Or - Any (Conditions) are true
Conditions
(Substring((Entered chat string), 1, 3)) Equal to -nl
(Substring((Entered chat string), 1, 6)) Equal to -nlist
Then - Actions
Game - Display to (Player group((Triggering player))) the text: |cffD6AE12Player's numbers are:|r
For each (Integer A) from 1 to 12 , do (Actions)
Loop - Actions
Set Variable Set tempGroup = (Player group((Player((Integer A)))))
Player Group - Pick every player in tempGroup and do (Actions)
Loop - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
((Player((Integer A))) slot status) Equal to Is playing
((Player((Integer A))) controller) Equal to User
Then - Actions
Game - Display to (Player group((Triggering player))) the text: ((- + ColourString[(Player number of (Picked player))]) + ((Name of (Picked player)) + (|r - + (String((Player number of (Picked player)))))))
Else - Actions
Custom script: call DestroyForce (udg_tempGroup)
Else - Actions
Commands
Events
Player - Player 1 (Red) types a chat message containing (Unexpected type: 'stringnoformat') as A substring
Player - Player 2 (Blue) types a chat message containing (Unexpected type: 'stringnoformat') as A substring
Player - Player 3 (Teal) types a chat message containing (Unexpected type: 'stringnoformat') as A substring
Player - Player 4 (Purple) types a chat message containing (Unexpected type: 'stringnoformat') as A substring
Player - Player 5 (Yellow) types a chat message containing (Unexpected type: 'stringnoformat') as A substring
Player - Player 6 (Orange) types a chat message containing (Unexpected type: 'stringnoformat') as A substring
Player - Player 7 (Green) types a chat message containing (Unexpected type: 'stringnoformat') as A substring
Player - Player 8 (Pink) types a chat message containing (Unexpected type: 'stringnoformat') as A substring
Player - Player 9 (Gray) types a chat message containing (Unexpected type: 'stringnoformat') as A substring
Player - Player 10 (Light Blue) types a chat message containing (Unexpected type: 'stringnoformat') as A substring
Player - Player 11 (Dark Green) types a chat message containing (Unexpected type: 'stringnoformat') as A substring
Player - Player 12 (Brown) types a chat message containing (Unexpected type: 'stringnoformat') as A substring
Conditions
Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Substring((Entered chat string), 1, 4)) Equal to -add
Then - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Substring((Entered chat string), 5, 7)) Equal to all
Then - 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
((Player((Integer A))) slot status) Equal to Is playing
((Player((Integer A))) controller) Equal to User
Then - Actions
Player Group - Add (Player((Integer A))) to PrivateGroup[(Player number of (Triggering player))]
Else - Actions
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
And - All (Conditions) are true
Conditions
(Integer((Substring((Entered chat string), 5, 5)))) Greater than 0
(Substring((Entered chat string), 5, 5)) Not equal to (String((Player number of (Triggering player))))
Then - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
And - All (Conditions) are true
Conditions
((Player((Integer((Substring((Entered chat string), 5, 5)))))) slot status) Equal to Is playing
((Player((Integer((Substring((Entered chat string), 5, 5)))))) controller) Equal to User
Then - Actions
Player Group - Add (Player((Integer((Substring((Entered chat string), 5, 5)))))) to PrivateGroup[(Player number of (Triggering player))]
Else - Actions
Else - Actions
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Substring((Entered chat string), 1, 7)) Equal to -remove
Then - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Substring((Entered chat string), 8, 10)) Equal to all
Then - Actions
For each (Integer A) from 1 to 12 , do (Actions)
Loop - Actions
Player Group - Remove (Player((Integer A))) from PrivateGroup[(Player number of (Triggering player))] .
Player Group - Add (Player((Player number of (Triggering player)))) to PrivateGroup[(Player number of (Triggering player))]
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Substring((Entered chat string), 8, 8)) Not equal to (String((Player number of (Triggering player))))
(Integer((Substring((Entered chat string), 8, 8)))) Greater than 0
Then - Actions
Player Group - Remove (Player((Integer((Substring((Entered chat string), 8, 8)))))) from PrivateGroup[(Player number of (Triggering player))] .
Else - Actions
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Or - Any (Conditions) are true
Conditions
(Substring((Entered chat string), 1, 9)) Equal to -privlist
Then - Actions
Game - Display to (Player group((Triggering player))) the text: |cffD6AE12Your private chat list is:|r
Player Group - Pick every player in PrivateGroup[(Player number of (Triggering player))] and do (Actions)
Loop - Actions
Game - Display to (Player group((Triggering player))) the text: ((- + ColourString[(Player number of (Picked player))]) + ((Name of (Picked player)) + |r))
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Or - Any (Conditions) are true
Conditions
(Substring((Entered chat string), 1, 3)) Equal to -nl
(Substring((Entered chat string), 1, 6)) Equal to -nlist
Then - Actions
Game - Display to (Player group((Triggering player))) the text: |cffD6AE12Player's numbers are:|r
For each (Integer A) from 1 to 12 , do (Actions)
Loop - Actions
Player Group - Pick every player in (Player group((Player((Integer A))))) and do (Actions)
Loop - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
((Player((Integer A))) slot status) Equal to Is playing
((Player((Integer A))) controller) Equal to User
Then - Actions
Game - Display to (Player group((Triggering player))) the text: ((- + ColourString[(Player number of (Picked player))]) + ((Name of (Picked player)) + (|r - + (String((Player number of (Picked player)))))))
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.