Howdy, Stranger!

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

Error building story

I'm trying out my first story, which I was planning on having a lot of GIFs in. I imported all my GIFs first and wrote a test page, but when I try testing it out I get this error:

File "storyframe.pyo", line 907, in rebuild
File "Tiddlywiki.pyo", line 189, in toHtml
MemoryError

I'm guessing it has something to do with my GIFs, if I remove pretty much all of them then it doesn't give the error... but even then it just brings up my browser and says it could not find the page. I have about 170 GIFs, project file is about 346MB. If I make a new project and test it without changing anything, it's able to load up in the browser properly.

I'm using the PC version of Twine 1.4.2

Comments

  • Currently, Twine 1 starts getting iffy for building projects at around the 75100 MiB mark and the absolute maximum is probably only about 5075 MiB more than that (the exact points depend on the author's system specs).  I have doubts that a 200+ MiB project would build at all, let alone a 300+ MiB one.

    So, yeah, that project is probably not happening as-is in Twine 1 (or 2).

    Must the images be embedded or could they simply be included with the HTML file (i.e. archived with it as a pack)?
  • Well, that's just balls. Do you know anything about why it starts to fail? My system spec is far more than one would think necessary for the task, it's a rather high end workstation. I have seen a GIF heavy story that was 400MB and made in Twine... actually it says Twine & Sugarcube. Not sure what that would be for(again, my first trying any of this), or would archiving it as a pack would be. Searching the wiki and I only see archive mentioned in relation to the web version of Twine.
  • mindfuldirt wrote:

    Do you know anything about why it starts to fail?

    When Twine builds your story it uses a single Python Unicode String variable to stores the contents of all your passages (including images) before writing it to a file, while doing this it is also encoding each of the passage's text as Unicode if needed. Somewhere in those two processes Python runs out of memory.

    [quote author=mindfuldirt]
    Not sure what that would be for(again, my first trying any of this), or would archiving it as a pack would be.

    In this context "archived with it as a pack" means store the HTML and external image files in something like a ZIP or RAR file.
    Twine itself does not create these types of files, you would use third-party software to create the archive file.
  • mindfuldirt wrote:

    Not sure what that would be for(again, my first trying any of this), or would archiving it as a pack would be.


    If the images are external to the HTML (not embedded within it) and referenced by relative paths, then Twine wouldn't have trouble building your project.  The point of archiving (zip, 7z, etc.) the compiled HTML and it's attendant images is to make it easier to download them all together (since the images wouldn't be embedded, you'd have to make them available somehow).
  • So I'm still not entirely certain as to the actual how of this method. Is this just what it does automatically if I drag and drop images into Twine as opposed to importing from URL?
  • The drag-n-drop image, the Story > Import Image > ... menu item, and answering YES to the "Do you want to import the image" question when closing the Passage Editor all do the same thing, they add an Image Passage to your story with the contents of the image file contained inside that passage.

    What you want to do instead is to create a sub-directory / sub-folder (eg. images) below the directory / folder you are storing your story TWS and story HTML files in, and use this sub-directory / sub-folder to store your image files in.
    Once you have done that you change the image markup in your passages to reference these files, remember to answer NO to the "Do you want to import the image" question when closing the Passage Editor.

    [img[images/someimage.png]]
  • Understood, thank you!
Sign In or Register to comment.