Page 1 of 1

restart game by button but how to restart dialogue system

Posted: Thu Sep 17, 2020 4:58 am
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. :?:

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

Posted: Thu Sep 17, 2020 5:18 am
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.

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

Posted: Thu Sep 17, 2020 8:41 am
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.)

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

Posted: Thu Sep 17, 2020 1:59 pm
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.

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

Posted: Thu Sep 17, 2020 2:09 pm
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.

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

Posted: Thu Sep 17, 2020 6:32 pm
by aaajiao
Thank you, Tony, I think AutoSaveLoad is a wonderful component, on the desktop as well. ;)

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

Posted: Thu Sep 17, 2020 6:48 pm
by Tony Li
Thanks! Please make sure to use Dialogue System version 2.2.10. It fixes a bug in AutoSaveLoad.

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

Posted: Thu Sep 17, 2020 7:42 pm
by aaajiao
Well, it was a timely upgrade. :D :D :D

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

Posted: Thu Sep 17, 2020 8:27 pm
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.