Saving Story State

516 views
Skip to first unread message

C B

unread,
May 3, 2012, 12:30:38 PM5/3/12
to Tweecode / Twine
I don't believe I saw any mention of this anywhere, but particularly
in light of interested developers taking a look at the codebase again,
has anyone looked at or had any luck with the notion of saving story
state to allow a longer story to be "paused" and resumed from the same
point later?

I have not looked over the codebase myself, but those that are more
familiar with it... how well structured is it as far as being able to
simply serialize the variables and dump that out as a json file or
something which could them be reloaded for a given user. I realize
there would need to be some backend glue (like a user registration/
login system). But if there was some simple function added that could
"export" story state, and then an inverse function that could simply
be fed that exported json (or whatever) file, to restore a story to
the exact point in time/state (for stories with more complex branching/
variable states) that would make longer form stories a hugely more
enjoyable (user friendly) experience.

I'm just beginning to play around with twee/twine, and it seems like
an awesome tool (so if there is already a way to accomplish this,
would appreciate anyone pointing it out to me).

Otherwise, I would definitely submit this as a big wishlist item
(forcing a user to keep a browser session seems like a step backwards
from even paper books).

Thanks :)

M. C. DeMarco

unread,
May 4, 2012, 7:16:59 AM5/4/12
to twee...@googlegroups.com
I think there must be tiddlywiki code to save something to the file itself, so we wouldn't necessarily need the export, just a passage to store state.

mary
--
You received this message because you are subscribed to the Google Groups "Tweecode / Twine" group.
To post to this group, send email to twee...@googlegroups.com.
To unsubscribe from this group, send email to tweecode+u...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/tweecode?hl=en.



--
___________________
mcde...@gmail.com
http://gplus.to/mcdemarco
http://www.mcdemarco.net
http://twitter.com/mcdemarco
https://github.com/mcdemarco
http://pinterest.com/mcdemarco

Stormrose

unread,
May 4, 2012, 8:41:26 PM5/4/12
to twee...@googlegroups.com
Right now you can just use the web-browser's standard bookmarking function to do this.

LONG ANSWER: 
Basically Twine exported HTML files add their history onto the current URL after the # (e.g. #m.12.98.56) - so as long as the bookmark records that information then the history is preserved.
When a Twine HTML starts up it detects the stuff after the # and internally/silently replays all passages in the history then displays the most recent one. This is done to restore the variable state as near as possible.
One weakness is that the stuff after # is basically just a .dot delimited list of passage numbers in base36 format. Those passage numbers change pretty much whenever the HTML file is regenerated from Twine. There is already agreement on creating a permanent id system - but that requires changes to the .twee and .tws file formats so will be delayed for a little bit.

If there is call then we can create a system that uses HTML5 localStorage to explicitly save the variables and passage history. I'm going to need to myself eventually for a couple of generative story projects I have in mind later - so this is on my list by way down in priority. If enough users want this functionality then I can prioritise it higher.

--Stormrose

Stormrose

unread,
May 4, 2012, 8:55:46 PM5/4/12
to twee...@googlegroups.com
I apologise... the browser bookmark method only works with the Sugarcane storyformat. I'll add an issue for the coders to add it to Jonah.

--Stormrose

On Saturday, May 5, 2012 12:41:26 PM UTC+12, Stormrose wrote:
Right now you can just use the web-browser's standard bookmarking function to do this.

Mehmet

unread,
Jun 16, 2012, 10:41:32 AM6/16/12
to Tweecode / Twine
Hi all, I have discovered Twine a few days ago and been palying around
with it since then. I love it! But I noticed bookmarking doesn't work
with Jonah format. Could we see a fix for this in the near future or
is there a short term hotfix or something to save the state of the
story in Jonah?

In any case, great tool. Thanks a lot!

Mehmet

unread,
Jun 19, 2012, 7:13:21 AM6/19/12
to twee...@googlegroups.com
OK, as it turns out, there is way to save and restore your progress in Jonah, but it is not so pretty.

Here is how;
1. Just bookmark a passage in Jonah.
2. Some new characters will be added to the end of the adress like file:///...story.html#3.1.5. Copy that whole adress.
3. Close the story. Re-open it. Paste the new adress. Enter. And your story state is restored. Remembered variables are properly remembered too.

Anyway, if there is a better way, let me know.
Reply all
Reply to author
Forward
0 new messages