Small question about having a main menu

Started by mmm_bot, Thu 20/06/2013 16:58:03

Previous topic - Next topic

mmm_bot

Hey, I just finished working on a menu, but I had a small of question - in my New Game option, I basically just transported the character into the starting room. This will obviously work the first time a player starts the game, but what if someone plays for a while, then goes back to the main menu and then start a new game? Wouldn't some variables or things like that be out of place? If this is a problem, is there a way to reset the game easily once a players goes back to the main menu so that I don't have to worry about it?

Thanks a lot :)

Crimson Wizard

RestartGame is your friend :).

To elaborate more: when the game starts, it sets a "restart point" by making a special savegame (slot 999). You can manually control it with SetRestartPoint.
This may also be used as an autosave/quick-restore feature.
If you need more than one special save, use SaveGameSlot and RestoreGameSlot with a high save number, like 998, 997 etc (this way you will likely not interfere with actual player saves).

mmm_bot

Thanks. I had a little trouble with the SetRestartPoint() at first, but everything is working as it should now.

Thanks a lot :)

SMF spam blocked by CleanTalk