Vorple and Api Calls

Hey there, first post here and newly minted member of the community. I’ve decided to use inform 7 as part of my bachelor’s thesis, “Developing an IF project with modern tools”. An extension of said tools is hopefully going to be Vorple, which seems like a great way to spice up the capabilities of the authoring system. Still, i’ve seen a fairly limited amount of actual projects done with vorple, and i’m wondering how one would go about issuing an API call through the use of it. My programming background is mostly limited to Java, so learning Javascript is also a part of the process. I’d appreciate any pointers towards issuing the API call and processing the returned “object”, be it a string or hopefully, an image.
If i’ve missed an obvious resource due to my lacking google-fu, a simple link to a relevant project would also be much appreciated. Thanks!

1 Like

Are you talking about calling JavaScript functions directly from I7? It looks like it’s execute JavaScript command "blah blah blah" and then getting the result with the value returned by the JavaScript command (from the Executing JavaScript code section of the Vorple docs).

2 Likes

Hah, the simplicity of your answer makes me think that i just need to spend more time familiarising myself with the tools themselves. The fast answer is much appreciated!

1 Like

Continuing off of this a (long) while later, i’m struggling somewhat with running some of the example content on Vorple. To be more specific, from the sum of human knowledge part of The main Vorple extension · Vorple
Tried to run this both off of borogrove and locally with nginx and vorple installed, not quite sure what i could be doing wrong. Borogrove does not understand the wikipedia query, as in it can not read the function from the .js file in the file manager.
On the other hand in the actual IDE, i get an error from the “carry out looking” part, not understanding the when/while clause. I’ll include the actual code just in case i’m doing something obviously dumb.

"wikitest" by GJM
Include Vorple by Juhana Leinonen.
Release along with the "Vorple" interpreter.
Release along with JavaScript "encyclopedia.js".


Library is a room. "The shelves are filled with volumes of an encyclopedia. You can look up any topic you want."

Looking up is an action applying to one topic.
Understand "look up [text]" as looking up.

Carry out looking up when Vorple is supported:
	place a block level element called "dictionary-entry";      
	execute JavaScript command "wikipedia_query('[escaped topic understood]')";
	
Report looking up when Vorple is not supported:
	say "You find the correct volume and learn about [topic understood].".
	
Test me with "look up ducks / look up mars / look up interactive fiction".

Sidenotes:
The download link at Installing Vorple for Inform 7 · Vorple is dead, might need to be relinked to Vorple · User Interface Library for Interactive Fiction

I’ve slowly shifted over to the actual development phase of my project, would i need to make another post to hopefully recruit willing souls to the playtesting?

Thanks again!

2 Likes

The example from the documentation works for me, both with I7 6M62 / Vorple 3.2.3 and with I7 10.1.2 / Vorple 4.0.1.

In the IDE interpreter, the “Report looking up ...” rule is supposed to run, because Vorple is not supported there. This error, though:

… seems to indicate that Inform didn’t properly include Vorple at all and therefore doesn’t understand the condition. I can reproduce that error when I comment out the “Include Vorple ...” line, so maybe the extension somehow wasn’t included correctly (although that’s strange because Inform should have complained if it couldn’t find it, for example).

Ah, wait… if that’s the verbatim code you have, then the culprit is a missing blank line after the title. That produces the same error. So insert a blank line / paragraph break after the title, like in the original example:

"Title" by Author

Include Vorple by Juhana Leinonen.
[...]

That should fix it.

2 Likes

That did, indeed, fix it, much, much appreciated!

2 Likes