Hi! I would really like to be able to use the output of Inform 7 in Godot, in a manner similar to Ink (i.e. sending text input to the Inform 7 game, getting simple text back as output, and choosing how to display that text in Godot, presumably alongside fancy graphics).
Unfortunately, I’m having trouble finding an existing interpreter (for either z-code or glulx) with the sort of API I want. It seems like there are tons of interpreters out there, but half of them are poorly-documented hobby projects, and more annoyingly, they mostly either are in the form of a standalone application, or expect to be combined with a Glk “library” (not really a library) to produce a standalone executable, but the Glk API really feels like it’s structured for a different use case than what I have in mind.
I just want to be able to do something like this (sorry for GDscript-ish pseudocode):
var story_data = load("path/to/story.z8 or whatever");
var story = new IFInterpreter(story_data);
...
function on_user_input_in_textbox_or_whatever():
var input = get_user_input_somehow()
story.send_input(input)
// wait in a *non-blocking* way to receive string output somehow,
// like via a signal or callback or something
It doesn’t need to be exactly that API, but the point is, I just want to use Inform7 for the parsing and world model, sending and receiving simple text, and basically ignore any instructions from the interpreter about windows, styling, graphics, etc., because I want to define all that stuff in Godot.
Is there a way for me to do this without having to write a full “Glk library,” or full interpreter, of my own?
My current best solution would be to link glulxe with RemGlk and run that as a subprocess of Godot via OS.execute_with_pipe()
, and then ignore like half the output, but this sucks because I can’t export it for web (also, more complicated to bundle/distribute and probably more likely to get flagged by antivirus). Alternately, any solution that involves compiling RemGlk to WASM, or using an existing javascript library, could be made to work in a web export but not in a non-web build or when running from the Godot editor.
I’m kinda stumped. Has anyone else found a good way to do something similar?