Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: mchammer on Fri 09/03/2007 12:40:52

Title: Restarting game completely (SOLVED)
Post by: mchammer on Fri 09/03/2007 12:40:52
I have a lot of global ints witch get a random value in game_start section. When I use RestartGame() function, those globals dont get new random values. Id like to have a button to my game witch would completely restart game and give new values to the globals.

Is that possible?
Title: Re: Restarting game completely
Post by: Lt. Smash on Fri 09/03/2007 13:27:01
look here:

http://www.adventuregamestudio.co.uk/yabb/index.php?topic=26978.0

I think that answers your question.

EDIT:
If you want a button for restarting, first create a button.
Name it. (example: btnRestart)
Doubleclick it.
And in the function(btnRestart_Click)
call RestartGame()

It should work if you use Gilbot V7000a's code.
Title: Re: Restarting game completely
Post by: mchammer on Fri 09/03/2007 13:50:03
Thnx, That worked fine.