How do I get Parchment working?

Hi Garry,

I don’t know if you’ve tried this already, but I got it to work using these steps:

(Sorry if I’m over-explicit in some steps, but I guess this could also benefit others who find this thread later).

  1. Install Inform 7.

  2. Download the zipped “Parchment for I7” from the “ifcomp” branch of the repo: https://github.com/curiousdannii/parchment/raw/ifcomp/dist/inform7/parchment-for-inform7.zip

  3. Make a minimal new I7 project, let’s call it “TestProject”:

Release along with the "Parchment" interpreter.

The Lab is a room.

(But don’t release yet.)

  1. Edited to add: Create a Templates subdirectory in your project’s Materials directory. (thanks to Garry for pointing this out below)
    Unzip parchment-for-inform7.zip into that Templates directory, so that you now have: TestProject.materials\Templates\Parchment

  2. Release the game in Inform 7. A directory called TestProject.materials\Release will be created, which contains index.html and play.html and a subdirectory “interpreter”.

  3. Download zarf’s script from here: quixe/game2js.py at master · erkyrath/quixe · GitHub and save it into the directory where your real game file (let’s say it’s called yourgame.z5) is.

  4. Go to that directory and execute:
    python game2js.py yourgame.z5 > yourgame.z5.js

Important: We don’t use the --giload argument on the command line here, because that’s for a slightly different way of including the game file later, see the comments in the python script. (Depending on what we do later, including the file resulting from --giload would result in the “String contains an invalid character” error that you mention.)

I was initially confused by this as well, due to this post Parchment for Noobs - #4 by zarf
where zarf gives an example with the --giload argument.

  1. Copy yourgame.z5.js into the directory TestProject.materials\Release\interpreter. (And delete the file TestProject.gblorb.js.)

  2. Open play.html in TestProject.materials\Release with a text editor and replace the game’s filename, so the lines:

parchment_options = {
default_story: [ "interpreter/TestProject.gblorb.js" ],
lib_path: 'interpreter/',
};

become:

parchment_options = {
default_story: [ "interpreter/yourgame.z5.js" ],
lib_path: 'interpreter/',
};

And that should be it!

Apologies if you tried this already, but I thought I’d share how I got it to work. (I tried it with devours.z5, a game from the IF archive.)

Hope this helps!

4 Likes