Dying to find out

guzmere
23 Mar 2012, 07:56
Hi, hope all is in good health and temper on this misty day. I have asked this question before but have had no replies so I have summoned up my courage to ask again. If a player dies in a game, what would be the syntax to reset all variables and objects and restart the game. I know there is a command to finish the game, if you want to but I would like to give the player a choice of starting again or finishing. Thanks in anticipation :D :D :D :D

MerchantToo
23 Mar 2012, 08:35
You could first make a menu (http://quest5.net/wiki/Show_menu) as shown in the wiki, with choices for restart/try again/finish. I've seen that people do the following in the try again situation: just move the player to a particular room before whatever happened that causes the decision. For restart I can't find a command in the wiki, but I'm sure there must be a way? (possibly a loop calling undo 200000 times - erm.. joke?) And for finish then you can use finish.

Is there a variable that counts the number of valid commands one has typed? Then you could record the command number when you say enter a particular room, and when the unfortunate accident occurs, just undo a certain number of commands.

Maybe better would be to have a record gamestate and reload gamestate commands?

Alex
23 Mar 2012, 09:00
Even your hacky suggestion won't quite work, because if the player saves their game and comes back to it later, the "undo" history before the save point won't be preserved.

MerchantToo
23 Mar 2012, 10:30
That's me hacky all-over :oops: Maybe I should get a warning symbol for this forum don't follow MerchantToo advice if you want maintainable code..
So there's no way to access a save game except through the menu?

guzmere
23 Mar 2012, 13:21
Hi guys, thanks for replying and I gather by the response from Alex it can't be done. But hey I will plan around it, (maybe the player will get a smacked wrist instead) LOL :lol: :lol: .All I can think of it must be a program attached to Quest but it has to be implemented from outside of the program somehow. Is this on the lines of being somewhat right. By the way MerchantToo, (Oh hacky one) LOL :lol: :lol: thanks for your input also.Have a good days guys. :D :D :D :D

Pertex
23 Mar 2012, 14:31
There could be a way to reset the game by importing a html-file via script with a javascriptscript within it which reloads the complete page. But then you could not load a saved game.