USaveGame Support

Hi,
I’m implementing the saving system for our games using USaveGame, would
UPROPERTY
TArray TArray (two-dimensional array)
UPROPERTY
TMap
be supported in future version?

Hi,

Basic support for TMap properties were added in CL# 2519223 and should be available in UE 4.8. They haven’t had a proper shakedown yet, and haven’t specifically been tested with USaveGame, but as USaveGame uses standard serialisation, there should be no problems.

Containers of other containers are fundamentally unsupported by the UProperty system, so your TArray of TArray will not work. In this case, you should wrap your inner TArray in a USTRUCT like this:

USTRUCT()
struct MYPROJECT_API FMyInnerArray
{
    GENERATED_BODY()

    UPROPERTY()
    TArray Array;
};

UCLASS()
class MYPROJECT_API UMySaveGame : public USaveGame
{
    GENERATED_BODY()

    UPROPERTY()
    TArray ArrayOfArrays;
}

Hope this helps,

Steve

Hi,

We think this post contains useful information which we would like to share with our public UE4 community. With your approval, we would like to make a copy of this post on the public AnswerHub which includes the discussion but strips out your username and company name. Please let us know if you are okay with this.

Thanks!

Thanks a lot, this make us great help.

No problem, you can do this. Hope it can help others.