"Get Instanced Struct Value" doesn't get the value

I’m trying to use instanced structs to save my game.
I’m populating the instanced structs with different pre-defined structs containing variables from each of my actors that need “saving”.
I’m then storing those instanced structs in a Save Game Object.
Then, when I’m “loading”, I’m getting the instanced structs from the Save Game Object, and getting the save game data for each actor.
Debugging tells me the save game data is valid, but when I try to get the value it doesn’t work:


The SaveData variable here is of type Instanced Struct, and is being set in the parent:

This is the GetSaveData function:

That macro just gets a map from the Save Game Object (which is in the game instance), in which I have all the save game data organised.

Any help? Thanks.

think of instanced structs as a container, the container may be valid but the contents could be invalid OR of the wrong type.

my guess is your break is of the wrong contents type, but just a guess

1 Like

If I set the SaveData variable in the blueprint you see above, and then get it again immediately, without going through a Save Game Object, it works.

As you can see in the screenshot above, if SaveData is not valid, I set it to a F Save Data structure type.
When I “save”, I’m using another actor (like a save game manager in the level) to get the SaveData var from this actor and store it in a map, with the key being the GUID of the actor and the value being of type instanced struct, and then store that map in the Save Game Object.

When the level loads, each “saveable” actor on BeginPlay, gets its own SaveData from the Save Game Object, using its own guid to look it up in the map.

And, as you can see in the screenshot, I’m using the exact same type in the break node (F Save Data structure) as the one I used when I set it.
In short, the SaveData instanced struct is always set in the same actor I’m trying to get it in, with the same type, as you can see.

this isnt in the code above though? its possibly its a load order issue when beginplay fires before you’ve set the SaveData

1 Like

But how can that be if the SaveData var is valid, by the first node?
Also if I hover over it, while debugging, I can see it has the gameplay tag I used to set it.

Edit: I’ve updated the post to explain it better. Sorry about that.

i think this is pointless node, it could be telling you the container is valid OR that something is in it but maybe not what you expect. the second node already validates if its the right struct.

so my only guess is you have the wrong struct inside it. what does Lifts return?