Choose your operating system:
Windows
macOS
Linux
Module |
|
Header |
/Engine/Source/Runtime/Core/Public/HAL/IConsoleManager.h |
Include |
#include "HAL/IConsoleManager.h" |
enum EConsoleVariableFlags
{
ECVF_FlagMask = 0x0000ffff,
ECVF_Default = 0x0,
ECVF_Cheat = 0x1,
ECVF_ReadOnly = 0x4,
ECVF_Unregistered = 0x8,
ECVF_CreatedFromIni = 0x10,
ECVF_RenderThreadSafe = 0x20,
ECVF_Scalability = 0x40,
ECVF_ScalabilityGroup = 0x80,
ECVF_Preview = 0x100,
ECVF_SetFlagMask = 0x00ff0000,
ECVF_Set_NoSinkCall_Unsafe = 0x00010000,
ECVF_SetByMask = 0xff000000,
ECVF_SetByConstructor = 0x00000000,
ECVF_SetByScalability = 0x01000000,
ECVF_SetByGameSetting = 0x02000000,
ECVF_SetByProjectSetting = 0x03000000,
ECVF_SetBySystemSettingsIni = 0x04000000,
ECVF_SetByDeviceProfile = 0x05000000,
ECVF_SetByGameOverride = 0x06000000,
ECVF_SetByConsoleVariablesIni = 0x07000000,
ECVF_SetByCommandline = 0x08000000,
ECVF_SetByCode = 0x09000000,
ECVF_SetByConsole = 0x0A000000,
}
Name |
Description |
---|---|
ECVF_FlagMask |
Mask for flags. Use this instead of ~ECVF_SetByMask |
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. |
ECVF_ReadOnly |
Console variables cannot be changed by the user (from console). |
ECVF_Unregistered |
UnregisterConsoleObject() was called on this one. |
ECVF_CreatedFromIni |
This flag is set by the ini loading code when the variable wasn't registered yet. |
ECVF_RenderThreadSafe |
Maintains another shadow copy and updates the copy with render thread commands to maintain proper ordering. |
ECVF_Scalability |
ApplyCVarSettingsGroupFromIni will complain if this wasn't set, should not be combined with ECVF_Cheat |
ECVF_ScalabilityGroup |
Those cvars control other cvars with the flag ECVF_Scalability, names should start with "sg." |
ECVF_Preview |
CVars with this flag will be included in the device profile previews. |
ECVF_SetFlagMask |
Set flags |
ECVF_Set_NoSinkCall_Unsafe |
Use to set a cvar without calling all cvar sinks. Much faster, but potentially unsafe. Use only if you know the particular cvar/setting does not require a sink call. |
ECVF_SetByMask |
To get some history of where the last value was set by ( useful for track down why a cvar is in a specific state |
ECVF_SetByConstructor |
Lowest priority (default after console variable creation) |
ECVF_SetByScalability |
Set by scalability groups from Scalability.ini (lower priority than game settings so it's easier to override partially) |
ECVF_SetByGameSetting |
Default priority for engine-level game user settings, platform-specific settings will override this. |
ECVF_SetByProjectSetting |
Set by project settings UI or specific sections in ini file (higher priority than game setting to allow enforcing some settings for this project) |
ECVF_SetBySystemSettingsIni |
Used by the [ConsoleVariables] section of Engine.ini as well as FSystemSettings. |
ECVF_SetByDeviceProfile |
Per device settings using the DeviceProfiles.ini hierarchy (e.g. specific iOS device, higher priority than per project to do device specific settings) |
ECVF_SetByGameOverride |
User settable game overrides, used for GameUserSettings fields that need to override device specific settings. |
ECVF_SetByConsoleVariablesIni |
Set by local consolevariables.ini, mostly used for testing multiple projects. |
ECVF_SetByCommandline |
Used by some command line parameters, others use the Console priority instead. |
ECVF_SetByCode |
Used for high priority temporary debugging or operation modes. |
ECVF_SetByConsole |
Highest priority used via editor UI or or game/editor interactive console. |
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:
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, ..