Page 1 of 4

Save dialogue settings when closing application

Posted: Sat Apr 17, 2021 3:34 pm
by soniclinkerman
Hey!

Is there a way where I can save the variables that make dialogue happen even after I close the application? I don't want the player to have to go through the dialogue every time they close the application and start it up again
I just want to save the variables and have them load on start so it knows which dialogue states have already happened

Re: Save dialogue settings when closing application

Posted: Sat Apr 17, 2021 4:52 pm
by Tony Li
Hi,

Set up the save system in the first scene. Add an Auto Save Load component to the save system GameObject.

Tip: The Dialogue System Extras page has a SaveSystemPrefabs package with preconfigured prefabs.

Re: Save dialogue settings when closing application

Posted: Sat Apr 17, 2021 5:07 pm
by soniclinkerman
Thanks for the response! I just downloaded the "Save System" prefab. Do I just need to add this into every scene and it will save the states for me?

Re: Save dialogue settings when closing application

Posted: Sat Apr 17, 2021 7:45 pm
by Tony Li
  • Add an Auto Save Load component to the 'Save System' prefab. Mouse over the Auto Save Load component's Inspector to understand what they do.
  • Add the 'Save System' prefab to the first scene in build settings. You can also add it to other scenes if you want, but it must be in the first scene.
  • Add a Dialogue System Saver component to your Dialogue Manager prefab. You can add this prefab to all of your scenes, or just to the first scene. If you add it to all of your scenes, it makes it easier to playtest individual scenes.
  • Add the 'LoadingScreen' scene to build settings.
  • Review the Save System manual to identify any other savers that you might want to add to GameObjects. For example, you might want to add a Position Saver to your player GameObject to save its position in saved games.

Re: Save dialogue settings when closing application

Posted: Sat Apr 17, 2021 8:29 pm
by soniclinkerman
My first scene is an opening logo for my game and then a menu.

I noticed the options in Auto Save Load. I would like the game to load, but using the options "Load On Start" wouldn't work because my Game Manager and Dialouge System is located in the menu.

Doing "Load On Start" Skips the menu and jumps straight to Scene 2(Level 1). Is there a way to fix this so I have all 3 of those gameobjects ?

I also would like to NOT have a loading screen if possible.

Re: Save dialogue settings when closing application

Posted: Sat Apr 17, 2021 8:37 pm
by Tony Li
Remove the Save System from your first scene. Put it in your menu scene scene along with your Dialogue Manager and Game Manager.

You may also want to add scene indices 0 and 1 to the Auto Save Load component's 'Don't Save In Scenes' list.

To remove the loading screen:
  • Remove the LoadingScreen scene from build settings.
  • Inspect the Save System prefab's Standard Scene Transition Manager component. Clear the Loading Scene Name field.

Re: Save dialogue settings when closing application

Posted: Sat Apr 17, 2021 8:39 pm
by soniclinkerman
*UPDATE*

Ok so what I did is, I put the "Save System" prefab in each of my scenes. So far that seems to make things work. There's one more issue that occurs.

Is there a way to make a noise happen ONLY when the dialogue text panel is about to happen? I tried using "On Open" in my dialogue manager, but for some reason, it still plays the noise in the beginning of my main menu scene for example EVEN though there's absolutely no dialogue taking place there

Re: Save dialogue settings when closing application

Posted: Sat Apr 17, 2021 9:03 pm
by Tony Li
Set the Dialogue Manager's Other Settings > Warm Up Conversation Controller dropdown to Off.

When Warm Up Conversation Controller is set to On or Extra, it "warms up" by running a short, fake conversation invisibly in the background when the Dialogue Manager starts. Since dialogue UIs sometimes have a lot of UI layout components such as Vertical Layout Group and Content Size Fitter, this gives Unity UI a chance to precompute its layout, which can prevent a possibly brief stutter the first time a conversation starts.

If you want to keep Warm Up Conversation Controller set to On or Extra, you could do this:
  • Add a Dialogue System Events component to the Dialogue Manager. Configure the OnConversationStart() event to play the sound. BUT set the Dialogue System Events component disabled.
  • Add a Timed Event component to the Dialogue Manager. Set Mode to Frames. Set Frames to 1. Configure the OnTimeReached() event to enable the Dialogue System Events component.

Re: Save dialogue settings when closing application

Posted: Sat Apr 17, 2021 9:07 pm
by soniclinkerman
Ah I see. Thanks for this solution! I'm nearly done setting this up. I did what you said and added scenes 0 and 1 to "Auto Save Load". I thought this would allow me to do "Load On Start", but unfortunately, it doesn't ignore the scene it's meant to.

Is theree something I'm missing in thee setup?

Re: Save dialogue settings when closing application

Posted: Sat Apr 17, 2021 9:19 pm
by Tony Li
Hi,

You may need to inspect the Save System GameObject's PlayerPrefs Saved Game Data Storer component and delete the existing saved game.

If that doesn't fix it, what do you mean by ignoring the scene?
  • Assuming the Save System GameObject is in scene 1 (which I assume is the menu scene), then as soon as the game gets to scene 1, the Auto Save Load component will look for a saved game. If it finds one, it will load the save.
  • If you stop playing while in scene 0 or scene 1, it will not save the game. If you stop playing while in scene 2+, it will save the game.