I spent the last week working on a wrapper for FyreVM that allows it to be used statelessly in a web page. The results, although not pretty, are at http://zifmia.plover.net/.
The wrapper will start up the game, restore the previous state, execute the command, grab the startup text, and return this in an XML blob. I created a simple web page to extract the channel data and write it out. I even included javascript functionality to click on directions.
The Inform 7 game source looks like this:
“Zifmia Test” by David Cornelson
Include Version 3 of FyreVM Support by Textfyre.
Use full-length room descriptions.
When play begins:
change prompt to ” “.
The Kitchen is a room. “You are in a kitchen. The bedroom is <a onclick=’javascript:command([']east[']);’>east</a>.”
The Bedroom is east of the Kitchen. “You are in the bedroom. The kitchen is <a onclick=’javascript:command([']west[']);’>west</a> and the bathroom is <a onclick=’javascript:command([']north[']);’>north</a>.”
The Bathroom is north of the Bedroom. “You are in the bathroom. The bedroom is <a onclick=’javascript:command([']south[']);’>south</a>.”
* * * *
I haven’t implemented this as a service yet, which will allow me to implement the controls us jQuery and AJAX calls, but that’s more of a design thing. I wanted to first show that FyreVM can be used as a back end to a web application.
All of the code, Inform 7 project, and web project are at sourceforge.net in the FyreVM project.