Cvars

From QuakeQEWiki
Revision as of 11:05, 19 February 2022 by JPiolho (talk | contribs) (Added flags table)
Jump to navigation Jump to search

Cvars are variables that can be read or set via the in-game console. Cvar stands for Console Variable. Each cvar has a name, description, type and some flags associated with it

Flags

Each cvar has a bunch of flags associated with it. It tells the engine a bunch of information like type and what it should do with them. Not all flags are known at the moment.

Flag Description
1 (0x01) Type: Boolean
2 (0x02) Type: Integer
4 (0x04) Type: Float
8 (0x08) Type: String
16 (0x10) Saved (The cvar will be saved to the user config)
32 (0x20)
64 (0x40) Hidden (The cvar will not appear in the console auto-complete)
128 (0x80)
256 (0x100)
512 (0x200)
1024 (0x400)
2048 (0x800)
32768 (0x8000)
65536 (0x10000)

Quake-C

It is possible to interact with these variables from Quake-C, however in vanilla QC there is some limitations. For example, being only able to read numeric values.

Use the following builtins to read and set cvars:

Cvar

Cvar_set

You can also set cvars using Localcmd, which will allow you to concatenate strings together.

See also

List of cvars