Colored server name [Tutorial] (+ chat text transparency)

amperbee

thunderdome denizen
(Consider reading this guide. It's the updated version of the thread you're in.)

I'm at least 75% sure that when you first tried to figure out how to do a colored name for your server, you found this 2011 post (among other results but this is the first one).

I thought it should be better to go more in-depth, and update it to recent versions.

Let's start with this from the get-go - You cannot color your player name, nor chat text (yourself). If it was possible in older versions, good, but you cannot do so since around 2.0 I think.

There are two types of text coloring you can use for your server.
One of them is using numbers from 0 to 7 prepended by the ^ symbol (that is, from ^0 to ^7). This is the easiest way to color your server name, but doesn't show on the in-game server list, while it does on the website version of the master server. I don't know why. On top of that, this method uses up two characters which do count for the maximum amount of characters your server name may have.
Because of this, this tutorial will only focus on the classic way to color text: Using symbols.

This is a list of color codes, symbols, you can use:
Code:
<€> White
<�> Purple
<‚> Yellow
<ƒ> Green
<„> Blue
<…> Red
<†> Gray
<‡> Orange

Kart specific:
<ˆ> Sky | Cyan
<‰> Lavender
<Š> Gold
<‹> Tea | Lime
<Œ> Steel
<�> Pink
<Ž> Brown
<�> Peach
Copy the symbol enclosed in between the brackets.
The purple color symbol is a zero-width space, so it will appear as nothing. There is something, don't worry.
If for some reason you don't see even a square in between the brackets and looks like there's nothing, copy the entire line and paste it on an ANSI-encoded file and use the arrow keys to find the character. You'll notice it because the cursor gets stuck near the brackets once.
With Notepad++ you can change the encoding to something incompatible with the symbol to find it. You won't be able to copy it, however.

buWHCEF.png


uBRukz5.png


As many of you know, to add colors to your server you use symbols. Or the ^number thingy.
To do so, you must execute the command from a text file, be it from its own text file or by autoexec.cfg (read below).

Apologies in advance, as my UI is in spanish.

Step 1:
Begin by creating a text file in the SRB2 folder, and call it however you want.
ShqOG0H.png

We will execute this file in SRB2, so don't make it too long.
Once you create it, open it.

Step 2:
This is VERY important: Make sure the encoding of the file is ANSI!
If the encoding is not ANSI, the file will interpret those symbols as something else, and the formatting will get screwed up.

In Notepad, select the file menu and click "Save As...", and you'll be given a prompt for a filename. Right next to the save button, you have an "Encoding" drop down menu. Select ANSI, and save the text file.
vuRbgcD.png


In Notepad++, there's an "Encoding" tab at the top of the window. Select "Encode in ANSI" from there. Save the file after that.
SUeG1h7.png


Step 3:
Now that we have our ANSI text file, it's time to start colouring!
Pick some colours from the list at the top of the post, and as you type your server name, add those symbols behind the text you want to color.
For example, if you want your server name to look like:
C0S5DmF.png

(the words "The" and "Of" being gray, while "Sun" is yellow and "Nature" is green)
You would type in your text file:
Code:
servername "†The ‚Sun †Of ƒNature"
"†" represents gray, "‚" represents yellow and "ƒ" represents green.
The symbols will color anything in front of them.

Step 4:
Now that we have our file, save it and start SRB2.
In console, type "exec" followed by a space and the entire file name of the file you created. Done!
Now check the "Host server" menu, your coloring is there!
And that's pretty much it!



If the color doesn't work, make sure your text file is encoded in ANSI.
If the server name truncates, make it shorter. The server name will truncate after 31 characters.

If you don't feel like reading a huge paragraph here you go:

1) Make a text file
2) Make sure it uses the ANSI encoding
3) Type "servername", add a space then go type your server name, adding the color symbols behind the text you want to color.
3b) Enclose the server name in quotes.
4) Save
5) Execute in SRB2

k there you go

The server name will truncate after 31 characters. Make them count because each color code takes one, obviously.



The following is aimed towards scripting:
Did you know that (in scripts) you can add transparency in chat?

The normal color symbols go from hex 80 to 87. From 88 until 8F it is all white.
If you add F to it, making it start from 90 and end at 97, the text becomes slightly more transparent!
This goes on and on until reaching F0 to F7, with the most transparent text you can get in chat.
N2EgTy7.png


In Lua you can escape the hex codes with the backslash, making sure you start with a lowercase x and the hex code, for example /x80 for normal white, or escaping the decimal number, for example /128 for normal white.

Here is a list of all these transparency colors, from opaque (normal) to as transparent as it can get:
Code:
| <€> x80 | <�> x90 | <*> xA0 | <°> xB0 | <À> xC0 | <Ð> xD0 | <à> xE0 | <ð> xF0 |
| <�> x81 | <‘> x91 | <¡> xA1 | <±> xB1 | <Á> xC1 | <Ñ> xD1 | <á> xE1 | <ñ> xF1 |
| <‚> x82 | <’> x92 | <¢> xA2 | <²> xB2 | <Â> xC2 | <Ò> xD2 | <â> xE2 | <ò> xF2 |
| <ƒ> x83 | <“> x93 | <£> xA3 | <³> xB3 | <Ã> xC3 | <Ó> xD3 | <ã> xE3 | <ó> xF3 |
| <„> x84 | <”> x94 | <¤> xA4 | <´> xB4 | <Ä> xC4 | <Ô> xD4 | <ä> xE4 | <ô> xF4 |
| <…> x85 | <•> x95 | <¥> xA5 | <µ> xB5 | <Å> xC5 | <Õ> xD5 | <å> xE5 | <õ> xF5 |
| <†> x86 | <–> x96 | <¦> xA6 | <¶> xB6 | <Æ> xC6 | <Ö> xD6 | <æ> xE6 | <ö> xF6 |
| <‡> x87 | <—> x97 | <§> xA7 | <·> xB7 | <Ç> xC7 | <×> xD7 | <ç> xE7 | <÷> xF7 |
(I haven't added the Kart symbol codes here. If you can read this, you can figure out how to retrieve transparency for Kart color maps.)
The symbol you have to use is right in between of two angle brackets.
Again, a blank space means there is a zero-width space.

No, you can't use transparency in server names. I tried, but the website side of the master server reports a blank server name, while the in-game browser reports white text.

You can also put the server name line in your autoexec.cfg file, so it will set the server name everytime you load the game. Dunno why would you want to do that, but you can.



And that's pretty much it. Thanks for reading, have fun, and please make it look good, this isn't acceptable
X3Vtc2J.png

This hurts the man


EDIT: I've included the Kart color codes too! In some places.
Still untested, but the new Kart color codes may not show up in the Master Server.
 
Last edited:
It was possible to color your player name in 2.0 and I Believe it's still possible but won't allow you to join Netgames, too bad, I thought it was neat, my guess is they had to remove it For team modes (CTF and TM), but still there are other ways to force players to use the same color for specific game modes.

Regardless Great tutorial, It'll definitely help lot of people who are curious about how to color their Server names.
 
SRB2Kart introduces more text color maps for scripters to play, and that means more color codes are now being used.
I edited the main post.
Have fun!

but please don't dissapoint everybody with questionable color choices
 
2.2 has changed it and the colors aren't the same, I recently realized the character listed as Orange is now Pink...


Oops, didn't encode the file with ANSI!
 
Last edited:
it says it couldn't execute it

Such an error usually happens because SRB2 can't find the file you're trying to execute, not because it is encoded differently.
Make sure the file is somewhere SRB2 can access. Also that there are no typos in the filename and that you're entering the filename with the extension.
 

Who is viewing this thread (Total: 1, Members: 0, Guests: 1)

Back
Top