Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: TGames on Mon 26/11/2018 14:12:29

Title: [Solved]Issue With Death GUI
Post by: TGames on Mon 26/11/2018 14:12:29
In my game I have made a death GUI that appears when the player dies. It has a restore, restart, and quit button and pressing each of them will bring up the respective GUI. However, if I exit one of the other GUIs e.g. I say that I don't want to restart, the Death Gui does not pop up, and the player can continue playing. What should I do so that whenever the player is dead, the death GUI will pop up if you are not in the restore, restart, or quit GUI.
Thankyou!
Title: Re: Issue With Death GUI
Post by: Crimson Wizard on Mon 26/11/2018 15:18:36
There may be various approaches to this including sophisticated ones like scripting a nested GUI system, but simpliest way seems to have a kind of "PlayerIsDead" variable which you set at player's death and test in event handlers of all buttons which close Restore/Restart/Quit dialogs. If it's on, then bring death gui back upon closing the previous one.
Title: Re: Issue With Death GUI
Post by: Slasher on Mon 26/11/2018 15:34:26
Why die and then decide you don't want to die?  That is the question...

I have a similar thing in my last game and the game restores a saved point to try again..
Title: Re: Issue With Death GUI
Post by: Khris on Mon 26/11/2018 18:03:18
You can simply keep the Death GUI open in the background; any of the three options will "close" it anyway (restore/restore will load a savegame which doesn't have the GUI open, and quitting the game will close the entire game).
Title: Re: Issue With Death GUI
Post by: TGames on Tue 27/11/2018 06:01:22
Thank you all for your responses. I fixed my problem and it works great!