Difference between revisions of "Color Codes"

From Oldunreal-Wiki
Jump to navigation Jump to search
Tag: New redirect
 
Line 1: Line 1:
If you want to use colorized strings, 227 has 2 new functions:
#REDIRECT [[Unreal v227 Manual/Server admin tools]]
 
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:
 
https://www.oldunreal.com/tools/ServerColor.zip
 
https://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.
 
[[Category:Scripting]]

Latest revision as of 20:41, 27 June 2022