This is my problem, I have a SaveGame class where I want to store an array of structs defined by me:
USTRUCT()
struct FNameData{
DEGENERANTE_USTRUCT_BODY()
TCHAR name[32];
bool value;
};
I got this in my header:
UPROPERTY(VisibleAnywhere, Category = Basic)
INT32 actualDataValue;
UPROPERTY(VisibleAnywhere, Category = Basic)
FNameData Values[SIZE_OF_SLOTS];
And when I save the game it saves the actualDataValue but it doesn’t saves my Values array.
I also tried to use TArray, TMap but they dont’t work neither.
Please I need help with this.
This is the header of my SaveGame class:
UCLASS()
class URGBoolSaving : public USaveGame
{
GENERATED_UCLASS_BODY()
UPROPERTY(VisibleAnywhere, Category = Basic)
uint32 UserIndex;
UPROPERTY(VisibleAnywhere, Category = Basic)
FString SaveSlotName;
UPROPERTY(VisibleAnywhere, Category = Basic)
INT32 actualDataValue;
UPROPERTY(VisibleAnywhere, Category = Basic)
FNameData Values[SIZE_OF_SLOTS];
UFUNCTION(BlueprintCallable, Category = "SaveGame")
void setBool(FString name, bool value);
UFUNCTION(BlueprintCallable, Category = "SaveGame")
//Fill the value parameter, and returns true if the name
//exists or false if not
bool getBool(FString name, bool &value);
UFUNCTION(BlueprintCallable, Category = "SaveGame")
//Fill the value parameter, and returns true if the name
//exists or false if not
void restartSaveState();
private:
//This function searches the value of the given name, if it doesn´t exists, return -1
int findValue(FString name);
};