Config values resetting

I’m currently struggling with an issue regarding config files. I have a config value in my character which is storing in the game config. I have an options setting which can adjust the value and it saves correctly, when I quit the program and check the config, the value has been changed accordingly. However when I re-open the program the value resets, to whatever the value was in the editor before I packaged it into a game.

I’ve tried checking throughout my code and I don’t see anywhere where I am somehow resetting the config value, at some point when opening the program, the value is either resetting, or not getting updated to the value that is currently in the config file.

At what point are config values set to whatever the contents of the config file contains? I’ve tried checking the documentation but it doesn’t state specifically at what point they get loaded.

I’m not familiar with editing config values myself so please bare with me, but what particular setting are you trying to change? Is it something that is part of DefaultEngine.ini or something similar? Also, can you post the code where you’re setting this value? Any details you can provide would be helpful.

The value itself is to store language:

UPROPERTY(Config, EditAnywhere, BlueprintReadWrite)
FString LanguageSetting;

In this class:

UCLASS(Config=Game)
class AGameCharacter : public ACharacter
{
    ...

The config value gets correctly stored in the game.ini but the language setting value seems to not be grabbing the value saved in the .ini when the game starts up (that’s my best guess). I quit the game, check the .ini and the language is “french” let’s say, as soon as I start up the game again and I call my set language function to read from the config value in player, it says the value contains “english”. My only guess is that I’m trying to use the config value before it’s being loaded in by the engine (that might be a ridiculous assumption) I’m doing it on HandleMatchHasStarted in GameMode.

Are you writing to your own .ini and not directly to one of the engine/project specific ones? If so, you’ll need to read that data manually and set it to the variable. It won’t be automatically read at any point. This will also allow you to determine when it is read, such as just before the call to use it in HandleMatchHasStarted.

After struggling with this issue for literally weeks, I found out the same answer your just stated on my own, mere minutes before you posted this response -.- very good to have my suspicions confirmed though. Thanks a lot!