sinbad / SPUD

Steve's Persistent Unreal Data library
MIT License
337 stars 51 forks source link

Support saving nested UObjects #6

Closed sinbad closed 3 years ago

sinbad commented 3 years ago

This feature supports saving/loading plain UObject properties, not just Actor references. Arrays of them aren't supported for the same reason as custom struct arrays - providing backwards compatibility when arrays of nested structures change is too awkward right now (knowing the length in the data buffer is tricky).

UObjects are re-instantiated based on the property type when restoring if the property is currently null, otherwise the existing instance is re-populated. If you need to initialise the UObject with a subclass before loading, use the ISpudObjectCallback PreRestore hook on the parent object.

Nested UObjects get pre/post calls if they implement ISpudObjectCallback as well, but not the custom data or migration hooks.