Jump to content


Photo

Command to restart the game as it was initially...


  • Please log in to reply
4 replies to this topic

#1 anselm

anselm

    GMC Member

  • GMC Member
  • 239 posts

Posted 15 September 2011 - 09:54 PM

Hey Forum,

I've been experimenting with a "Main Menu" feature in my game, currently, when you're in game, hitting the Main Menu button runs the "game_restart();" function.

The only problem is, that doesn't seem to restart the game like I'm wanting it to, what I want it to do is when you hit Main Menu, have it restart the game as if you were just initially launching the .exe, so all the variables go back to how they are every time you launch the .exe

Occasionally this system seems to leave variables in there, like having my nextroom variable set to an in-game room, so when the menu fades from the intro to the actual menu, it fades to said in-game room.

Any help is greatly appreciated,

Thanks,

Anselm.

Edited by anselm, 15 September 2011 - 09:59 PM.

  • 0

#2 anselm

anselm

    GMC Member

  • GMC Member
  • 239 posts

Posted 04 October 2011 - 06:48 PM

Does anyone have an answer to this? I really really need one.
  • 0

#3 twelveways

twelveways

    GMC Member

  • GMC Member
  • 1383 posts

Posted 04 October 2011 - 06:56 PM

game_restart()
  • 0

#4 anselm

anselm

    GMC Member

  • GMC Member
  • 239 posts

Posted 04 October 2011 - 07:12 PM

Twelve, please read the original post before you comment.
  • 0

#5 Bloodleh

Bloodleh

    GMC Member

  • GMC Member
  • 51 posts

Posted 04 October 2011 - 07:32 PM

game_restart() will set your game to same stage as you started the exe.
You could use a controller object which is persistent and before you use game_restart() you set it to have some variable which tells you which room you want to start with. Not 100% sure if persistent works with game_restart() though.
  • 0




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users