Vorple for I6!

You might have seen it on Twitter already, but I’ll announce it more formally here: Inform 6 libraries for Vorple are now available!

You can now use all the power of Juhana’s awesome library for your I6 games; you need to use the Vorple interpreter (bundled with the libraries) to get all the effects (pictures, sounds, videos, hyperlinks, notifications, tooltips, text styles, and much more if you embed your own JavaScript scripts!), but the game will play normally on a regular interpreter. There are a dozen examples to get you started and show off Vorple’s capabilities, along with I6 source code.

The repository is on my Bitbucket; let me know if you have any comments or bug reports!

I hope this will be of use to authors; I’m planning on writing a full game that uses Vorple pretty soon, and its source will be released to help authors make their own games!

Cool! Since z8 is beginning to feel like a tight fit for a reasonably-sized I7 project, this is great news for those of us who like multimedia parser games and prefer to write in Inform.

Amazing good news!

How does vorple exactly work?

I mean, I know what it does, but how does the Inform libraries communicate with the interpreter. Is some kind of encoded text or character that makes the interpreter understand there is a Vorple call and execute it? If so, how do games made with Vorple work on those interpreters without Vorple? Is checking for Vorple interpreter requiered or you can just include it and other interpreters will ignore it?

All this questions are being made cause I’m considering adding Vorple support to ngPAWS, via a ngPAWS plugin. Is not that ngPAWS actually needs it a lot, cause most features provided by Vorple are already supportd by ngPAWS natively, but I think having Vorple compatibility may help some users that are already used to Vorple to do things easier. Also, I would like to give my support to Vorple, one of the best IF tools known in years, and I think adding supoprt for ngPAWS, even if no one ever uses it, is my two cents.

I think as ngPAWS suports sequence tags, that is, accepts including special tags in the texts that are interpreted in a different way (i.e “There is {ACTION|examine lamp|a lamp} here.” will generate a text with a link over “lamp” word that when clicked will trigger the “examine lamp” order, that may be a good way to support vorple functions this way:

“You take a rabbit out of your hat.{Vorple|playMusic|tada.mp3|loop:false}”

In Z-machine Vorple uses Z-machine’s output streams. The story file can tell the interpreter which stream its output should be printed to (1=screen, 2=transcript etc.) Vorple uses stream 5 to output JavaScript commands and the interpreter evaluates all code it sees printed there. Stream 5 is not in the official Z-machine standard, so all offline interpreters just silently ignore anything that’s printed there. The plan for Glulx is similar but it will use Glk functions that are specifically reserved for this purpose. In addition the story file queries the interpreter for Vorple compatibility: if the interpreter doesn’t have the right flag set, the story file just disables Vorple features and replaces them with standard-compatible features or shows alternative content.

I don’t really know anything about ngPAWS, but at a very brief glance it looks like that it compiles directly into JavaScript? If that’s the case it shouldn’t be very hard to integrate it with Vorple: the Vorple JavaScript library is independent from the Z-machine interpreter so all you have to do is convert those tags into raw JavaScript and insert it to the correct place in the code. For some features it should be as easy as just calling the correct method (e.g. to play music just put the file in the right directory and “vorple.media.playMusic(“tada.mp3”);” is enough to play it) but for others you’ll need to write some connecting JavaScript code (e.g. hyperlinks that trigger commands need to know how to send the command back to the ngPAWS’s parsing engine.)

If you need further info or help with implementation, feel free to PM or email!

Thanks for your explanation, I din’t know about Z-machine streams.

Yes, ngPAWS compiles into javascript, and also accept javascript plugins, so including vorple may be just including vorple.js code into a plugin, together with some hooks that link with ngPAWS specific functions.

Your sample with hyperlinks is an obvious one, but also VorpleImage needs some connection, cause I guess ZMachine implementation adds the image to some specific element, either by name or ID, in the Parchment document, but ngPAWS document elements are probably not named the same.

I will continue via PM to avoid adding to much boring technical stuff here, not sure if I can do it today though :slight_smile: