Stencyl 3.4.0 is now out. Get it now!

New Game +, Is there a better way?

Galdon2004

  • *
  • Posts: 205
Hi all, I am working on a story-heavy game at the moment, and I want to include a newgame + mode. I did it by using a plugin for multiple saves, and having the game make a special secret save when the game starts, then saving variables that will carry over as scene attributes, loading the secret save, then changing those variables that carry over to match the scene attributes.

However, I have been getting a lot of confusing bug reports from doing this that do not show up when loading saves with the same plugin normally. Variables seem to go crazy once a new game plus has begun, causing all sorts of strange things to happen such as lines getting jumbled, some variables seeming to have two values at once, and so on. So, I am wondering, is there a better way to get all the variables to go to their default values? Doing it by hand is pretty much out of the question, as there are hundreds of variables in the game with many more still yet to come which would mean having to manually add to the list every time a new variable is added to the game.

rob1221

  • *
  • Posts: 8976
If you happen to be using lists or maps, make sure you're adding the "copy of ___" block so the attributes aren't referring to the same data.

Galdon2004

  • *
  • Posts: 205
I'm not using Lists or Maps, what I'm doing is like, for a variable to determine if you've heard/seen something relevant to a subplot, which would be basically a boolean using a number attribute with a 0 for no, or 1 for yes, it'd be creating a scene number attribute (the blue one) then having the code do basically this:

set [X Plot Temporary] to [X Plot]
set [Y Plot Temporary] to [Y Plot]

Load [secret save]

set [X Plot] to [X Plot Temporary]
set [Y Plot] to [Y Plot Temporary]