you should use regular "quotes" instead of 'apostrophes' around the words you want people to read, because apostrophes work differently. Honestly I myself don't really understand it entirely, but generally:
If you are sending a command, it goes in apostrophes.
If you are sending a string for the player to read, it goes in quotes.
If someone could clarify it better that would be nice.
Over the network, a string typed in quote marks is sent by first specifying the length of the string followed by the raw string itself.
This can be quite slow, which is bad for things that need to run quickly, such as notifications of events, kill messages or other things.
When you type a string in apostrophes, it means that it's a tagged string. A tagged string is not sent as the string itself, rather as a number identifying it. The first time you send a tagged string over the network, it is given a unique ID and sent in full length, however all future transmissions only contain the ID. This allows for much faster transmission of strings that may be repeated often, such as command names or kill messages. In TorqueScript, typing
echo( 'hello' ); will display the ID of the tagged string. If you want to see the actual string itself, use
echo( getTaggedString( 'hello' ) );getTaggedString( index ) converts a tagged string ID to the string itself. If you're going to do a loop on this which ends once you reach an empty string, note that index 0 is always taken up by an empty string (length 0).
getTag( string ) converts a string to a tagged string ID representing it.
Here's some things that you have to (bolded), really should (italics) or it could be a good idea to send as tagged strings:
Network commands (clientCmd, serverCmd, secureClientCmd)
Kill messages
Player names (as arguments to messageClient, use getTag for this)
Repeating messages, generally fixed messages with changing arguments (e.g. round win notifications.).Here's some things that you shouldn't use tagged strings for:
Chat messages
Large streams of data