Closed fayth777 closed 2 years ago
Warning: I'm on a break over the holidays so this is entirely from memory, on my phone :)
There won't be a pre/post restore the first time the level is streamed simply because there is no data being restored.
Ordering on Begin Play is generally unreliable. However, you can tell whether SPUD is in the middle of a load process (see SpudSubsystem's IsLoading IIRC?) which you can use to tell whether you're going to get a subsequent post-restore call on a stored object. That might help you resolve your duplicate cases.
Hey, thanks for the reply! I don't want to bother you too much but when you have time could you suggest what to use instead of begin play for actors on sub level to know that it will be done after data and level is loaded every time the level is streamed in no matter if the data was there or not? Or is checking for isLoading what you would do?
You can either check IsLoading or determine from your own state (or add a "bIsInitialised" flag) to know when you've already done it. But the core problem might be that you have overlapping responsibilities - state that is both loaded and manually initialised. If possible, move the default state to the constructor instead, or if you can't do that, make whatever it is you're doing safe to do more than once regardless of initialisation route (that's the most robust and can help you with other sequences too like resetting)
Ok got it, once again thank you very much!
Hello! Thank you for your work and the great system you have provided. I've been testing your system with streaming levels and saves and I've noticed some things which could cause potential problems in the future and was wondering if you could help.