CVARINFO is a lump for defining custom, mod-specific CVARs. The syntax is as follows:
<scope> [noarchive] [cheat] [latch] <type> <name> [= <defaultvalue>];
- scope: This can be one of the following:
- server — This CVAR is shared by all players, and in network games, only select players can change it. Changes to server CVARs will not be reflected until at-least one tic later (network games will make this length of time indeterminate).
- user — Each player has their own copy of this CVAR, which they can change independently. Changes to these variables are immediate.
- nosave — This CVAR is not saved to savegame and is not sent across network. Changes to these variables are immediate.
|Note: Server CVAR names must be no longer than 63 characters. While GZDoom 3.4 will refuse to load, prior versions will suffer issues with multiplayer.|
- noarchive: If present, it prevents the CVAR from being written to the configuration file.
- cheat: If present, the CVAR can only be modified by console if sv_cheats is enabled. ACS can still change these freely.
- latch: Changes to this CVAR only take effect upon starting a new game. This is only the case when changing it from the console, however.
- type: The data type of the CVAR's value, which can be one of the following:
- int — An integer value. Defaults to 0.
- float — A value that can include a fraction. Defaults to 0.0.
- color — A color value. Defaults to black ("00 00 00").
- bool — A boolean value that can hold either true or false. Defaults to false.
- string — A string value. It is not too useful for mods but is included for completeness. Defaults to "".
- name: The CVAR's name. It must begin with a letter and may only include alphanumeric characters and the underscore character.
- defaultvalue: The default value to be given to the CVAR, if desired.
This creates an integer CVAR with the name mymod_coolness. The CVAR is shared by all players. It has a default value of 10, and it is saved in the configuration file.
server int mymod_coolness = 10;