logo Scripting for Enemy Territory

Menu


Home
Tutorials
Downloads
Forum
Contact

Friends





Basic tutorial 6

Using colours for your name and binded chats.

The most common use for colours is to make your gaming name and your binded chats look better. Why say "Hi everyone!", when you can say "Hi Everyone!".

Colour codes

Colours are made with colour codes. A colour code consists of a ^ followed by a letter or number. Each letter or number represents a certain colour. In the following images you can see the number/letter with their corresponding colours:



Binded chats

Let's get back to the example in the previous thread, where we made a bind to say "Hi everyone!". Now let's make that bind again, but in blue text. The colour code for blue is ^4, so the bind has to be:
bind x "say ^4Hi everyone!"
So everything that follows the ^4 will appear in blue.



Name

When we started of playing the game, most of us started with a white name. Your name can easily be changed in the menu, when pressing escape. The only drawback is that you cannot add colours to your name this way. There are 2 other ways in setting your name: using the console and placing it in one of your cfg files e.g. your autoexec.cfg.

Console

In the second tutorial I explained how to pull down your console. In your console you can also type single commands you want to execute e.g. setting your name. Important to know is that all commands you type in console have to be preceded by a forward slash(/) and always an ENTER after entering a command! The command for setting your name is of course name. So changing your name in console is done as followed:
/name YourName

Let's say you would like to change your name to:
*NoobZor
In there we use blue (^4) and red (^1). Our command in console would have to be:
/name ^1*^4N^1oob^4Z^1or



In a cfg file

As I will explain more elaborately later on, it is useful to store all your settings (including your name) in a cfg file. Let's say you would like to add your name to your autoexec.cfg. In the second tutorial we discussed how to create it. Now we are going to add our name to it. So start by opening your autoexec.cfg.

In general if you want to store a setting in your cfg file, the command should look like this:
set setting value

So if you want to store your name in your autoexec file, it should be like this:
set name ^1*^4N^1oob^4Z^1or

I will talk about different settings, also known as cvars, later on. Another example of a setting is the sensitivity of your mouse. Let's just say you would like to set your sensitivity to the value 1. Then the following command should be in your autoexec file:
set sensitivity 1

In your autoexec the 2 examples above look like this:



If you want to try and see what your name looks in certain colours, you can try Easyrider's Nickname Generator at www.enemy-territory.com. If you have tried and found the perfect name, you can easily copy and paste the code to your cfg file.

One more important note. As you can see in any cfg file commands are not preceded by a forward slash(/). That's only when you enter commands in your console.

Back to the tutorial list