Colored Server Name in Killing Floor: ServerColor and ServerColorMut
In the Killing Floor server browser, the server name and map name can be shown in any colors. This page is based on the thread "Server Color (Цветное название сервера)" (Server Color, colored server name) on the killingfloor.ru forum (w.a.l, with additions by Flame, 2013); the section on Russian text in server messages comes from the thread "ServerAdsSE на выделенном сервере" (ServerAdsSE on a dedicated server, 2011).
ServerColor
The mutator has three parts:
ServerColor.exe- a program where you type the name and place the colors;ServerColor.ini- the settings;ServerColor.u- the package itself.
Steps:
- Run
ServerColor.exeand type the server name. You can put a color code before every single letter if you like: a color applies to the text that follows the code. ServerColor.inihas just two lines. Paste the name copied from the program intoServerName=, and any color code from the same program intoMapColor=. That is the color of the map name.- Load the package as a server actor: in
KillingFloor.ini, in the[Engine.GameEngine]section, add the line
ServerActors=ServerColor.ServerColor
The color codes belong to the Unreal engine and work in any game built on it. You can also put them into other strings shown by the server browser. For example, the author had a colored AdminEmail= in KillingFloor.ini, and in ServerPerks he colored a line of the server info:
ServerState.ServerInfo.Length = l+1;
ServerState.ServerInfo[l].Key = "Veterancy Handler";
ServerState.ServerInfo[l].Value = "@шш[W.A.L]Perks";
Here @шш is a color code typed in ServerColor.exe; in a normal editor it looks like random characters.
The "UT2004 Server Color" variant
An earlier killingfloor.ru forum thread, "colored HostName" (2010), carried a translation of a guide from the Tripwire forum for the "UT2004 Server Color" build, where the steps differ slightly (Terrorist495):
- Run
ServerColor.exe, press the Global button in the top right corner and type the server name in the text field below. - Pick a color on the color bar at the very top, then the color to apply to the name, and press the select button to the right of the color chart. Keep inserting colors and pressing Test, which shows a preview at the bottom, until you get the result you want.
- Press save and then the UFile button in the top right corner. Three files are saved into the ServerColor folder:
ServerColor.u,ServerColor.uclandServerColor.ini. Put all three into the server'sSystemfolder. - In the
[Engine.GameEngine]section ofKillingFloor.iniadd the line below (the author put it right aboveServerPackages=Core) and restart the server:
ServerActors=ServerColor.ServerColorActor
According to participants, the name is shown in color in Favorites as well (almazhead), kok-s found the display in Steam fine too, while GameTracker showed garbled characters instead of colors (GreeN).
How a color code works
If ServerColor.exe does not offer the color you need, you can build the code by hand (Flame's explanation): first comes the character with code 1B, then three bytes for R, G and B. For example, 1B 6D 3E D3 is the color R=6D, G=3E, B=D3. Any HEX editor is handy for picking the characters. The same trick for mutator names and descriptions is covered in Creating mutators.
ServerColorMut: wave, time and monsters in the name
Some servers showed the play time, wave number and monster count in their names. At forum members' request Flame wrote the ServerColorMut.ServerColorMut mutator: it colors the server and map names and appends that information. Variables are set in ServerColorMut.ini:
| Variable | What it sets |
|---|---|
ServerName | Color and text of the server name |
MapColor | Color of the map name |
WaveColor | Color of the wave number (if no color is set, the wave number is not shown) |
WavePrefix | Prefix before the wave number, for example Wave= |
TimeColor | Color of the time since the game started (if not set, the time is not shown) |
TimePrefix | Prefix before the time, for example Time= |
MonsterColor | Color of the number of remaining monsters (if not set, not shown) |
MonsterPrefix | Prefix before the monster count, for example M= |
NotStartedColor | Color of the text shown before the game starts (if not set, not shown) |
NotStartedPrefix | Text shown before the map starts, for example Waiting Players |
If ServerName in the ini is empty, the regular ServerName from KillingFloor.ini is shown in white. The browser info refreshes roughly every 10 seconds. The author himself called the implementation rough and suggested editing the ServerColorInfo class to adjust the details.
Source code (three classes):
class ServerColorMut extends Mutator config(ServerColorMut);
var config string ServerName;
var config string MapColor;
var config string WaveColor;
var config string WavePrefix;
var config string TimeColor;
var config string TimePrefix;
var config string MonsterColor;
var config string MonsterPrefix;
var config string NotStartedColor;
var config string NotStartedPrefix;
var ServerColorActor SCA;
function PostBeginPlay()
{
SCA = Spawn(class'ServerColorActor');
}
class ServerColorActor extends Info;
var GameRules GRules;
function PostBeginPlay()
{
GRules = Spawn(class'ServerColorInfo');
if(Level.Game.GameRulesModifiers == none)
Level.Game.GameRulesModifiers = GRules;
else
Level.Game.GameRulesModifiers.AddGameRules(GRules);
super(Actor).PostBeginPlay();
}
class ServerColorInfo extends GameRules;
function GetServerDetails(out GameInfo.ServerResponseLine ServerState)
{
local string sTemp;
local int waveNum;
local int monsterNum;
local int elapsedTime;
local KFGameReplicationInfo KFGRI;
KFGRI=KFGameReplicationInfo(Level.GRI);
waveNum=KFGRI.WaveNumber + 1;
elapsedTime=KFGRI.ElapsedTime;
monsterNum=KFGRI.MaxMonsters;
// Server name: if set in the ini, use the colored one from there
if(class'ServerColorMut'.default.ServerName != "")
ServerState.ServerName = class'ServerColorMut'.default.ServerName;
else // otherwise ServerName from KillingFloor.ini in white
ServerState.ServerName = Level.Game.GameReplicationInfo.ServerName;
// If a map color is set, color the map name
if(class'ServerColorMut'.default.MapColor != "")
{
sTemp = ServerState.MapName;
if(Left(sTemp, 1) != "")
{
sTemp = class'ServerColorMut'.default.MapColor $ sTemp;
ServerState.MapName = sTemp;
}
}
// Wave number: color + prefix + value
if(class'ServerColorMut'.default.WaveColor != "")
{
sTemp = class'ServerColorMut'.default.WaveColor$class'ServerColorMut'.default.WavePrefix$waveNum;
if (Level.Game.GetStateName() == 'MatchInProgress')
ServerState.ServerName @=sTemp;
}
// Time since the map started
if(class'ServerColorMut'.default.TimeColor != "")
{
sTemp = " " $ class'ServerColorMut'.default.TimeColor$class'ServerColorMut'.default.TimePrefix$GetTimeString(elapsedTime);
if (Level.Game.GetStateName() == 'MatchInProgress')
ServerState.ServerName @=sTemp;
}
// Number of remaining monsters
if(class'ServerColorMut'.default.MonsterColor != "")
{
sTemp = " "$class'ServerColorMut'.default.MonsterColor$class'ServerColorMut'.default.MonsterPrefix$monsterNum;
if (Level.Game.GetStateName() == 'MatchInProgress')
ServerState.ServerName @=sTemp;
}
// Text shown while the game has not started
if (class'ServerColorMut'.default.NotStartedColor != "")
{
sTemp = " "$class'ServerColorMut'.default.NotStartedColor$class'ServerColorMut'.default.NotStartedPrefix;
if(Level.Game.GetStateName() != 'MatchInProgress')
ServerState.ServerName @=sTemp;
}
}
function string GetTimeString(int seconds)
{
local int cMinutes,cSeconds;
local string result;
cMinutes=seconds / 60;
cSeconds=seconds % 60;
if(cMinutes<10)
result$="0";
result$=string(cMinutes);
result$=":";
if(cSeconds<10)
result$="0";
result$=string(cSeconds);
return result;
}
How to add a mutator to the server is covered in How to add a mutator to the server.
Russian text in server messages (ServerAdsSE)
The ServerAdsSE mutator shows messages to players, such as the server rules. If you write them in Russian in KillingFloor.ini, the game shows garbage characters instead of letters. The fix from the thread "ServerAdsSE на выделенном сервере" (LLIePLLIeHb):
- Save
KillingFloor.iniin Unicode (UCS-2) encoding. - Mark the file read-only. Without that the server re-saves the ini as ANSI on startup and the Russian text breaks again.
- When you need to add a mutator or a map, clear the read-only flag, start the server so it writes the changes into the ini itself, then re-save the file as Unicode and set read-only again.
Changes made through WebAdmin still apply, but they are lost after a server restart because the ini is write-protected.
The color of the center-screen messages in ServerAdsSE is set by a line such as cAdminMsgColor=(B=0,G=0,R=255,A=127).
Installing ServerAdsSE
From the thread "Server Ads KF (Авто-сообщения в чате игры)" (Server Ads KF, automatic in-game chat messages; kok-s). ServerAdsSE is a chat bot: it posts server messages to the chat and admin messages in the center of the screen, and it can also be configured through the web admin.
- Move the
ServerAdsSEandwebfolders to the server root folder, andServerAdsSE.utoSystem. - In
KillingFloor.ini, section[Engine.GameEngine], addServerActors=ServerAdsSE.ServerAdsSE. - In the
[UWeb.WebServer]section, add the lines below. Use the index[2]whenApplicationsandApplicationPathslines already exist.
Applications[2]=ServerAdsSE.WebAdmin
ApplicationPaths[2]=/ServerAdsSE
- Add a section with your messages to
KillingFloor.ini:
[ServerAdsSE.ServerAdsSE]
bEnabled=True
fDelay=20.000000
sLines[0]=This is the first message!
sLines[1]=And this is the second message!
sLines[2]=#This is an Admin Message in the center of the Screen!
iAdType=0
iGroupSize=1
bWrapAround=True
iAdminMsgDuration=5
cAdminMsgColor=(B=0,G=255,R=0)
The author's notes: he could not get more than 24 messages to show; admin messages start with a #; for Russian letters KillingFloor.ini must be saved as UCS-2 Little Endian (w.a.l adds that UTF-8 will not work). According to w.a.l, the color codes from ServerColor.exe (see above) also work in regular ServerAdsSE messages, but not in admin messages.