Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: Stranga on Sun 30/04/2017 06:23:10

Title: SOLVED:Making an Unlockable Main Menu option.
Post by: Stranga on Sun 30/04/2017 06:23:10
I'm sure this is possible, but I'm not sure on how to go by this. I wan't to create a secret unlockable button in my main menu after completing the game. But, because I use RestartGame(); it just resets everything even if I made a global switch to unlock this button. Anyone have any ideas?
Title: Re: Making an Unlockable Main Menu option.
Post by: Slasher on Sun 30/04/2017 08:21:42
The only way I can think of doing it is by writing an external file before RestartGame(); and have ags read the file when you choose Play after RestartGame(); .

Unless someone knows a sure fire way...

Title: Re: Making an Unlockable Main Menu option.
Post by: Cassiebsg on Sun 30/04/2017 08:43:15
Like slasher said, I'm writing a file on the save games folder to keep track of it, then just check if the file is there and the content is correct at game start. You can also use a savegame file just for that that, if you like (just make sure the player can't use that slot to save the game).
Title: Re: Making an Unlockable Main Menu option.
Post by: Stranga on Sun 30/04/2017 09:03:20
Hey thanks for responding guys! I had thought of using a save file and just loading the file when the main menu pops up. Only thing is though, is there a way to just only save global variables? And load those? Because I made an auto save game and used like slot 99, but it just loads to that point in the game and not just the button I need in the Main Menu.
Title: Re: Making an Unlockable Main Menu option.
Post by: Slasher on Sun 30/04/2017 10:54:28
Surely if you write and save these variables into a file at the end before RestartGame and have ags check before re loading then when the game opens the variables should be applied via the external file? Something like in Game Start?
Title: Re: Making an Unlockable Main Menu option.
Post by: Stranga on Sun 30/04/2017 11:50:59
Sorry to sound so...newbish but how would I make this file exactly? If it's not too much trouble :)
Title: Re: Making an Unlockable Main Menu option.
Post by: Cassiebsg on Sun 30/04/2017 12:04:07
Here you go: http://www.adventuregamestudio.co.uk/wiki/File_functions_and_properties
Title: Re: Making an Unlockable Main Menu option.
Post by: Stranga on Sun 30/04/2017 13:37:27
Thanks guys for your help, I understand the use of external files now, but I made a quick work around.

What I did was created an obsolete save slot (99) when the secret menu unlocks in the game. When the game restarts or you go back to the main menu, it will check if that save slot has a save in it and activate a global variable that contains the selection visibility in it.