Is it possible to store a TArray or a Struct values[128] in a SaveGame?

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);
};

You actually have to flag your properties in the struct itself as UPROPERTY(Category = Basic) in order for the struct to be serialized to the SaveGame. If there’s no UPROPERTY with the Basic-Category in the Struct, the struct gets omitted from being serialized and so does the full Array in the SaveGame Class itself. You have to flag both the TArray-Property in your SaveGame-Class as well as the properties inside of the Struct.

Since this question is really old I don’t think that I’ll actually reach the OP but I wanted to answer anyway in order for anyone stumbling over this problem like I did.

Hope this helps anyone :slight_smile: