Struct not serializing to savefile
Fixing all my rookie mistakes, there's still issues with serialization/de-serialization of more complex data structures it seems. Attaching debugger to PreSaveGame and PostLoadGame it's clear that they're present on save but not present on load
I've set the specifier for it 🤔
SavedSeed and SavedAlreadySpawned are int32 and bool respectively with similar setups and these work properly
Solution:Jump to solution
In case you haven't solved this yet, the uproperties in the struct must be marked as savegame too
3 Replies
Struct definition
This is essentially the list of all the resource nodes in the world that I'd like to spawn, with randomization already applied to it.
Instead of storing this struct, which is used to spawn the actors/meshes/etc for nodes, I guess I could serialize the actors in some way, although I'm not yet sure how to do that yet - I would assume it's more or less equivalent as actors read from savefile still must be respawned in some fashion.
The disadvantage of this way is that I have to re-associate miners/etc with nodes on load as well I believe, since each time it loads they're new entities. I assume there is some way to save some kind of reference between miners/actors for instance.
I just don't know if it's worth to try a different way that will likely require a similar data structure when I can't get this to work in the first place.
Solution
In case you haven't solved this yet, the uproperties in the struct must be marked as savegame too
Well that is easy, thank you