Howdy, Stranger!

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

Can I reference locally-stored files?

Hi all,

Newish to Twine and brand new to using the standalone application as opposed to the web version. When using the web version, I would include HTML in my passages that referred to local files to include graphics, CSS files, etc. and everything could therefore be run without an Internet connection. However, with the standalone version, I don't see where I can store the files so that HTML in my passages can find it.

For example, if I use Show Library, it reveals that my saved story file is in ~/Documents/Twine. If I throw a graphic file in there named test.jpg and include an <img src="test.jpg"> tag in my passage, when I play the passage, I get a broken graphic. Same if I use ./test.jpg, ~/Documents/Twine/test.jpg, or anything else I can think of, including the full file path from the root of the volume.

Since the Twine application renders the passage in its own window instead of in a browser, I can't look at the HTML source to see where it's expecting the file to be. (Is there a way to view HTML source that I'm missing, or a way to force the application to run a story in a browser instead?)

I'm using the Mac OS X version of 2.0.8 with Harlowe 1.1.1 on Mac OS X 10.8.5.

Many thanks!

hXj

Comments

  • Mac? No idea.

    Windows? Guess I still have no idea because I made a twine with one passage and one line:
    <img src="hello.png">
    

    I then put a "hello.png" in the following two directories since I wasn't sure which one it needed to be:
    C:\Users\Sharpe\AppData\Local\Twine\Downloads
    C:\Users\Sharpe\Documents\Twine\Stories
    

    Neither worked.

    I published it to my desktop and put the image there and it worked, so I just don't know.
  • edited July 2015
    AFAIK, Twine 2 currently builds your story, for Play/Debug, within your application data directory someplace, the location of which varies by OS. So, for the moment, your best option is probably simply to setup a location where you'll keep your assets and Publish to there for testing.

    A suggestion was made that Twine 2 should have some kind of Build/Test directory within its documents directory, with subdirectories based on story titles, where it would build each story, thus allowing developers a place to drop assets for testing. I don't know if the suggestion was considered, however, so….

    I haven't checked to see if there's an issue for this on the Twine 2 issue tracker. You may want to check and, if there's no existing issue, open one.
  • Oh boy. Guess I'll be sticking with the web version for the foreseeable future. (Luckily I guessed that I might be able to download it at http://twinery.org/downloads/twine_2.0.8.zip, based on the unpublicized web download link for the 2.0.6 release, and it worked!)

    I took a quick peek around the most likely application-specific locations for local storage, including inside the application bundle itself, and in ~/Library/Application Support/Twine, but with no luck. Using the downloaded web version, however, I simply copied my file directory into its home directory, and all my custom graphics, CSS files, JavaScript files, etc. suddenly worked just fine.

    I'll keep looking, and hoping that the application will eventually make its storage a little more transparent, or allow testing in a browser instead of only in-app.

    Many thanks for suggestions!
Sign In or Register to comment.