Page 1 of 1

integrating save system with SECTR

Posted: Thu Jul 16, 2020 7:38 pm
by timbecile
Hey Tony,

I've set up SECTR on my outdoor scenes and have been using the save system in the Dialogue System to handle loading and saving.

Problem is that when I load a scene or load a save, the save system sets the player into the spawnpoint before the sectr loads. how do I integrate the two so I the sectr loads before the player is placed at the spawnpoint?

And on another topic, is there a way to set the player's rotation to the spawnpoints rotation?

Re: integrating save system with SECTR

Posted: Thu Jul 16, 2020 8:52 pm
by Tony Li
Hi,
timbecile wrote: Thu Jul 16, 2020 7:38 pmProblem is that when I load a scene or load a save, the save system sets the player into the spawnpoint before the sectr loads. how do I integrate the two so I the sectr loads before the player is placed at the spawnpoint?
How are you tying SECTR Stream into the save system? You can hook into SECTR's scene loaded event and manually call SaveSystem.ApplySavedGameData(). Or you can make a copy or subclass of Position Saver and modify it so it doesn't apply data until SECTR has finished loading the scene.
timbecile wrote: Thu Jul 16, 2020 7:38 pmAnd on another topic, is there a way to set the player's rotation to the spawnpoints rotation?
The player's Position Saver component should set the rotation. If it's not, the usual culprit is your player control script(s). They may be undoing the Position Saver's rotation setting.

Re: integrating save system with SECTR

Posted: Fri Jul 17, 2020 10:53 am
by timbecile
thanks Tony,

would I also apply SaveSystem.ApplySavedGameData() on a scene load? or is there another method for that?

Re: integrating save system with SECTR

Posted: Fri Jul 17, 2020 1:00 pm
by Tony Li
Hi,

Call SaveSystem.RecordSavedGameData() before loading a scene or additively loading a scene.

Call SaveSystem.ApplySavedGameData() after loading a scene or additively loading a scene.

Re: integrating save system with SECTR

Posted: Fri Jul 17, 2020 3:09 pm
by timbecile
thanks Tony! I'll give that a try

Re: integrating save system with SECTR

Posted: Sat Aug 15, 2020 1:20 pm
by timbecile
Hey Tony,

This is more a followup for anyone else than a question...

I finally got it working. I ran into a weird problem where no matter what I tried (even with savesystem.ApplySaveGameData()) where the player would be placed at 0,0,0 instead of the location of the save. (I wasn't setting the player position anywhere else). I managed to solve it by adding a new saver that saves the player position and restores it to a variable which is then applied after the SaveSystem.loadEnded.

Thanks again for the help. I'm pretty sure your one asset is like half my game

Re: integrating save system with SECTR

Posted: Sat Aug 15, 2020 2:35 pm
by Tony Li
Glad you got it all working!