Color Codes

From Oldunreal-Wiki
Jump to: navigation, search

If you want to use colorized strings, 227 has 2 new functions:

static native final function StripColorCodes( out string S ); // Strip color codes from a string

static native final function string MakeColorCode( color Color ); // Make a color code string


Example:

local string S; S = MakeColorCode(MakeColor(255,0,0))$"Red "$MakeColorCode(MakeColor(0,255,0))$"Green "$MakeColorCode(MakeColor(0,0,255))$"Blue"; StripColorCodes(S);


To use that for a servername it works like that:

[Engine.GameReplicationInfo] ServerName= <put colorcode here> Name of Server

[ASCII 27][ASCII red_value][ASCII green_value][ASCII blue_value]

Each color change code consists of four characters.

1. ASCII character 27 (Esc)

2. Amount of Red from 1-255

3. Amount of Green from 1-255

4. Amount of Blue from 1-255


So, Red would be (027)(255)(001)(001) and Blue would be (027)(001)(001)(255).

You can use programs such as Gimp or UED of course to determine the RGB values of any color you like.


Here are some tools making the work for you:

http://www.oldunreal.com/tools/ServerColor.zip

http://www.oldunreal.com/tools/ut2k4mc2_inst.zip

Note that these tools have not been designed for Unreal, they are from UT2k4 but they will produce what you need, the only thing you want to do is to copy the colorcodes.