Twine saves across devices?

Twine Version:
[2.3.9 with Harlowe]

We’re creating an educational game to support a nonlinear hands-on lab. We’re concerned that the lesson may require multiple class periods to complete it, so being able to save and load progress is essential. The Save/Load macro seems to work with cookies. This is problematic, as multiple classes of students may use the same laptop and one student might use 2 different devices across days.

So…has anyone seen an implementation of Save through a URL, like the way Google Maps and many APIs work? i.e. where we could stringify the Save State JSON and append it to the app URL, allowing one to create an emailable save game link?

Thanks in advance!

1 Like

I’ve never seen this with a Harlowe story before. Never even heard of it with any other story format in Twine, to be honest. But that doesn’t mean it’s not possible.

There is this custom macro API that wil give you pseudo-access to the Harlowe API in an unofficial manner. Harlowe is a closed system. SugarCube, and Snowman are purposely open to customization.

If that custom macro link doesn’t help, we might be able to figure out a poor man’s method of making this URL save link work.

1.) Do you use the “back link” in Harlowe? Do we need to keep the history of passages visited intact? …or will simply knowing the last passage visited suffice?

2.) Do you use story variables that are tracked in the project? Are they simple strings and numbers? …or are they more complex, like date/time, arrays, datamaps, etc?

3.) Do you want the game-state reset after the student generates the URL data link?

4.) Are you comfortable with JavaScript?

Without an extensive knowledge of Harlowe, I’m thinking about just reading the URL with JavaScript. If it contains a data-string, process it manually and set any variables as needed. Harlowe only works with JavaScript in a very basic way, but it does allow you to deal with state variables directly. I’m not sure if you can really edit the history string, though you can add fake passages to it. You have your work cut out for you, is what I’m saying. :upside_down_face:

SugarCube allows for Import/Export to Disk to use saves from one device to another. It’s a built-in feature.
Unsure about Snowman.


warning: Harlowe has been deliberately designed to limit an Author’s ability to use JavaScript to extend the functionality of either their project, or of the Harlowe runtime engine itself. And Harlowe doesn’t have a documented JavaScript API, so any such extending will like required reviewing the engine’s source code and the usage of “hacking” techniques like Scope Escalation, which is generally how Harlowe third-party addons do what they do,

HAL9000 has already supplied a link to Chapel’s discontinued Harlowe Macro API third-party addon, which hasn’t been updated in 3 years.

Another potential third-party addon that might be useful is Kajot-dev’s Harlowe Save To File Utility project, which includes macros for save & loading State data to/from file.

And according to comments on it’s repository it was updated 5 months ago to support Harlowe v3.3.7, which is only one minor version behind the current v3.3.8 release of Harlowe 3.x

1 Like