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 "app.py, line 103, in open
File "storyframe.pyo", line 32, in __init__
File "storyframe.pyo", line 1122, in setTarget
KeyError: "sugarcube-2.py"
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/Twine.app/Contents/Resources/app.py", 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!
Comments
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 "sugarcube-2.py" (no quotes).
<img src="https://twinery.org/forum/uploads/Uploader/e7/38059e58189287726609f9087242e4.jpg" />
<img src="https://twinery.org/forum/uploads/Uploader/31/f8b02ac707b70c6cca260a87b5cc62.jpg" />
<img src="https://twinery.org/forum/uploads/Uploader/b8/f0c82937b3bff2686611592dd8c1fd.jpg" />
<img src="https://twinery.org/forum/uploads/Uploader/b9/a9655f02490484ec1905976b9589a2.jpg" />
Thanks for your help
Thanks for helping
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.
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.
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 sugarcube-2.py. 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.
Thanks for your help!