Running Javascript based on variables in Inform 7 / Bisquixe / Glulx ?

Im working with a friend of mine who is looking to make awesome ways that my IF can interact with the browser, his question is we are looking for an explanation of how to run JS using variables and changes in inform

essentially making things happen in browser based off what the game is doing!

I have added sounds and figures and seen basic screen effects by emily short etc but we were wondering how you make a javascript id or tag within events in inform for it to find and reference

update: we’ve ended up just making text print tags such as “*EXAMPLETAG*” and when it is detected by the script hiding it by using italics (because it already has a css class assigned to it) as a detection to hide the text visually.

That works.

A more sophisticated plan is to modify the interpreter to watch specific memory locations. This requires some I6-level hacking though.

(Example: In Advent Mirror on my web site, if you type BREAK VASE the window changes color.)

The full-on bells-and-whistles tool for this sort of thing is Vorple.

2 Likes

Yeah, Vorple is pretty much exactly what you’re looking for. It lets the game send strings of JS to the browser, which sends back the results.

yeah so with our method we ran into a detection issue where because bisquixe and the webpage constantly reprints everything it cant tell when we do the same function twice and wont let us detect the second input so we may incorporate vorple instead

1 Like

You can experiment with Vorple on the borogove.io website, which is an online compiler and publishing platform for several parser languages (no money or advertising anything, just convenience).

1 Like

awesome! we managed to host it privately for now using a local server and plugin with VSCode for now :slight_smile:

1 Like