Hello! I have an rpg game that's constantly being updated - new side quests or new plots, for example. I understand that if I update the StoryInit with new variables, players already with saved games won't be able to access these new additions. What would you recommend I do so that players won't constantly have to start new games just to get the new updates?
Thank you! I am currently on Twine 2.0.11 and Sugarcube 2.12
Comments
The easiest thing to do would be to add a prehistory task to inject the new variables, which would only require ongoing TwineScript maintenance on your end.
Here's an example of the latter. You'd need something like the following JavaScript to setup the task which will run a special passage, which I've named ExpansionInit: (Twine 2: goes in Story JavaScript; Twine 1: goes in script-tagged passage) Once added, you will never have to touch that code again.
Now, for the special passage, which you will have to maintain. Create a new passage named ExpansionInit and put something like the following within: Basically, you enclose the variables for each new expansion within an IF which is gated by the non-existence of one of the variables, so if and only if the key variable does not already exist will the set of variables for a particular expansion be initialized. See the <<if>> macro for details on the TwineScript ndef (not defined) operator.
and adding this to the ExpansionInit passage means that going through new passages with $town2map will show up as "yes", even when using old saved games, right?