benilla-re systems structs docs

s_scriptCvarCount

global · ui

Address
0xb4e3c8 · 4 bytes, up to 0xb4e3cb
Type
uint32_t
Meaning
Holds the number of CVars RegisterCVar has registered; the 31st is refused
Confidence
verified, proof one
Finding
ui/cvarverbs#registering-cvars-from-lua

Finding: Registering CVars from Lua in ui: CVar, option and engine information verbs

RegisterCVar("name" [, default]) registers a script CVar: a new name gets flags 0, category 9 and the default text, or 0; the thirty-first registration raises Attempted to register too many CVars. It looks the name up with the script lookup, which does not see an engine CVar that is hidden from scripts, so such a CVar counts as new. CVar::Register then finds the existing record, sets its bit 31 and clears its callback, which hands that CVar to scripts and silences its change callback. The script lookup is cvar/registry#lookup, the registration cvar/registry#registering-a-setting.

The derivation is in the doc.