Editing early chapters and the save plugin

In the long run, I suppose this doesn’t really matter, but I’m wondering what will happen to people’s saves (from @CJW’s plugin) if I make changes to a chapter they’ve already played.

Specifically, I stopped halfway through a scene and now I’m realizing I need a few more *temp variables I didn’t define at the top of the scene. Will the game bug out for someone who loads a save in the middle of the scene when they reach a check for one of these new variables, or are they created whenever the scene loads? I could just define them again partway through the scene for now…

For those of you who’ve published long games here in multiple chapters, any tips about planning ahead so this doesn’t happen? What’s been your approach to editing old content?

1 Like

IIRC, @CJW mentioned that what is saved by his plugin is the player/reader progression in the form of line number and character position.

That being said, if you made a change to the previous section of :point_up_2:t4: that position, the player will surely miss it and their game may be bugged out later.

As for me, I’d prompt the player to save their progression on the spots that I specifically created for this saving purpose. Something like “Now this is the best time to save your progress,” if you know what I’m saying…

2 Likes

The best way to avoid issues is to have a hub save scene between chapters, where you do the saving. This means that as long as the story scenes / chapters are self contained (*temp variables should be), then there shouldn’t be any knock on effect.

As @Szaal said, it works on line numbers etc, so if you start making changes inside a file which they’re reloading to, you’re definitely going to get some level of undefined behaviour.

2 Likes

Experimenting with a workaround, though I don’t know how it’ll work or how useful it’ll really be. Created a variable in startup; ‘freshstart’ set to false. A line the in first chapter sets it to true, so now I’ve got a way to track whether someone got to a given point through a loaded save or a fresh game…
Heh, maybe you could do some silly things with this, leaving messages that would only show up if you’d loaded a save?

I guess I’m not completely clear what data the plugin remembers. I assume I don’t have to worry about adding to the startup menu (though deleting variables I’ve already been using would be problematic, right?). My guess is that, when someone loads the game, startup runs and creates all the variables, including any new ones. Then the player loads their save and any variables that are different in the save are corrected to match, and the game jumps to the saved line number. And I suppose creates the necessary temp variables stored in the save?

@CJW, what do you mean by a hub save scene? I haven’t done anything with the plugin besides check the box on dashingdon and add a couple lines to my startup file, but now I’m curious what else I could be doing with it…

1 Like

You can upload a patch (I’ve had to do it for a gender stat fix before) make a choice at the bottom of the stats page leading to a choice for the variable you need set and ask your testers to run through the link to set the variable correctly if having troubles.

IE *choice fix x bug

*Goto bug

*Label bug

*Choice did you go left or right at the inn
#left
*Set path left

#right
*Set path right

2 Likes

It’s an additional scene where its sole purpose is to tell the player, “now is a great time to save your progress.”

Or if you go through the XoR path, I remember @Havenstone created a copy of all of the in-game stats which serve the purpose of saving the actual stats. It’s like hp and s_hp, IIRC :thinking:

Basically an “intermission” scene that rarely (ideally never) changes, where all saving should take place. It is literally just a scene that is always accessed between other scenes, and handles navigation to the next scene. This means you don’t have to worry about small but potentially problematic issues arising from line numbers changing etc. Of course it won’t help you if you’re adding new globals etc.

You could even go as far as to have a migration.txt scene, that uses *script and general CS to “patch” any relevant changes between versions - but that’s probably more work than it’s worth, and entirely specific to each game implementing it.

The save plugin literally just dumps all the game state and restores it in its entirety: all globals, temps, current scene, current line number and anything else in the ChoiceScript state object.

2 Likes