sinbad / SPUD

Steve's Persistent Unreal Data library
MIT License
308 stars 45 forks source link

Actors spawned on sublevels #20

Closed shoooxz closed 2 years ago

shoooxz commented 2 years ago

Hey, I am wondering how works actor spawned on sublevels by 'Owner' property. As I see it looks very good, yet i have noticed that they are considered as 'guid' actors, simillar to runtime actors. Is this approach is considered as good ? Everything actually works great, in editor I see them after load as sublevel-actors. Thanks and Regards

sinbad commented 2 years ago

Any actor which is dynamically spawned in code rather than being loaded from a level is considered a runtime object, it doesn't matter who owns it. Property references from owner to spawned object will be restored if they're marked SaveGame.

The only time this potentially becomes a problem is if actors move between sub levels, because SPUD saves/restores based on what streaming level the runtime actor is associated with. I haven't had to deal with that case yet, typically if it's the player state it's global anyway, and other actors tend to remain inside their streaming areas. You would probably have to special case other actors which can roam more freely, making them global state instead like the player state.