CVARINFO

From ZDoom Wiki
Jump to: navigation, search

(New from 2.7.1)

CVARINFO is a lump for defining custom, mod-specific CVARs. The syntax is as follows:

<scope> [noarchive] <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 one tic later.
    • user — Each player has their own copy of this CVAR, which they can change independently. Changes to these variables are immediate.
  • noarchive: If present, it prevents the CVAR from being written to the configuration file.
  • type: The data type of the CVAR's value, which can be one of the following:
    • int — An integral 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.

Example

This creates an integral 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;

See also