restart game by button but how to restart dialogue system

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
aaajiao
Posts: 53
Joined: Tue Sep 01, 2020 5:41 am

restart game by button but how to restart dialogue system

Post by aaajiao »

I'm having trouble trying to use bolt to make a restart button, I don't know how to restart dialogue manger, I'm trying to destroy the dialogue manger, but it doesn't seem to work. :?:
aaajiao
Posts: 53
Joined: Tue Sep 01, 2020 5:41 am

Re: restart game by button but how to restart dialogue system

Post by aaajiao »

I'm now using a method to deal with the fact that we have Root0, Roo1, specific Scene0

Root0 :setup All cross-scene objects include dialogue manager
Root1 I:t's designed to restart the game. - Destroy the dialogue manager in this scene.
Scene0 :Reload the dialogue manager in this scene, as this is the specific first scene to restart the game into.

It's working now, but I don't know of a smarter way to do it.
User avatar
Tony Li
Posts: 22051
Joined: Thu Jul 18, 2013 1:27 pm

Re: restart game by button but how to restart dialogue system

Post by Tony Li »

Hi,

The recommended way to restart the Dialogue System is to call PixelCrushers.SaveSystem.RestartGame:

Code: Select all

PixelCrushers.SaveSystem.RestartGame("startingScene");
This will reset the Dialogue System's data and load a starting scene.

If you don't want to load a starting scene, call these methods:

Code: Select all

ClearSavedGameData();
BeforeSceneChange();
SaversRestartGame();
(I'm showing examples in code, but you can make the same calls with Bolt.)
aaajiao
Posts: 53
Joined: Tue Sep 01, 2020 5:41 am

Re: restart game by button but how to restart dialogue system

Post by aaajiao »

:lol:

Looks like I'll have to use the save system, I've already implemented the restart in bolt.

I will have a related issue with AutoSaveLoad, I non just need to set it on the dialogue mannger to work automatically. But I'm developing a desktop game.
User avatar
Tony Li
Posts: 22051
Joined: Thu Jul 18, 2013 1:27 pm

Re: restart game by button but how to restart dialogue system

Post by Tony Li »

AutoSaveLoad is usually used for mobile games. You can use it for a desktop game, but desktop games instead typically have a main menu and save slots. You may want to use the free Menu Framework on the Dialogue System Extras page if you're using a desktop game.
aaajiao
Posts: 53
Joined: Tue Sep 01, 2020 5:41 am

Re: restart game by button but how to restart dialogue system

Post by aaajiao »

Thank you, Tony, I think AutoSaveLoad is a wonderful component, on the desktop as well. ;)
User avatar
Tony Li
Posts: 22051
Joined: Thu Jul 18, 2013 1:27 pm

Re: restart game by button but how to restart dialogue system

Post by Tony Li »

Thanks! Please make sure to use Dialogue System version 2.2.10. It fixes a bug in AutoSaveLoad.
aaajiao
Posts: 53
Joined: Tue Sep 01, 2020 5:41 am

Re: restart game by button but how to restart dialogue system

Post by aaajiao »

Well, it was a timely upgrade. :D :D :D
User avatar
Tony Li
Posts: 22051
Joined: Thu Jul 18, 2013 1:27 pm

Re: restart game by button but how to restart dialogue system

Post by Tony Li »

An AutoSaveLoad patch was available for the previous version, but I'm glad you could upgrade and get the fix in the official release version.
Post Reply