Any ideas ?

I'm using some variables in my game (the player has to go through specific pages in order to move forward in other places), and I'd like to simply reinitialize every variable every time the player goes to the "Game Over" screen.

Any ideas ?


Are you storing your variables as attributes on the player object?

If so, you could clone the player object at the start of the game (to save initial values) and then copy them back with a script:

foreach (attr, ListExclude (ListCompact (ListCombine (GetAttributeNames (player1, false), GetAttributeNames (player, false))), "name")) {
  set (player, attr, GetAttribute (player1, attr))
}

(off the top of my head, typing on my phone during χmas dinner, so could have errors)

If your variables are on multiple objects, it could be more complex.


(off the top of my head, typing on my phone during χmas dinner, so could have errors)

best quote of the year...


How many variables are we talking about? A few? A dozen? A hundred? Different ways to do this but it depends on how many there are.


"Honey, get off the phone!"