Contents |
Cvars are the configuration variables used by tremulous to control all aspects of the operation of the client and server. From the console you can use the set command to set the value of a cvar. Each cvar is also registered as a command of its own, so once a cvar is created you can use /cvarname to get or set its value. For example:
]/set testcvar hello ]/testcvar "testcvar" is:"hello", the default ]/set testcvar world ]/testcvar "testcvar" is:"world" default:"hello"
All cvars have a default value stored. For user defined values this is the first value it was set to, and system cvars have a predefined default. A cvar can be reset to its default value with the reset command.
Some cvars are latched. This means that when you change its value, the new value is remembered but the cvar isn't changed. The cvar will then be changed upon a set event happening, such as the graphics engine being restarted. When you set a latched cvar, a message is printed 'r_mode will be changed upon restarting.'. In this case the command vid_restart will cause the new value to be used.
Some cvars are readonly. These are set by the game itself, and are for giving access to certain information. For example, sv_cheats can not be directly set but can be read to see if cheats are enabled. Some cvars are set readonly shortly after the game starts, so their value can be set at startup, such as dedicated or net_port.
Some cvars are cheat protected. This means you can't change their values unless the server you are connected to has cheats enabled (sv_cheats 1). These values are mainly debugging settings useful to developers / mappers that can be used to gain unfair advantage in game.
Some server cvars are sent to the client upon request. These include things such as the servername and rule information such as friendly fire status. A cvar can be set a serverinfo using the sets command. These values can be seen by clients from the "server information" dialog in the server browser.
Userinfo cvars are like serverinfo, except sent by the client to the server upon joining, containing things such as your name. All cvars that the server will respond to are already set to be userinfo. A cvar can be set as userinfo via the setu command.
Most cvar names have a prefix that specifies what system it is related to.
| Prefix | Subsystem | Examples |
|---|---|---|
| r_ | Renderer | r_mode, r_gamma |
| cl_ | Client | cl_autoRecordDemo |
| cg_ | cgame | cg_drawGun, cg_tutorial |
| g_ | game | g_allowVote, g_friendlyFireHumans |
| sv_ | server | sv_hostname, sv_pure |
| s_ | Sound | s_volume, s_muteWhenMinimized |
| net_ | Network | net_port, net_ip |
| com_ | Common | com_maxfps, com_ansiColor |
| ui_ | UI | ui_browserShowEmpty, ui_hideCursor |
| fs_ | File System | fs_debug, fs_homepath |
| in_ | Input | in_mouse, in_nograb |