Howdy, Stranger!

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

SugarCube 2 not rendering newly-created stories

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

  • I'm going with the obvious here...

    Have you tried saving your stories somewhere safe, and doing a clean install?
  • Something probably got screwed up with the deleting/readding rigamarole (yes, it's a word; see: rigmarole/rigamarole). I'll second Rafe's suggestion to do a clean install. You could also fix it by editing the Twine 2 data to iron out whatever is busted, but that's a pain in the arse (and you'd have to know what to look for anyway or be able to figure it out). Best simply to nuke it from orbit and start over.

    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.
  • edited June 2015
    Well.... still nothing.

    My steps in order:
    1. Archived. 
    2. Then F12'd. 
    3. Then I changed one line in Twine.js (as per my usual upgrade steps) to "storyformats/SugarCube/format.js" because I use everything locally.
    4. Then I reimported the archive.
    5. Then I tested the broken story ( the one with only random letters in it) still broken in SugarCube.
    6. Then I deleted that one and made a new one with just 2 or 3 keystrokes in it.
    7. Then retested.
    -- --Still works in Harlowe.
    -- --Still does not in SugarCube.
    

    My set up:
    —SugarCube 2 (local/offline) 2.0.0-beta.4 
    —Harlowe 1.1.0-beta
    —Twine Browser download version 2.0.6
    —Lubuntu 15.04
    —Google Chrome Version 43.0.2357.124 (64-bit)
    

    EDIT/Note: All previously created SugarCube stories work just fine. It's only the new ones that don't.
  • edited June 2015
    Well... as a last-ditch effort, I have included a zip with my Twine stuff. It has one SugarCube file (so that you can see that the existing stories work just fine, but the newly added ones do not).

    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).
  • Sage wrote: »
    Well... as a last-ditch effort, I have included a zip with my Twine stuff.
    Where would that be?
  • Earlier, I forgot to attach. This time I might be having internet issues. Man! The luck (or lack thereof).
  • edited June 2015
    I'm still not seeing an attachment, @Sage.

    EDIT: I just tested, and both my .rar and .zip attachments showed up.
  • FINALLY !!!!

    I never did get the upload to work, but I put it here:
    http://superheropress.com/TWINE.zip
  • PS, As a workaround, I notice that if I DUPLICATE a SugarCube story... it works fine. So I can still create projects. But it would be nice to not have to take that extra step.

    Here is the file link:
    http://superheropress.com/TWINE.zip
  • You could as another workaround switch to 1.4.2 if the online browser functionality isn't important.
  • It's an idea, for sure. But I'm thinking that since it renders copies of stories (but not new ones) and those copies are not marked with my installed version of SugarCube, that it simply means they are using a version being linked to, but not specified. If that makes sense.

    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.
  • edited June 2015
    One of the places the story format name "value" gets determined and set is line 110 and line 47 in the twinejs/js/views/storyeditview/modals/storyformatmodal.js file. The "value" being assigned as the story format's name appears to be the value of the selected button's data-format attribute.

    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.
  • edited June 2015
    @TheMadExile

    I have fixed it by changing literally ONE THING in the SugarCube/format.js.

    Where once I had this:
    window.storyFormat({"name":"SugarCube 2 (local/offline)","version":"2.0.0-beta.4","description":"A Twine 2 port of the Twine 1 story format by the same name.  See its <a
    

    When I changed it to this:
    window.storyFormat({"name":"SugarCube","version":"2.0.0-beta.4","description":"A Twine 2 port of the Twine 1 story format by the same name.  See its <a
    

    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.
  • Sage wrote: »
    @TheMadExile

    I have fixed it by changing literally ONE THING in the SugarCube/format.js.

    […]

    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.
    Unless you've also removed the built-in version of SugarCube, which most are not likely to do, you're just shifting where the problem lies.
  • I do remove it, because I use the one that is completely offline (I got it from you earlier).
  • Sage wrote: »
    I do remove it, because I use the one that is completely offline (I got it from you earlier).
    If you're talking about a older version of SugarCube 1, then, again, you're just shifting where the problem lies.

    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).
  • Well... unless you have found something different in the TWINE package I linked to, I have found no other way to resolve the problem, so I am just glad that it works.

    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.
  • @Sage
    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.
    spending time on something that only affects the one person who errantly tried to move everything to function as a local copy
    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.
  • Oh. Now I get it! Thanks.
  • One use case I forgot to mention in my previous post is the case of someone else debugging your story. (either because you asked them to or just because they want to)

    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.
  • Well... if I understand both you and TME correctly (and let's face it, I may not), there may not be any other way around it.

    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.
  • Sage wrote: »
    Well... if I understand both you and TME correctly (and let's face it, I may not), there may not be any other way around it.

    Didn't you both say (or imply) that it was a problem with Twine that hasn't been sorted out yet by the makers?
    Twine 2's current handling of story formats is not entirely robust, yes. However, you should not be having these issues. There should have been no reason that stories, new or otherwise, shouldn't have worked after you (re)set their story format. The reason that happened is, very likely, because of your modifications to your Twine 2 install (figuratively speaking, it really doesn't take much to blow Twine 2's mind). Since then, all you've done is shift the problem around enough so that it has started working again for you (it's not a general solution because your problem isn't entirely general).

    Sage wrote: »
    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.
  • That makes sense. And it's a complete enough answer so that I can fix it properly.
    I'll go after it again today after I wrap a bunch of other projects.

    Thanks.
Sign In or Register to comment.