Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: SilverSpook on Mon 13/06/2016 08:42:03

Title: Restore a Savegame into a Dialog
Post by: SilverSpook on Mon 13/06/2016 08:42:03
Hi, I have a certain action sequence that starts out with a dialog. I want the game to autosave before starting that dialog.  Then, if the sequence isn't completed correctly, the game reloads and immediately restarts the dialog.

The problem is when I do a game slot restore, I can't figure out how to get the dialog to automatically be triggered.

Is there a way to start a dialog immediately after a restore state?
Title: Re: Restore a Savegame into a Dialog
Post by: Slasher on Mon 13/06/2016 09:00:47
could you not do a boolean check when reloading after fade in and run dialog if false (incorrect)?

if correct set boolean to true.
Title: Re: Restore a Savegame into a Dialog
Post by: Khris on Mon 13/06/2016 11:51:59
You can use on_event and eEventRestoreGame: http://www.adventuregamestudio.co.uk/manual/ags42.htm

Before the dialog happens, set a bool to true (run_dialog_x_after restore). Then save the game, set the bool back to false and start the dialog.
In on_event / eEventRestoreGame, check for the bool being true, and if so, set it to false and start the dialog.
If the player failed the sequence, simply restore the game.

This is not tested but should work.