Parchment for Noobs

Hi :slightly_smiling_face::v:

@Dannii … Can you assist a Parchment noob please?

What I would like to do is host my own site and then have game pages (my own respectively) and have the games playable by Parchment. I’ve seen this done on Adam Cadre’s website for example.

Do I download and then upload to my server? Do I need to edit any config files? Where do I store my .z5 game and where does the name of the game go in the script files?

Is there a noob friendly step-by-step I could follow please?

Thanks!

Adam

1 Like

Are you just wanting to make your Z-Code or Glulx game available to play online, or do you want to have a local installation so that you can customise it etc?

If the first, then just upload the storyfile somewhere, and then add the URL to the end of https://iplayif.com/?story=

If the second, then you can get the code from Github (I recommend the ifcomp branch, though be warned, the rewrite is still a work in progress) and edit index.html to specify where your storyfile is:

        parchment_options = {
            default_story: [ "URL" ],
        };
1 Like

Thanks @Dannii

Ideally I would like to add the code to my own webpage so I can customise, so I’ll download and edit the file location.

Thank you!

Another way to do this is to create a trivial I7 game:

The Kitchen is a room.

Release along with an interpreter.

Set the project to zcode/glulx and hit Release. You can then copy out the generated web site (starting with play.html) and replace the game file.

Replacing the game file is a slight nuisance since you have to base64-encode the game file. I use this Python script:

https://github.com/erkyrath/quixe/blob/master/tools/game2js.py

Like this:

game2js.py --giload MyGame.gblorb  > test.materials/Release/interpreter/Test.gblorb.js

…or, for Z-code,

game2js.py --giload MyGame.zblorb  > test.materials/Release/interpreter/Test.zblorb.js

This overwrites the encoded game file, and the release directory will now play MyGame.

(The game you write in doesn’t actually have to be blorbed up. A bare .ulx or .z8 file will work equally well.)

2 Likes

(Sheesh, that’s still a Python 2 script. I should update that.)

(EDIT: Ha, sorry, I was looking at the wrong file. Already Py3-compatible!)

You can also use this online tool: https://iplayif.com/tools/zcode2js.html

But, this is only necessary for the Inform 7 tool as it is designed for playing off a local file:// URL. If you intend to upload your copy of Parchment to be played online, you no longer need to convert it to Javascript, you can just point to the file directly.

2 Likes

Thanks all :v::slightly_smiling_face::+1:

Did you ever get this working? I’ve literally spent a whole day trying to get Parchment working without any luck.

What are your difficulties? Parchment has been on my server for a long time and I can easily run the games without any problem (you have to reduce the number of characters per line with parchment_options for a more comfortable reading).

I think Garry’s difficulties are chronicled here:

1 Like

Thank you. I had an old version that used parchment.min.js but I managed to get it to work with the latest version.

Correct. Several others on the PunyInform Discord sever were also having problems getting this working. It has now been resolved in the other thread. You can always (well, nearly always) rely on the lovely people here to answer the difficult questions.

The solution has got to be the most convoluted process that I’ve ever come across. I’m sure the mission to Mars was simpler. :grinning:

Zarf’s new tool is great… once you’ve installed Python.