integrating save system with SECTR

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
timbecile
Posts: 110
Joined: Mon Mar 12, 2018 11:00 pm

integrating save system with SECTR

Post 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?
User avatar
Tony Li
Posts: 21080
Joined: Thu Jul 18, 2013 1:27 pm

Re: integrating save system with SECTR

Post 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.
timbecile
Posts: 110
Joined: Mon Mar 12, 2018 11:00 pm

Re: integrating save system with SECTR

Post by timbecile »

thanks Tony,

would I also apply SaveSystem.ApplySavedGameData() on a scene load? or is there another method for that?
User avatar
Tony Li
Posts: 21080
Joined: Thu Jul 18, 2013 1:27 pm

Re: integrating save system with SECTR

Post 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.
timbecile
Posts: 110
Joined: Mon Mar 12, 2018 11:00 pm

Re: integrating save system with SECTR

Post by timbecile »

thanks Tony! I'll give that a try
timbecile
Posts: 110
Joined: Mon Mar 12, 2018 11:00 pm

Re: integrating save system with SECTR

Post 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
User avatar
Tony Li
Posts: 21080
Joined: Thu Jul 18, 2013 1:27 pm

Re: integrating save system with SECTR

Post by Tony Li »

Glad you got it all working!
Post Reply