Load Scene in AutoSaveLoad

Announcements, support questions, and discussion for Quest Machine.
Post Reply
GorkaGames
Posts: 178
Joined: Fri Sep 21, 2018 8:38 pm

Load Scene in AutoSaveLoad

Post by GorkaGames »

Hi Tony,

Regarding the "Load in Start" in AutoSaveLoad, it works fine when you have only one scene active and you want to load a new one (the one where it was the player before load)

But on my case I have a quite big terrain and my configuration is the following:
One scene called Manager Scene where I have all my game Managers, included Quest Machine and your Save Manager.
Additive scenes that are being loaded async (LoadSceneMode.Additive) so at one given time I can have lets say 3 scenes (The first manager and 2 additive with terrain + level)

How could I work with your system?
- Adding LoadSceneMode.Additive in savesystem.cs (row 282)? Is it enough? I mean I need to load additive more than 1 scene (the Manager one is always active on my game)
- Managing the load game on my own saving first my Scene Manager State with all the scenes loaded at save time? If so, how can I synchronize with the player loading position at start? I''m using your Opsive UCC2 integration.
GorkaGames
Posts: 178
Joined: Fri Sep 21, 2018 8:38 pm

Re: Load Scene in AutoSaveLoad

Post by GorkaGames »

Ok, testing I think the correct scenes get loaded.
BUT , as the terrain scene and level scene start loading when detect that the player is into the trigger (my scene manager loads and unloads scenes when the player enters / exits the trigger areas) the player falls into the abyss as Quest Machine Saver positions the player and only afterwards the trigger is detected and my Manger loads (Async) the terrain and level.
Any ideas? I should implement some system that avoids that. Loading is not fast enough to have my character on the ground.
User avatar
Tony Li
Posts: 21925
Joined: Thu Jul 18, 2013 1:27 pm

Re: Load Scene in AutoSaveLoad

Post by Tony Li »

Hi,

Can you turn off the player's gravity or freeze its position until the async is done?

Code: Select all

GetComponent<Rigidbody>().useGravity = false;
...
GetComponent<Rigidbody>().useGravity = true;
or

Code: Select all

GetComponent<Rigidbody>.constraints = RigidbodyConstraints.FreezePositionX | RigidbodyConstraints.FreezePositionY | RigidbodyConstraints.FreezePositionZ;
...
GetComponent<Rigidbody>.constraints = RigidbodyConstraints.None;
GorkaGames
Posts: 178
Joined: Fri Sep 21, 2018 8:38 pm

Re: Load Scene in AutoSaveLoad

Post by GorkaGames »

It worked, thanks. It's different in Opsive as it's a Deterministic /Kinematic controller and you can't modify directly the Rigibody, you need to call his own methods.
Also I had to control that ALL the scenes had loaded before activate it again.

Thanks!
User avatar
Tony Li
Posts: 21925
Joined: Thu Jul 18, 2013 1:27 pm

Re: Load Scene in AutoSaveLoad

Post by Tony Li »

Complicated! I'm glad it's working now.
Post Reply