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).
-
Install Inform 7.
-
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
-
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.)
-
Edited to add: Create a
Templates
subdirectory in your project’sMaterials
directory. (thanks to Garry for pointing this out below)
Unzipparchment-for-inform7.zip
into thatTemplates
directory, so that you now have:TestProject.materials\Templates\Parchment
-
Release the game in Inform 7. A directory called
TestProject.materials\Release
will be created, which containsindex.html
andplay.html
and a subdirectory “interpreter
”. -
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. -
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.
-
Copy
yourgame.z5.js
into the directoryTestProject.materials\Release\interpreter
. (And delete the fileTestProject.gblorb.js
.) -
Open
play.html
inTestProject.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!