RestartGame ()

Started by deltamatrix, Sun 11/01/2004 12:46:49

Previous topic - Next topic

deltamatrix

I have a situaion where one function calls a second function which calls a third function which calls a fourth function which contains a RestartGame () command.

But after that fourth and final function ends, the rest of the code within the original function continues and the game don't restart until the first function ends.

I don't want that. I want the restartgame() command to work instantly! Why doesn't it?
BAD WOLF - TORCHWOOD - MR SAXON - THE BEES ARE DISAPPEARING - PANDORICA - RIVER SONG

a-v-o

There are some functions (also NewRoom, ...) which don't work instantly. You can set a variable from 0 to 1 at the RestartGame command. Then you check in the first 3 functions if this variable is 0 then execute rest of code else ignore code.

Scorpiorus

Yep, the RestartGame() works exactly as RestoreGame() taking effect only when the script is finished (i.e. all the nested calls returned control).

~Cheers

Pumaman

Because before a game can be restored or restarted, the text scripts all have to unwind back out to where they were originally called from - otherwise some things could really get messed up.

Sorry, that's just the way it works.

Alynn

Question just for my own personal curiosity, I know RestartGame() reinits vars in the global script (I use them for my game clock and it resets the clock) but does it reset the GlobalInts for SetGlobalInt and so on (I havn't gotten to a point where I need to use them, but I will for a couple of Dialog interactions, I just wan't to know so if they don't I can change those to setting the vars in the global script).

Pumaman

Yes, RestartGame resets everything. It's basically equivalent to restoring a save game which was saved at the very start of the game.

SMF spam blocked by CleanTalk