Hi all,
I’ve this problem, an UObject with an array member marked as config that is correctly initialized when game is played in editor. When I package the game and execute, the uobject array has always the elements that is written in the default config ini, completely ignoring the new entry written in the new package ini. This is strange because any other members different from an array, the package config ini values are loaded correctly.
Here is the object read in the config:
UCLASS(config=MyGameSetting)
class MY_GAME_API UMyGameSettings : public UObject
{
GENERATED_BODY()
public:
UMyGameSettings () {};
UPROPERTY(Config,BlueprintReadWrite, EditAnywhere)
TArray<FString> Connections;
UPROPERTY(Config, BlueprintReadWrite, EditAnywhere)
FString connection1;
};
Here DefaultMyGameSetting.ini with default config that is loaded also on package
[/Script/MYGameModule.MyGameSettings]
+connection="string1"
+connection="string2"
connection1="default1"
Here MyGameSetting.ini that is placed in the package
[/Script/MYGameModule.MyGameSettings]
+connection="stringNEW"
+connection="stringNEW2"
connection1="default2"
I’ve tried also using - . + ! as explained in Configuration Files | Unreal Engine Documentation but nothing worked.
The UMyGameSettings object is create in an actor constructor with this instructions:
settings = CreateDefaultSubobject<UMyGameSettings >(TEXT("SettingsObject"));
So repeating, executing the game with editor (or standalone with -game) load correctly the settings specified in DefaultMyGameSetting.ini.
Packaging and executing the package, load the array as specified in DefaultMyGameSetting.ini (at packaging time) and only the member connection1 as written in MyGameSetting.ini.
For now I’ve found a workaround by simply using a fixed number of plain Strings, but I would like to have this working as an array.
How could I resolve the issue?