My current RPG project using SugarCube 2 is going to be released in episodes (drip feeding the story rather than release it as one big file, which is also being done for practical reasons). At the moment I'm using three numeric variables:
$playep = current episode the player is on
$gameep = current episode the game has reached
$slflow = point in the story line the player has reached (related to the episode the player is on)
As the game is part "open world" and part storyline driven (which can be totally ignored) I have an indicator on when the user should save as they've reached the end of the episode. Now it's fine when they save at that point and don't go any further and reload, but as they can continue to play the game and do side quests while waiting for the next episode it gets really complicated as I need to check where they're at for a quick "Previously..." intro for the episode (just like on TV) and possibly change a few things as well (at two points the map expands so I need to shift the x and y locations where the player is at around so if the map extends to the left and the x location is 3 it becomes 4).
I've kind of bodged a quick work around, but it requires me placing it at every point in the game, and there are points that it breaks the flow of the game or seems out of place. Is there are relatively simple way of doing this with a special passage or something so that it happens as soon as the player loads the save rather than my current approach?
Comments
How were you hoping to do the "previously" screens? Are you limiting the maximum number of states/moments?
The "previously" bit will actually just be a highlight of the storyline so far and not the user actions that aren't related to the storyline. So if, for instance, in the previous episode you had a storyline quest in the episode to destroy a pirate cartel that will be in the highlights, but the fact you traded 10 tonnes of materials that wasn't a quest won't be recorded (or at least not as a highlight). The text will be more or less static apart from a few quests that have different outcomes and then it's just a case of checking which of the outcomes happened.
Also, you didn't answer my final question. Are you limiting the maximum number of states/moments?
It would be it's own screen (although 2 in certain cases as I have a couple of fun things in the pipeline).
If by states and moments you mean whether there is any specific time it would trigger, I'd only need it once per episode, and it should be able to trigger anywhere they're on a base (I'm disabling saving during travel, fights and random encounters). There are only really going to be bases and travelling in the game (no real dungeons as such), so they'll be in a base when they reload anyway. If this isn't what you mean could you please explain?
TME is basically asking if you have changed the Config.history.maxStates configuration setting or disabled the history Undo/Redo buttons. One reason he may be asking about this is because the Passage History is stored within a Save.
<<click "Load Game">><<set $saveactivated>><<script>>UI.saves();<</script>><</click>>
I can then use $saveactivated in PassageDone to do something conditional.
Eg if I put this in PassageDone:
Then my GSAP text div will flash that message up whenever the player loads a save and the $time variable is also 4.
The code is just quickly written though, and has a hole in that it doesn't have a way to respond to situations where the player closes the save ui without loading a game. You can address that in several ways though.
My number of states/movements is set to: and my "previously on" scene consists of a single passage where I basically check and then I do a and to show and then remove meaningful paragraphs from the previous chapters.
If there's anything I can help with, I'm right here
That removes the limit on the number of states/moments that the history may hold, which I do not recommend as you will eventually run into problems because of the ever increasing size of the history. To put it another way, even if you keep your story variables under control, an unbounded history will very likely eventually become problematic in a long running game due to the sheer number of states.
The default value is 100, which should be more than sufficient in most cases. If that's not enough for your tastes, I'd recommend simply setting it to a larger value, e.g. 200, rather than removing the limit altogether.
Just a suggestion.
I do not often make changes to the internals of the saves format, so breaking saves by upgrading to a newer version of SugarCube, within the same major version, shouldn't normally be a concern. That said, I have needed to do so on a few occasions. Whenever I have, however, I've tried to include automatic converters that upgrade old saves, so that players never notice that anything has changed.
I try very, very hard not to break saves.
Place the following within your script section (Twine 1: script-tagged passage; Twine 2: Story JavaScript): EDIT: A small update to smooth any changes made during StoryRecap into the history better.
Then create a special passage named StoryRecap and set it up like the following: You may change the text of the <<click>> or even replace it with a <<button>> or something else if you wished. The call to continueFromRecap() is the important part.
Well, I shall implement your suggestion (I believe you know what you're talking about ).
From my experience, you're not only trying but succeeding. I've updated the game many times now and, aside from testing it myself, nobody has had any problems with loading their story and continue playing it. I can update the story's html regularly and as long as their save's stored on the application's folder everything works as it should. The only "problem" is that if they uninstall the app the save is lost.
Once again, gracias (see? you know some Spanish), SugarCube is an amazing tool and I made sure to include your copyright notice in the game's credits.
Claretta: I completely forgot about passagedone and I feel like a noob again lol.
TME: Thank you ever so much. I actually understand what most of it does, even though I can't get my head around Javascript totally.
Bruno: Hola. My bodge job did something similar, although it checked 3 variables as I needed various conditions to be met. BTW, although I'm English I more or less grew up in Spain as my family had a place in Benidorm. The moment school ended for half term or end of term I was straight over there. Happy days.
Once again, to you all, thank you so much
Now I understand your username, a bit dark huh? Benidorm sounds just like the place to be this time of year, I'm not enjoying the 30 something degrees we get daily here in Madrid. Anyway, nice to meet you! ¡Encantado!