URuntimeOptionsBase

[URuntimeOptionsBase](API\Runtime\Engine\Engine\URuntimeOptionsBase): Base class designed to be subclassed in your game.

Windows
MacOS
Linux

Inheritance Hierarchy

UObjectBase

UObjectBaseUtility

UObject

URuntimeOptionsBase

References

Module

Engine

Header

/Engine/Source/Runtime/Engine/Classes/Engine/RuntimeOptionsBase.h

Include

#include "Engine/RuntimeOptionsBase.h"

Syntax

class URuntimeOptionsBase : public UObject

Remarks

URuntimeOptionsBase: Base class designed to be subclassed in your game.

Supports checking at runtime whether features are enabled/disabled, and changing configuration parameters via console cheats or startup commands.

Add new config properties to your subclasses which default to the desired normal state This can be adjusted via the development-only tools (command line or cvar) or via an override in the config hierarchy to adjust it as needed (e.g., via a hotfix).

In non-Shipping builds, each property will be exposed both as a console variable and as a command-line argument for easy testing during development.

Debug console syntax (disabled in Shipping configurations): prefix.PropertyName Value Command line syntax (disabled in Shipping configurations): -prefix.PropertyName=Value DefaultRuntimeOptions.ini syntax (

that there is no prefix for these): [/Script/YourModule.YourRuntimeOptionsSubclass] PropertyName=Value Where the prefix is set by the value of OptionCommandPrefix (defaults to "ro" but can be overridden)

You can also change the name of the ini file that settings are gathered from in your derived UCLASS() declaration

Variables

Name Description

Protected variable

FString

 

OptionCommandPrefix

The command prefix for all options declared in a subclass (defaults to "ro", so a property named TestProp would be exposed as ro.TestProp)

Constructors

Name Description

Public function

URuntimeOptionsBase()

Functions

Name Description

Protected function

void

 

ApplyCommandlineOverrides()

Applies overrides from the command line.

Public function Static

const TRunti...

 

Get()

Returns the runtime options for the specified type, typically you will make a non-templated overload of Get in your subclass.

Protected function

void

 

InitializeRuntimeOptions()

Protected function

void

 

RegisterSupportedConsoleVariables

(
    bool bDuringReload
)

Overridden from UObject

Name Description

Public function Virtual

void

 

PostInitProperties()

Called after the C++ constructor and after the properties have been initialized, including those loaded from config.

Public function Virtual

void

 

PostReloadConfig

(
    FProperty* PropertyThatWasLoad...
)

Called from ReloadConfig after the object has reloaded its configuration data.

Help shape the future of Unreal Engine documentation! Tell us how we're doing so we can serve you better.
Take our survey
Dismiss