0 votes
by (220 points)
I'm new to Twine and not CSS literate. I want to import Twine 2 games or books found online into the Editor (local or online) so I can study them as I learn Twine. I know about Archive and Import and how the files are automatically saved in the browser. And I can save my own creations. But I cannot figure out how to import into Twine 2 (Harlowe). I an using an html file I downloaded. I click Import from File, select the file, and nothing happens.

So, how do I find Twine 2 code to study and how do I get it into Twine? BTW I can PLAY the files on philome.la, but is there a way to get the file that can be edited? (Can I still call it the source code?)

1 Answer

0 votes
by (159k points)
edited by

You didn't supply a link to the Harlowe story HTML file you're trying to import so I was unable to test to see if the issue is the story HTML file itself.

The Import From File is the correct option to use to import a story HTML file (created via the Publish to File option) or an archive HTML file(created via the Archive option), or even a project HTML file (like those created in the folder accessed by the Show Library option of the install-able release) it will not import the contents of a project HTML file which is what the Install-able release uses internally to save a project's data. 
edit: I was mistaken about project HTML files..

A story HTML file generally contains all the source code (Passages) of a Twine project embedded within it, and you can use the relevant Twine application's Import feature to recreate the project from the story HTML file.

eg. If the story HTML file was created using the Twine 1 application then you would use the Twine 1 application's Import feature, the same relationship is true if the story HTML file was created using the Twine 2 application.

by (68.6k points)

[…]  it will not import the contents of a project HTML file which is what the Install-able release uses internally to save a project's data.

That is incorrect, actually.  Twine 2 can, and will, import story project data files just fine.

The only difference between the Story Library Archive files (created via the Archive button in the sidebar) and the executable release's Story Project Data files (stored in your document's Twine/Stories directory) is that the former contains multiple story projects.  In both cases, what is actually stored within the files is the exact same data chunk that is injected into Compiled Story files.

In summary, it doesn't matter what type of file it is, if it was generated by Twine 2, then it should be able to be imported by Twine 2.

If you do run into a situation where Twine 2 will not import a file created by Twine 2, regardless of its type, then it's likely a version compatibility issue—i.e. the version of Twine 2 you're using is incompatible with the format of the file you're attempting to import.  The format of Twine 2's data chunk has changed slightly over the course of Twine 2's public releases and Twine 2's import code has not always been as robust as it should have been—IIRC, there have also been a few bugs in that area in past releases.

...