Console variable usage guide:
The variable should be creates early in the initialization but not before (not in global variable construction). Choose the right variable type, consider using a console command if more functionality is needed (see Exec()). Available types: bool, int, float, bool&, int&, float&, string Always provide a good help text, other should be able to understand the function of the console variable by reading this help. The help length should be limited to a reasonable width in order to work well for low res screen resolutions.
Usage in the game console: <COMMAND> ? print the HELP <COMMAND> print the current state of the console variable <COMMAND> x set and print the new state of the console variable
All variables support auto completion. The single line help that can show up there is currently not connected to the help as the help text is expected to be multi line. The former Exec() system can be used to access the console variables. Use console variables only in main thread. The state of console variables is not network synchronized or serialized (load/save). The plan is to allow to set the state in external files (game/platform/engine/local). Bitmask 0x1, 0x2, 0x4, ..
| Enumerator |
|---|
| ECVF_FlagMask | |
| ECVF_Default | Default, no flags are set, the value is set by the constructor
|
| ECVF_Cheat | Console variables marked with this flag behave differently in a final release build. Then they are are hidden in the console and cannot be changed by the user.
|
| ECVF_ReadOnly | Console variables cannot be changed by the user (from console). Changing from C++ or ini is still possible.
|
| ECVF_Unregistered | UnregisterConsoleObject() was called on this one. If the variable is registered again with the same type this object is reactivated. This is good for DLL unloading.
|
| ECVF_CreatedFromIni | This flag is set by the ini loading code when the variable wasn't registered yet. Once the variable is registered later the value is copied over and the variable is destructed.
|
| ECVF_RenderThreadSafe | Maintains another shadow copy and updates the copy with render thread commands to maintain proper ordering. Could be extended for more/other thread. Note: On console variable references it assumes the reference is accessed on the render thread only (Don't use in any other thread or better don't use references to avoid the potential pitfall).
|
| ECVF_Scalability | |
| ECVF_ScalabilityGroup | |
| ECVF_Preview | |
| ECVF_GeneralShaderChange | |
| ECVF_MobileShaderChange | |
| ECVF_DesktopShaderChange | |
| ECVF_ExcludeFromPreview | |
| ECVF_SaveForNextBoot | CVars with this flag will be saved into local temp file for next boot after hotfixed. Normally use for feature switch which is too early, even before launching the hotfix http request Use it carefully with these constrains in mind:
- WARNING: This exposes the config to end user who could change it through the local temp file in shipping client, it's your responsibility to make sure client can't "legally" cheat through this type of CVar;
- For the first time get hotfixed, the value will change from default value during boot to the hotfixed value after the hotfix http request, so make sure caching it when boot if the logic doesn't support to change at runtime;
- When there is a new released game version, the saved local temp file of last version could still be there. So it will still got read once. Keep the logic work well with the old value, or remove the CVar if the old value no longer supported;
- It will only work for game client, not for dedicated servers which will be dynamically allocated on different server instances.
|
| ECVF_SetFlagMask | |
| ECVF_Set_NoSinkCall_Unsafe | |
| ECVF_Set_SetOnly_Unsafe | |
| ECVF_Set_ReplaceExistingTag | |
| ECVF_SetByMask | |
| ECVF_SetByConstructor | |
| ECVF_SetByScalability | |
| ECVF_SetByGameSetting | |
| ECVF_SetByProjectSetting | |
| ECVF_SetBySystemSettingsIni | |
| ECVF_SetByPluginLowPriority | |
| ECVF_SetByDeviceProfile | |
| ECVF_SetByPluginHighPriority | |
| ECVF_SetByGameOverride | |
| ECVF_SetByConsoleVariablesIni | |
| ECVF_SetByHotfix | |
| ECVF_SetByPreview | |
| ECVF_SetByCommandline | |
| ECVF_SetByCode | |
| ECVF_SetByConsole | |