SetContinueMode Forcing Conversation to Auto Progress

Announcements, support questions, and discussion for the Dialogue System.
User avatar
Tony Li
Posts: 22051
Joined: Thu Jul 18, 2013 1:27 pm

Re: SetContinueMode Forcing Conversation to Auto Progress

Post by Tony Li »

Hi,

Try setting the Save System's "Frames To Wait Before Apply Data" to zero. Also make sure your Dialogue Manager has a Dialogue System Saver component with a unique Key, and that Restore On Start is UNticked.

The Save System normally waits a number of frames before applying the save data to the scene. This gives other, non-Dialogue System scripts time to initialize themselves before receiving saved data. If no scripts need extra frames to initialize, then you can set Frames To Wait Before Apply Data to zero.

If that doesn't help, then don't check the quest states in start. Check the quest states only after the save system has restored the saved state. To do that, change code like this:

Code: Select all

void Start()
{
    // ... check states ...
}
to this:

Code: Select all

void Awake()
{ // (Alternatively, you can put these in OnEnable/OnDisable instead of Awake/OnDestroy)
    PixelCrushers.SaveSystem.saveDataApplied += OnSaveDataApplied;
}
void OnDestroy()
{
    PixelCrushers.SaveSystem.saveDataApplied -= OnSaveDataApplied;
}
void OnSaveDataApplied()
{ // This method is called when the save system has finished restoring the saved state.
    // ... check states...
}
jae026
Posts: 51
Joined: Wed Apr 15, 2020 10:22 pm

Re: SetContinueMode Forcing Conversation to Auto Progress

Post by jae026 »

Tony, so I have 4 scenes and each scene has its own Dialoge Manager Object (Will have to change this later but we are too close to a deliverable). When we load a new scene our quest states from past scenes are not being loaded. The final conversation relies on choices made earlier in the game to progress. I tried you last suggestion now I am just at the point where I want to setup the save components from scratch. Everything was working fine but somewhere along the line it stopped so maybe we were just lucky.

How can I setup the save components to save the quest states per scene and then have them carry over to the next scene. With each scene having it's own Dialogue Manager.

I have stripped all the save components off of the Dialogue Managers at this point and need some help.
User avatar
Tony Li
Posts: 22051
Joined: Thu Jul 18, 2013 1:27 pm

Re: SetContinueMode Forcing Conversation to Auto Progress

Post by Tony Li »

Hi,

Add an empty GameObject. Name it Save System, and add these components: Save System, Json Data Serializer, PlayerPrefs Saved Game Data Storer, optionally Standard Scene Transition Manager.

You can use a different Data Serializer and/or Saved Game Data Storer if you want.

Or download the already-configured prefabs from the Dialogue System Extras page, import the package, and drop the Save System prefab into your scene(s).

Add a Dialogue System Saver component to the Save System GameObject.

Then change scenes using the save system. Before leaving the old scene, the Dialogue System Saver will save the quest states (and other DS data) on that Dialogue Manager. After entering the new scene, the Dialogue System Saver will restore the DS data to the Dialogue Manager in the new scene.
jae026
Posts: 51
Joined: Wed Apr 15, 2020 10:22 pm

Re: SetContinueMode Forcing Conversation to Auto Progress

Post by jae026 »

Do I need only one Save System starting from the main menu or one per scene? It persist correct?
jae026
Posts: 51
Joined: Wed Apr 15, 2020 10:22 pm

Re: SetContinueMode Forcing Conversation to Auto Progress

Post by jae026 »

jae026 wrote: Tue Jan 05, 2021 9:36 am Do I need only one Save System starting from the main menu or one per scene? It persist correct?
I see the notes
User avatar
Tony Li
Posts: 22051
Joined: Thu Jul 18, 2013 1:27 pm

Re: SetContinueMode Forcing Conversation to Auto Progress

Post by Tony Li »

Hi,

Yes, it persists.
jae026
Posts: 51
Joined: Wed Apr 15, 2020 10:22 pm

Re: SetContinueMode Forcing Conversation to Auto Progress

Post by jae026 »

Is it possible with this setup that the SaveSystem.LoadScene call could load the last scene it was in on launch?
jae026
Posts: 51
Joined: Wed Apr 15, 2020 10:22 pm

Re: SetContinueMode Forcing Conversation to Auto Progress

Post by jae026 »

ITs odd because when I enter a trigger volume I run the sequence LoadLevel(xxx) and it loads the last scene that was open when I close the game. This only happens in builds but not in Editor.
User avatar
Tony Li
Posts: 22051
Joined: Thu Jul 18, 2013 1:27 pm

Re: SetContinueMode Forcing Conversation to Auto Progress

Post by Tony Li »

Hi,

When you load a saved game (but not when you just change scenes), it will load the last scene you were in, if the Save System component's Save Current Scene checkbox is ticked.

When something happens in builds but not the editor, this is usually because the first scene in your build settings has a Dialogue Manager and/or Save System GameObject that's different from whatever scene you're testing individually in the editor's play mode. The first Save System GameObject to exist in a play session always survives scene changes and replaces any Save Systems that are in later scenes.
jae026
Posts: 51
Joined: Wed Apr 15, 2020 10:22 pm

Re: SetContinueMode Forcing Conversation to Auto Progress

Post by jae026 »

I have an init scene which has a video and the System Saver object. The next Scene after the video is the Main Menu which has the DM which is a prefab that is in each scene. However, the Save Scene was checked. I am building that out right now with that unchecked.
Post Reply