Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Accessing Sugarcube story across Mac and Windows

Hi all,

Short version: Can I open up the same tws file on both Mac and Windows if I'm using Sugarcube?

Long version:

I'm using Sugarcube with Twine 1.4.2. I normally work on my Macbook but today I felt like working on my Twine game on my Windows desktop. I dropped the Twine into Dropbox, but when I open the tws file on Windows I'm getting this error message:

An error occurred while opening your story.

Traceback (most recent call last):

File ", line 103, in open
File "storyframe.pyo", line 32, in __init__
File "storyframe.pyo", line 1122, in setTarget
KeyError: ""

I'm pretty sure I installed Sugarcube correctly on Windows; I can see Sugarcube from the Story Formats list and it seems I can make a Sugarcube story just fine on my Windows machine. In fact, I made a brand new Sugarcube Twine on my Windows machine, then placed it in Dropbox. When I try to open the new Twine game on my Mac, I get a similar error message:

An error occurred while opening your story.

Traceback (most recent call last):

File "/Users/myname/Desktop/twine_1.4.2_osx/", line 103, in open
File "storyframe.pyo", line 32, in __init__
File "storyframe.pyo", line 1114, in setTarget
KeyError: "sugarcube-2"

So, do any Sugarcube wizards know what's causing this error and how I can fix it?

Thanks for you help!


  • The KeyError, which differs slightly between the two, may be a hint.

    What is the name of the SugarCube v2 install directory, within Twine's targets directory, under each macOS and Windows? In both cases it should simply be "sugarcube-2" (no quotes).

    Additionally, the SugarCube v2 install directory for each should contain a file named "" (no quotes).
  • I believe I've set them both up correctly. Here are screenshots so you can see the names of the files/folders. With them named liked this, I can make Sugarcube stories on both machines, I just can't open a Sugarcube tws file made in Windows on my Mac or vice versa.
    <img src=""; />

    <img src=""; />

    <img src=""; />

    <img src=""; />

    Thanks for your help :smile:
  • Can you check to see if the dash (minus sign) character contained in both of the sugarcube-2 folder names are both a standard ASCII dash (minus sign on keyboard) and not one of the extended dash characters.
  • Yep, I just confirmed that all of the file and folder names use the hyphen-minus sign (like on a keyboard, specifically unicode U+002D) and not some other character.

    Thanks for helping :smile:
  • What happened to the Twine 1 vanilla story formats on your macOS install? I ask, because they seem to be missing from the targets directory in your macOS screenshot.

    Also. Could you please make a sample project in both macOS and Windows, using SugarCube v2, and attach the TWS files here so that we may inspect them. They don't have to be anything special, the equivalent of "Hello World" would suffice.
  • edited January 2017
    I've attached the two Twine games. I just checked and these fresh new Twines still exhibit the same problem.

    Also, regarding the targets folder on Mac: Do you have a Mac? What's happening is that on the Mac there is a folder that has the Twine app and next to the app is a targets folder (with the little "about this folder" text document). If you right click on the Twine app and click "show package contents," you'll find several folders including a "targets" folder that has the vanilla story formats. I just downloaded it again to make sure I hadn't done anything weird with the install folder, but nope, it's just that way: two targets folder. The one with the vanilla formats is just more hidden within the Mac app.
  • It's about what I expected, based on the KeyError.

    For reasons unbeknownst to me, the macOS version of Twine 1 stores the story format's name/ID with .py appended to it—i.e. Windows TWS contains sugarcube-2, while macOS TWS contains That is, obviously, an error.

    I wonder if the erroneous story format name is stored in the compiled HTML when compiled by Twine 1 for macOS. Hmm.

    Regardless. I've created a new issue on the tweecode/twine issue tracker: [macOS] Pickled TWS contains improper story format name. You may wish to add a summary yourself, including your macOS version and any details you think might help, and attach the two TWS files for study.
  • edited January 2017
    I see. I can actually open the tws file in a text editor and add/remove the .py and then it opens up as expected. That's a workaround for the time being.

    Thanks for your help!
Sign In or Register to comment.