It looks like you're new here. If you want to get involved, click one of these buttons!
No, you're not reading that wrong!
I finally was able to get around to doing something I've always wanted to try. I used the Pas2JS transpiler to compile the Inspiration Pad engine to JavaScript. Not only did it compile, by golly it works! So, this means IPP generators can be run within a web page without a server-side script.
Check it out for yourself:
https://www.nbos.com/lab/ippjs/ippjs.html
Paste the full text of a generator in the box on the left (delete the sample table that's there now), and press go. That's it. Note that because this is running in-browser, the generators need to be fully self contained, and can't use any "Uses:" statements to bring in other files. Use File-Export from the menu in Inspiration Pad Pro to save a fully self contained generator file.
I've attached one of the more complex generators I've made, and it seems to run perfectly. Try pasting the contents of that into the left box and test it out!
The IP for JS API itself is very simple, its just a single function:
RunTable( sTable, nReps)
where sTable is the full text of the generator and nReps is the number of reps. It returns an array of results.
Let me know if you want to use the library for your own projects.
Comments
That's very cool. I assume it could be embedded in a website without showing the generator itself. I would love to embed some game-specific generators on our website.
Do you think it would be possible to support prompts?
If you pull the generator off a server, you'd never have to make the generator itself visible to people viewing the site. Prompts I think would be possible. Of course the GUI for them would be completely up to the web site maker. Alternatively, since you'd have the full table text, you can also inject variables right into the the table text before running it by pre-pending the table with 'Set' commands.
Btw, everyone is welcome to grab the .js file from source of the above page and use it in their own projects.