How to stop local custom INI files being deleted after play

I have a custom class that uses a custom config file type.

My UCLASS is set up as UCLASS(BlueprintType, Config=“ClassConfig”), and I’m calling LoadConfig() in the constructor, and if WITH_EDITOR saving the default config when a property changes.

So far so good. The values of the properties that are marked as config get loaded from DefaultClassConfig.ini, or Saved\Config\WindowsEditor\ClassConfig.ini

But if I’ve overridden the Defaults with a local ClassConfig.ini and then play in editor, or standalone, or package a build and override and play, the overridden ini gets loaded correctly, but as soon as I close the editor, or shut down the game, the local ini gets deleted.

What am I missing to stop this from happening? I kind of need to keep the override inis around in a packaged build.

Okay, I figured this out.

In order to keep an overridden custom ini file from being deleted after it’s loaded, you either have to have ‘User’ as part of the config name (i.e. instead of UCLASS(BlueprintType, Config=“ClassConfig”) it should be UCLASS(BlueprintType, Config=“UserClassConfig”)), or you have to put

[SectionsToSave]
bCanSaveAllSections=true

in the Base or Default config.

Would’ve been super cool if this information were in the Config file documentation.

4 Likes

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.