+1 vote
by (1.3k points)

When I try to start a saved game, I'm getting a dialogue box with this error:

Sorry to interrupt, but this page's code has got itself in a mess. 
TypeError: Cannot read property 'get' of undefined
    at Object.showPassage 
(This is probably due to a bug in the Twine game engine.)

Here is the code for the link I'm clicking:

(if: (saved-games:) contains "File A")[(link: "Continue Game")[(load-game: "File A")] ]
(else: )[ (goto: "begin")]

This is causing Twine to crash.

Any ideas what I'm doing wrong?

Twine 2.0.11, Harlowe 1.2.2.

1 Answer

0 votes
by (153k points)
selected by
 
Best answer

WARNING: The following statement is based on information gathered from looking at the source code of the Harlowe story format and may be out of date if that source code has changed since I last looked at it.

Unfortunately saves created with Harlowe are currently not unique to a particular story/game(1) except if the name given to the 'slot' itself is unique. This means that a save created in one story can be loaded within another, and this can lead to issues if the save contains information that is not valid within the story it's being loaded into.

eg. The save references a Passage that does not exist within the current story HTML file.

This same issue can occur when a save created in one version of a story is loaded in a different version of the same story, especially if Passage Names or Story Variables have been renamed or removed.

Is it possible that either of the above situations has occurred for you?

(1) They are mean to be as Harlowe generates a "unique key" to story the saves against, but unfortunately the code that associates the unique key with the internal ID of a save does not work correctly. Also the unique key is the same across all versions of the same story.

by (1.3k points)
Thanks for this information. I think I may have found a way around the problem--I adjusted how I was implementing the save and the error hasn't happened again. So hopefully that will do for now.
Welcome to Twine Q&A, where you can ask questions and receive answers from other members of the community.

You can also find hints and information on Twine on the official wiki and the old forums archive.

See a spam question? Flag it instead of downvoting. A question flagged enough times will automatically be hidden while moderators review it.
...