SOLVED:Making an Unlockable Main Menu option.

Started by Stranga, Sun 30/04/2017 06:23:10

Previous topic - Next topic

Stranga

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?

Slasher

#1
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...


Cassiebsg

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).
There are those who believe that life here began out there...

Stranga

#3
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.

Slasher

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?

Stranga

Sorry to sound so...newbish but how would I make this file exactly? If it's not too much trouble :)

Cassiebsg

There are those who believe that life here began out there...

Stranga

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.


SMF spam blocked by CleanTalk