Parchment Problems!

Parchment doesn’t work for me locally, either on Windows 10 or Linux Mint 19. Whatever game example from the GitHub site is used, I get …

An error occurred:

Parchment could not load the story. Check your connection, and that the URL is correct.


1 Like

Can you check the browser’s console for errors, which should give more information? The console can be opened with ctrl-shift-J in Chrome and with F12 on most other browsers. It should show something like this:

1 Like

This looks like it could be pertinent but I’ve no idea what a CORS request is.

Cross-Origin Request Blocked: The Same Origin Policy disallows reading the
remote resource at
file:///D:/Alex/Desktop/parchment-master/stories/troll.zblorb.
(Reason: CORS request not http).

This may help: https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS/Errors/CORSRequestNotHttp

1 Like

When you open HTML files directly from the filesystem, for security purposes the browser restricts what the page can do. In this case you can’t load files dynamically from the filesystem.

You can either install a local server (I wrote some instructions here) or convert the story files to base64 and load them directly as Javascript files (not sure if that process is documented anywhere.)

2 Likes

I see that Inform 7 generated play pages still work. Maybe I could use one of those as an example.

If you can encode it in base64 then you just wrap it like this:

processBase64Zcode('BASE64CODE')

And save as a .js file.

1 Like

One-liner for Linux:

echo "processBase64Zcode('$(base64 -w 0 story.z8)')" > story.js

(where story.z8 is the name of the story file)

4 Likes

There’s also this python script that Zarf wrote that does the same thing.

https://eblong.com/zarf/glulx/quixe/quixe/tools/game2js.py

2 Likes

OK. This works for me.

<script>
    parchment_options = {
        default_story: "stories/curses.z5.js",
        width: 80
    };
</script>
1 Like

I already have game2js.py. Thanks for the link though.

Thanks for all the advice guys. I think it’s working now.

1 Like

The status line isn’t reproduced for z3 games though. Sorry if this is already known.

I think it’s fixed upstream in ZVM, but the Parchment repository needs a fair amount of work. Sorry.

1 Like

I think you’re right. The version of ZVM used by Lectrote doesn’t have this problem. Thanks again for your help. :slightly_smiling_face:

Hi all,

Sorry for late reply, I wasn’t sure I should make a new thread or not. Let me know if so.

Parchment is also not working for me! I want to use it since I have pictures for my IF. I downloaded python and ran the script, but it’s still just stuck forever loading when I try to open it in browser. Not sure if I ran the script right.

One of the errors, which is unrelated to the python script I think(?), I get back in Chrome is

interpreter/glkote.min.js net::ERR_FILE_NOT_FOUND

I get this right after Releasing on Inform 7, not even messing around trying to fix it. I have the latest version of Parchment in my template folder. Not sure where to get this file, if it’s named incorrectly by the program, or what…

Thanks for any help

The Parchment Inform template assumes that it will only be used for Z-Machine games. For Glulx you’ll have to include more files, such as glkote.min.js, and edit the (manifest).txt file so that the new files are listed at the end of the manifest. The files are in the lib folder of Parchment’s source code.

It might be easier to update Quixe instead, if I recall correctly the version of Quixe that comes with the Inform 7 installation doesn’t support pictures, but the latest version does.

4 Likes

THANK YOU! I had no idea this needed to be done, I appreciate the help!