NeoSettingsDocsNeo Async Loading Screen
CustomizeDrivers

Drivers

A driver is how a setting reaches the game: the plugin's own drivers set the window mode, the scalability groups, the camera's field of view, the sound classes... A setting of yours can be connected to your game in four ways, from the simplest:

On this page
  1. bind reflect (no C++ registration)
  2. A C++ driver
  3. Then in a recipe
BindingWhat happensUse it for
bind store (the default)The value is stored and saved; your game reads it (Get Setting, On Setting Changed)Anything your code already reads at the right time
bind cvar <name>The value writes a console variableEngine or game variables
bind reflect "<class>" get <Getter> set <Setter>The plugin calls a getter and a setter (UFUNCTIONs) of one of your subsystemsBlueprint-friendly, no C++ registration
bind driver <name>Your C++ driver reads and applies the value, and can hide or gray the settingFull control: availability, reasons, options known at run time, per player

With a binding other than store, the plugin reads your game's value as the setting's default (when the recipe gives none), applies the player's choice at startup and on every change, saves and exports it, and reads it again to notice changes made outside the menu.

bind reflect (no C++ registration)

Recipe
page gameplay {
    choice difficulty "Difficulty" {
        bind reflect "/Script/MyGame.MyGameSettingsSubsystem" get GetDifficulty set SetDifficulty scope gameinstance
        options { easy "Easy"; normal "Normal"; hard "Hard" }
    }
}

scope says where the subsystem lives: engine, gameinstance, localplayer (each split-screen player then has their own value) or world. Extra param=value fill other parameters of the setter. Only your project's own recipes may use reflect; recipes from mods may not.

A C++ driver

Implement INeoSettingsDriver (NeoSettingsDriver.h):

C++
#include "NeoSettingsDriver.h"

// A recipe binds a setting to it like to a built-in driver:
//     choice difficulty "Difficulty" { bind driver mygame.difficulty; options { easy "Easy"; normal "Normal"; hard "Hard" } }
class FMyDifficultyDriver : public INeoSettingsDriver
{
public:
    virtual FName GetName() const override { return TEXT("mygame.difficulty"); }

    virtual FNeoSettingsValue Read(const FNeoSettingsDriverContext& Context) const override
    {
        // The game's current value: the setting's default when the recipe gives none.
        FNeoSettingsValue Value;
        Value.Type = ENeoSettingsValueType::String;
        Value.String = Difficulty;
        return Value;
    }

    virtual bool Apply(const FNeoSettingsDriverContext& Context, const FNeoSettingsValue& Value) override
    {
        if (Value.Type != ENeoSettingsValueType::String)
        {
            return false; // refused: the menu shows Read again
        }
        Difficulty = Value.String; // apply it to your game here
        return true;
    }

    virtual FText GetDisabledReason(const FNeoSettingsDriverContext& Context) const override
    {
        // Not empty: the row is grayed with this reason.
        return bInMission ? NSLOCTEXT("MyGame", "DifficultyLocked", "Change the difficulty between missions.") : FText::GetEmpty();
    }

private:
    FString Difficulty = TEXT("normal");
    bool bInMission = false;
};

Register it from your module (or later: settings bound to a name nobody registered yet stay stored and are applied when it arrives):

C++
class FMyGameModule : public FDefaultGameModuleImpl
{
public:
    virtual void StartupModule() override
    {
        // Settings bound to the name before it is registered stay stored and are applied when it arrives.
        NeoSettingsRegisterDriver(MakeShared<FMyDifficultyDriver>());
    }

    virtual void ShutdownModule() override
    {
        NeoSettingsUnregisterDriver(TEXT("mygame.difficulty"));
    }
};
FunctionCalledReturn
GetNameOnceThe name recipes bind to: your game's prefix and a dot (mygame.difficulty)
ReadAt startup, and again to notice outside changesThe game's value (Type None when unknown)
ApplyAt startup and on each changefalse when the game refused the value (the menu shows Read again)
IsAvailableWhen the menu is builtfalse hides the settings bound to it (feature absent on this platform)
GetDisabledReasonWhen the menu is builtA reason grays the setting ("Change the difficulty between missions.")
GetOptionsFor options from <driver name>The options of a choice known at run time
IsPerPlayerOncetrue: applied for each local player (Context.LocalPlayer), again when the player's controller changes; each split-screen player keeps their own value
IsEditorSafeOncetrue: applied in Play In Editor while Editor Apply is Safe Only
EndBatchAfter a batch of Apply calls (startup, a preset, an import)Apply costly changes once here

Values use the setting's type: Bool for a toggle, Number for a slider, String (the option id) for a choice. Context.Param(Name) reads the binding's parameters (bind driver mygame.difficulty scale=2). Drivers run on the game thread.

In the editor. The Setup tab and the Project Settings preview draw the menu with the same drivers and no game running: IsAvailable, GetDisabledReason, Read and GetOptions may be called with no game world and a null Context.LocalPlayer, before your subsystems exist. Answer what you can without them, and return Type None from Read when you cannot. Apply is never called there.

Replacing a built-in driver. Registering a driver under a built-in name (camera.fov...) replaces it, with a warning in the log; unregistering it gives the built-in back.

Then in a recipe

Recipe
page gameplay {
    section difficulty "Difficulty" {
        choice difficulty "Difficulty" {
            bind driver mygame.difficulty
            options { easy "Easy"; normal "Normal"; hard "Hard" }
        }
    }
}

Known issue in this version: the recipe check knows only the plugin's drivers, so the Message Log reports this line as warning HS412 ("unknown driver") at each load. The setting works once your driver is registered (it stays hidden, its saved value kept, until then).

See Recipes for every built-in driver and binding.

Something not as described? Every code the editor shows has its own entry in Troubleshooting.