Server Settings GUI

From Valve Developer Community
Jump to: navigation, search

The server settings pages for listen servers and for dedicated servers are editable through scripts.

Listen Server settings

The listen server settings page is scripted by cfg/settings_default.scr and cfg/settings.scr. The file which should be edited is settings_default.scr, as settings.scr is regenerated by the game/mod when the listen server dialog is used. However, if your mod uses AppID 320 (HL2DM) you may need to create a blank settings.scr file in your cfg directory so that the file from the Half-Life 2 Deathmatch GCF is not used.

Listenserverdialog.png

The .scr files are plain text scripts. It is highly recommended that you copy an existing script file from one of the GCF archives to edit rather than trying to create one from scratch.

Dedicated Server settings

The dedicated server settings page is scripted by scripts/GameServerConfig.vdf.

Dedicatedserverdialog.png

The .vdf file is also a plain text script, but as with .scr files, you will find it much easier to edit an existing file than to create a new one from scratch. Each setting in the .vdf file begins with the following structure:

"gamemode" //CVAR which this setting option controls
{
        "name"	"Game Mode" //Name displayed with this setting option, may be localized
	...

Following this block, a variety of "types" may be used.

The simplest one appears as a text box, where the user types in a string. It is denoted as follows:

	"type" "string"

No additional options are used with this type.


Another type is the drop down box, where the user is given several specific options to choose from. It is denoted as follows:

	"type" "enumeration"		
	"list"
	{
		"0" "Disabled"
		"1" "Enabled"
	}

This type uses the "list" structure to define each selectable option. Its syntax is "<CVAR Value>" "<Option Name>".

After the type and its options are defined, be sure to close the structure with an ending brace.

}