Hello everyone,
I am vaguely under the impression that someone mentioned this recently, but I can't find the post.
I use Twine 2, and SugarCube 2 (local/offline) 2.0.0-beta.4
When I create a new story it currently defaults to Harlowe because I have the 1.1 Beta release installed. I make that specific distinction because although I know it NORMALLY defaults to Harlowe anyway, I had it changed it prior because I ONLY work with SugarCube (I figured I would pick one and stick with it).
Anyway because of that choice, I made mine default to SugarCube.
Further, at one point I had even deleted the others because I never use them but.... as the IF gods would have it.... Sharpe had a contest and I wanted to play. So I added them back and I reset the default behavior back to set Harlowe as primary.
Still with me?
On top of that I figured that since I was adding them back I would go with the best and brightest, so I chose the Harlowe 1.1-beta.
These variables and history may not make any difference. But I wanted you to know the whole thing in case that helped to shine any light on the problem I am having.
The problem is this: When I make a new story... and just throw in some words, for example: shgdfkjhbfjksdhhfeqfbv and click on play, it works fine. It shows me a Harlowe game that works. (boring and incomprehensible, yes... but works)
When I change the story format to SugarCube (without changing literally anything else, just that one click), it no longer works.
So then I hit ctrl-A, to see if maybe the text is there but is in white (because I used bookish or bleached and NEVER the black default), and still... it is not there.
When I view the source code it is the standard "Welcome to Twine" rigmarole. (is that even a word? You would think I wouldn't use it if I don't know what it means, but I digress.)
Any help would be appreciated.
Comments
Have you tried saving your stories somewhere safe, and doing a clean install?
Which version of Twine 2 are you using?
If you're using one of the browser-based versions, then to do a clean install you really only need to purge all Twine 2 data in the browser (which can be done by following these instructions) after you've archived your stories first. After that, reinstall any non-built-in story formats.
For NW.js-based versions, I believe you probably only need to delete its local cache directory (in Windows it'll be someplace like %AppData%\Local\Twine\, not sure for other OSes) while Twine 2 is not running. After that, reinstall any non-built-in story formats.
My steps in order:
My set up:
EDIT/Note: All previously created SugarCube stories work just fine. It's only the new ones that don't.
Any help would be appreciated
PLUS: I figured out this and I assume it's important:
New stories that I make have a check-mark in the SugarCube box (once I set the story format) but the existing ones... meaning the ones that work.... do NOT currently have a check mark in that box.
To me that means they have some other SugarCube variant. But I don't know which.
@TheMadExile
I assume you are the only one who can help. Assuming also that you have the time (and desire-- haha).
EDIT: I just tested, and both my .rar and .zip attachments showed up.
I never did get the upload to work, but I put it here:
http://superheropress.com/TWINE.zip
Here is the file link:
http://superheropress.com/TWINE.zip
Which I think might be one line in Twine.js
And if this isn't the answer, then I think it is at least on the right track.
One place this story format name gets used is during the Publish to File action which can be seen in line 136 of the twinejs/js/models/story.js file.
So if the story format name "value" stored within your Story project does not equal one of the known story format names then it wont know which one to use. The story formats that come with Twine 2 have known hard-wired names, this may not be the case with the ones you manually install locally.
I have fixed it by changing literally ONE THING in the SugarCube/format.js.
Where once I had this:
When I changed it to this:
Everything worked fine.
Do I think this will help anyone else in the future? Probably not likely that someone will have this same problem. But I add it here for the sake of being complete.
As pointed out by greyelf, Twine 2 currently differentiates story formats solely by the name property of the format. You cannot have two formats with the same value for the name property and have it work correctly with both (even if they're simply two versions of the same format). In other words, if you have multiple copies of any story format installed (the mix doesn't matter; i.e. online vs. offline, v1 vs. v1.01 vs. v2, etc) all with the same name property, then when you attempt to do anything which requires Twine 2 to pick one (e.g. Test, Play, or Publish), you're at the mercy of the mechanics of how Twine 2 retrieves a story format in those instances (i.e. maybe you'll get the one you wanted, maybe not).
But I am also a realist.
Because you have created SugarCube, it seems likely to me that you would seek to support or resolve issues that might cause problems for a larger group of people rather than spending time on something that only affects the one person who errantly tried to move everything to function as a local copy.
My view is that it isn't that you don't WANT TO help, per se... just more like you need to prioritize your time.
So I took the only solution that I could make work: changing the first line of that file.
It's likely I did it wrong (or shifted the problem). I acknowledge that. Believe me if a solution comes down from on high (meaning a better programmer) psshht! I will jump on it.
I just figure we're all busy with stuff.
Having said that, I would not be HALF AS FAR AS I AM NOW if it wasn't for you guys! (and gals.)
So... really and truly... THANK YOU ALL.
TheMadExile and myself are trying to explain that the thing causing this issue is not the Story Format itself but how Twine 2 identifies a story format and it's different versions.
This same issue occurs if a user installs a second version of any story format not just SugarCube, and although your fix works for you (and anyone else that does the same fix) at the moment it will stop working as soon as there is a need to support more than a single version of a story format, which can/will happen when needs require changes to an older story written using an earlier version of a story format.
This issue has been spoken (here and here) about a number of time on the Twine 2 project site but as yet a solution has not been found/implemented.
You are not the only person who runs things locally but as I said above, the solution to this issue requires a change to Twine 2 itself and not SugarCube as such.
In the case where your story is built using a story format version that came bundled with one of the released versions of the Twine 2 application, then all the debugger needs to know is which version of Twine 2 you are using. It gets a little more complex if the bundled story format knows how to auto update itself from a web-server.
In the case where you story is using a manually installed released version of a story format then the debugger would need to know which version and more importantly exactly what you named it when you installed it, as this is what they are going to have to name it in their own version of Twine 2.
Your fix has made the situration more complex because you have renamed your copy of SugarCube 2 the same name as the 1.x version, so if anyone debugs your story they will be debugging against SugarCube 1 by default.
In the case where you are using your own built of a story format (or even of the Twine 2 application) then the debugger would need either a copy of your story format and what you named it, or a copy of your development environment.
Didn't you both say (or imply) that it was a problem with Twine that hasn't been sorted out yet by the makers?
Again, I may have misunderstood.
If I understood you correctly, though... that means that my workaround was the right way after all. I'm confused about it though because I know TME said all I did was shift the problem and not correct the problem.
The correct course of action should have been simply to use the Change Story Format story menu item in Twine 2 to switch the story format to the non-modified SugarCube 2 (though you would need to make an edit to the story afterwards, as Twine 2 seemingly does not resave the story if you just change the format). I know that works with a properly functioning Twine 2 install because I've tested it (n.b. tested in Twine 2.0.6).
That said, I don't think your Twine 2 install is properly functioning anymore, so the next best course of action would probably have been to edit each story (in the archive, before reimporting them, since you're using the browser-based version) and correct the used format there, so that it would point to the non-modified SugarCube 2 install (i.e. make the value of the story's format attribute the same as the name property of the story format). You did the reverse instead (which again, makes your solution specific to your install and its issues).
Again, Twine 2's current handling of story formats is not entirely robust, so it doesn't take much to corrupt its understanding of what formats it has installed. My guess is that by modifying your Twine 2 install, as you noted above, you've simply confused Twine 2. I cannot say more than that because I cannot see into the settings of your Twine 2 install.
I'll go after it again today after I wrap a bunch of other projects.
Thanks.