amp-web-push-widget button.amp-subscribe { display: inline-flex; align-items: center; border-radius: 5px; border: 0; box-sizing: border-box; margin: 0; padding: 10px 15px; cursor: pointer; outline: none; font-size: 15px; font-weight: 500; background: #4A90E2; margin-top: 7px; color: white; box-shadow: 0 1px 1px 0 rgba(0, 0, 0, 0.5); -webkit-tap-highlight-color: rgba(0, 0, 0, 0); } /** * Jetpack related posts */ /** * The Gutenberg block */ .jp-related-posts-i2 { margin-top: 1.5rem; } .jp-related-posts-i2__list { --hgap: 1rem; display: flex; flex-wrap: wrap; column-gap: var(--hgap); row-gap: 2rem; margin: 0; padding: 0; list-style-type: none; } .jp-related-posts-i2__post { display: flex; flex-direction: column; /* Default: 2 items by row */ flex-basis: calc( ( 100% - var(--hgap) ) / 2 ); } /* Quantity qeuries: see https://alistapart.com/article/quantity-queries-for-css/ */ .jp-related-posts-i2__post:nth-last-child(n+3):first-child, .jp-related-posts-i2__post:nth-last-child(n+3):first-child ~ * { /* From 3 total items on, 3 items by row */ flex-basis: calc( ( 100% - var(--hgap) * 2 ) / 3 ); } .jp-related-posts-i2__post:nth-last-child(4):first-child, .jp-related-posts-i2__post:nth-last-child(4):first-child ~ * { /* Exception for 4 total items: 2 items by row */ flex-basis: calc( ( 100% - var(--hgap) ) / 2 ); } .jp-related-posts-i2__post-link { display: flex; flex-direction: column; row-gap: 0.5rem; width: 100%; margin-bottom: 1rem; line-height: 1.2; } .jp-related-posts-i2__post-link:focus-visible { outline-offset: 2px; } .jp-related-posts-i2__post-img { order: -1; max-width: 100%; } .jp-related-posts-i2__post-defs { margin: 0; list-style-type: unset; } /* Hide, except from screen readers */ .jp-related-posts-i2__post-defs dt { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(1px, 1px, 1px, 1px); white-space: nowrap; } .jp-related-posts-i2__post-defs dd { margin: 0; } /* List view */ .jp-relatedposts-i2[data-layout="list"] .jp-related-posts-i2__list { display: block; } .jp-relatedposts-i2[data-layout="list"] .jp-related-posts-i2__post { margin-bottom: 2rem; } /* Breakpoints */ @media only screen and (max-width: 640px) { .jp-related-posts-i2__list { display: block; } .jp-related-posts-i2__post { margin-bottom: 2rem; } } /* Container */ #jp-relatedposts { display: none; padding-top: 1em; margin: 1em 0; position: relative; clear: both; } .jp-relatedposts:after { content: ''; display: block; clear: both; } /* Headline above related posts section, labeled "Related" */ #jp-relatedposts h3.jp-relatedposts-headline { margin: 0 0 1em 0; display: inline-block; float: left; font-size: 9pt; font-weight: bold; font-family: inherit; } #jp-relatedposts h3.jp-relatedposts-headline em:before { content: ""; display: block; width: 100%; min-width: 30px; border-top: 1px solid #dcdcde; border-top: 1px solid rgba(0,0,0,.2); margin-bottom: 1em; } #jp-relatedposts h3.jp-relatedposts-headline em { font-style: normal; font-weight: bold; } /* Related posts items (wrapping items) */ #jp-relatedposts .jp-relatedposts-items { clear: left; } #jp-relatedposts .jp-relatedposts-items-visual { margin-right: -20px; } /* Related posts item */ #jp-relatedposts .jp-relatedposts-items .jp-relatedposts-post { float: left; width: 33%; margin: 0 0 1em; /* Needs to be same as the main outer wrapper for Related Posts */ box-sizing: border-box; -moz-box-sizing: border-box; -webkit-box-sizing: border-box; } #jp-relatedposts .jp-relatedposts-items-visual .jp-relatedposts-post { padding-right: 20px; filter: alpha(opacity=80); -moz-opacity: .8; opacity: .8; } #jp-relatedposts .jp-relatedposts-items .jp-relatedposts-post:nth-child(3n+4), #jp-relatedposts .jp-relatedposts-items-visual .jp-relatedposts-post:nth-child(3n+4) { clear: both; } #jp-relatedposts .jp-relatedposts-items .jp-relatedposts-post:hover .jp-relatedposts-post-title a { text-decoration: underline; } #jp-relatedposts .jp-relatedposts-items .jp-relatedposts-post:hover { filter: alpha(opacity=100); -moz-opacity: 1; opacity: 1; } /* Related posts item content */ #jp-relatedposts .jp-relatedposts-items-visual h4.jp-relatedposts-post-title, #jp-relatedposts .jp-relatedposts-items p, #jp-relatedposts .jp-relatedposts-items time { font-size: 14px; line-height: 20px; margin: 0; } #jp-relatedposts .jp-relatedposts-items-visual .jp-relatedposts-post-nothumbs { position:relative; } #jp-relatedposts .jp-relatedposts-items-visual .jp-relatedposts-post-nothumbs a.jp-relatedposts-post-aoverlay { position:absolute; top:0; bottom:0; left:0; right:0; display:block; border-bottom: 0; } #jp-relatedposts .jp-relatedposts-items p, #jp-relatedposts .jp-relatedposts-items time { margin-bottom: 0; } #jp-relatedposts .jp-relatedposts-items-visual h4.jp-relatedposts-post-title { text-transform: none; margin: 0; font-family: inherit; display: block; max-width: 100%; } #jp-relatedposts .jp-relatedposts-items .jp-relatedposts-post .jp-relatedposts-post-title a { font-size: inherit; font-weight: normal; text-decoration: none; filter: alpha(opacity=100); -moz-opacity: 1; opacity: 1; } #jp-relatedposts .jp-relatedposts-items .jp-relatedposts-post .jp-relatedposts-post-title a:hover { text-decoration: underline; } #jp-relatedposts .jp-relatedposts-items .jp-relatedposts-post img.jp-relatedposts-post-img, #jp-relatedposts .jp-relatedposts-items .jp-relatedposts-post span { display: block; max-width: 90%; overflow: hidden; text-overflow: ellipsis; } #jp-relatedposts .jp-relatedposts-items-visual .jp-relatedposts-post img.jp-relatedposts-post-img, #jp-relatedposts .jp-relatedposts-items-visual .jp-relatedposts-post span { height: auto; max-width: 100%; } #jp-relatedposts .jp-relatedposts-items .jp-relatedposts-post .jp-relatedposts-post-date, #jp-relatedposts .jp-relatedposts-items .jp-relatedposts-post .jp-relatedposts-post-context { opacity: .6; } /* Hide the date by default, but leave the element there if a theme wants to use css to make it visible. */ .jp-relatedposts-items .jp-relatedposts-post .jp-relatedposts-post-date { display: none; } /* Behavior when there are thumbnails in visual mode */ #jp-relatedposts .jp-relatedposts-items-visual div.jp-relatedposts-post-thumbs p.jp-relatedposts-post-excerpt { display: none; } /* Behavior when there are no thumbnails in visual mode */ #jp-relatedposts .jp-relatedposts-items-visual .jp-relatedposts-post-nothumbs p.jp-relatedposts-post-excerpt { overflow: hidden; } #jp-relatedposts .jp-relatedposts-items-visual .jp-relatedposts-post-nothumbs span { margin-bottom: 1em; } /* List Layout */ #jp-relatedposts .jp-relatedposts-list .jp-relatedposts-post { clear: both; width: 100%; } #jp-relatedposts .jp-relatedposts-list .jp-relatedposts-post img.jp-relatedposts-post-img { float: left; overflow: hidden; max-width: 33%; margin-right: 3%; } #jp-relatedposts .jp-relatedposts-list h4.jp-relatedposts-post-title { display: inline-block; max-width: 63%; } /* * Responsive */ @media only screen and (max-width: 640px) { #jp-relatedposts .jp-relatedposts-items .jp-relatedposts-post { width: 50%; } #jp-relatedposts .jp-relatedposts-items .jp-relatedposts-post:nth-child(3n) { clear: left; } #jp-relatedposts .jp-relatedposts-items-visual { margin-right: 20px; } } @media only screen and (max-width: 320px) { #jp-relatedposts .jp-relatedposts-items .jp-relatedposts-post { width: 100%; clear: both; margin: 0 0 1em; } #jp-relatedposts .jp-relatedposts-list .jp-relatedposts-post img.jp-relatedposts-post-img, #jp-relatedposts .jp-relatedposts-list h4.jp-relatedposts-post-title { float: none; max-width: 100%; margin-right: 0; } } /* * Hide the related post section in the print view of a post */ @media print { .jp-relatedposts { display:none ; } } .amp-logo amp-img{width:371px} .amp-menu input{display:none;}.amp-menu li.menu-item-has-children ul{display:none;}.amp-menu li{position:relative;display:block;}.amp-menu > li a{display:block;} /* Inline styles */ div.acss138d7{clear:both;}div.acss0dcba{--relposth-columns:3;--relposth-columns_m:3;--relposth-columns_t:3;}div.acssd8696{aspect-ratio:16/9;background:transparent url(https://i0.wp.com/jerz.setonhill.edu/wp-content/uploads/2025/03/Screenshot-2025-03-08-at-11.16.32%E2%80%AFPM.png?resize=150%2C150&ssl=1) no-repeat scroll 0% 0%;height:150px;max-width:150px;}div.acss020fa{color:#333333;font-family:Arial Narrow;font-size:11px;height:45px;}div.acsseb4eb{aspect-ratio:16/9;background:transparent url(https://i0.wp.com/jerz.setonhill.edu/wp-content/uploads/2025/03/stapler-jam.jpg?resize=150%2C150&ssl=1) no-repeat scroll 0% 0%;height:150px;max-width:150px;}div.acss6fa3a{aspect-ratio:16/9;background:transparent url(https://i0.wp.com/jerz.setonhill.edu/wp-content/uploads/2025/02/Carr-Innis-portrait-grayscale-crop-640x843-1.jpg?resize=150%2C150&ssl=1) no-repeat scroll 0% 0%;height:150px;max-width:150px;}div.acss503b9{aspect-ratio:16/9;background:transparent url(https://i0.wp.com/jerz.setonhill.edu/wp-content/uploads/2025/02/TELEMMGLPICT000412909317_17399875139830_trans_NvBQzQNjv4BqqVzuuqpFlyLIwiB6NTmJwfSVWeZ_vEN7c6bHu2jJnT8.jpeg?resize=150%2C150&ssl=1) no-repeat scroll 0% 0%;height:150px;max-width:150px;}div.acss12a58{aspect-ratio:16/9;background:transparent url(https://i0.wp.com/jerz.setonhill.edu/wp-content/uploads/2025/02/Screenshot-2025-02-16-at-11.51.31%E2%80%AFAM-600x537-1.png?resize=150%2C150&ssl=1) no-repeat scroll 0% 0%;height:150px;max-width:150px;}div.acssdbd6b{aspect-ratio:16/9;background:transparent url(https://i0.wp.com/jerz.setonhill.edu/wp-content/uploads/2025/01/img_2072-1.jpg?resize=150%2C150&ssl=1) no-repeat scroll 0% 0%;height:150px;max-width:150px;} .icon-widgets:before {content: "\e1bd";}.icon-search:before {content: "\e8b6";}.icon-shopping-cart:after {content: "\e8cc";}

Question about INFORM7 IF playing from Web Pages

I got an e-mail this morning from a multimedia developer who found my online version of Emily Short’s Metamorphoses, asking some technical questions about whether it is possible to give web-based users tasks to perform in an interactive fiction game, and have the game notify the outside world when the task is completed. I’m reproducing it here with permission.

Dennis,
Hi. I write with something of a request. I wonder if you can help?
I’ve been able to find one of Emily Short’s IF stories playing within a web page on your site <http://jerz.setonhill.edu/if/gallery.metamorp/index.html>. This is the only time I’ve been able to find IF playing this way – most IF seems to get played as a self-standing application – and so I wondered if you might be able to give me some idea about how the web-based IF is accomplished?
As an old (in both senses of the word) player of IF, and now a self-professed multimedia developer, I am trying to see if I can use INFORM7 to write some “tasks” for users of a web-based ‘community’ site that I’m working with. The idea would be bring up a short IF task as an alternative activity for a user who requests one, on the
web page, get the user to work through it, and get the story to send a message to the web server on successful completion (or on saving, etc.).
If you have time to reply, and if you can help, I would be most grateful.
Regards,
Denis Williamson
Hong Kong

I’m posting my response here, in the hopes that anyone with a better answer will share it.

The Inform system produces game files that run on the Z-machine, which is a virtual machine that exists only in software. When you see an IF game running in a web page, it is probably using Matthew Russoto’s ZPlet, which is a Java interpreter for the Z-machine.  I wouldn’t know how it is possible to send a message from within the virtual machine to the outside world, but my programming skills are very modest, so just because I can’t imagine how to do it doesn’t mean it’s impossible.  I don’t know all that much about the Z machine — Andrew Plotkin or Matthew Russoto would be the ones to ask (both of whom read the rec.arts.int-fiction Usenet group).

It should be a fairly trivial thing to have a small stand-alone ZPlet program that ends with the player finding a magic word, which the user would then just manually key into some other program.  I embedded a few small IF programs in a web page designed to teach my students about exposition in interactive fiction — that might give you some idea of what you can accomplish. I don’t try to communicate to the outside world from within the sample games, but there is some crude interaction (in in the form of questions the web site asks about the in-game experience.)

The Glulx interpreter has some significant multimedia capability, and there is a Java interpreter for Glulx, Zag, by Jon Alfred Zeppeiri. Inform 7 can output gamefiles in the Glulx format.  (It requires the Java Runtime environment to be installed on your local computer, so it’s not as point-and-click simple as ZPlet.)

TADS also has some multimedia capabilities, but it is a completely different system from Inform and I have not recently checked out its capabilities. It has had HTML hyperlinking for some time, so I imagine it should not be too hard to send a message to the outside world.

The website Homestarrunner.com created a flash-based spoof of text adventures called Thy Dungeonman. I don’t know whether the flash code has been released, or whether some other text-adventure fan might have released a homebrew version of the code. But that game was released long before Inform 7, so my guess is the creation of such a flash-based game would be hackish.

I just Googled and found Flashonate, a flash-based z-machine interpreter, by Peter Rogers. He has released the code as GPL.

I hope you will share whatever you learn as you investigate the possibilities.

Update: I posted the question to rec.arts.int-fiction, where the IF gurus are.

Post was last modified on 16 Jan 2023 12:21 pm

View Comments

  • Though this might not be what Mr. Williamson was looking for, it might be interesting to look into it.
    http://www.guncho.com/
    What is it?
    Guncho is an online system for multiplayer interactive fiction based on Inform7.

  • Even if you implemented the ability to enter a line on the dos command line, that would be very useful.

  • Conceptually, what Mr. Williamson has suggested is entirely possible, but no one has implemented an environment that would offer this capability.
    In developing the interpreter for Textfyre, we plan to have the ability to setup a testing version so that the game player's interactions are sent back to our servers over the Internet. This is for market testing and will allow us to build a repository of commonly missed commands and sentence structures.
    But as a side benefit, we would also be able to do as Mr. Williamson suggests. We would be able to notify some external entity of progress or receieve a notification from somewhere outside the interpreter. I can think of a myriad ways this would be useful, but at this time Textfyre isn't really focused on communication aspects outside of test marketing.
    But it's a cool idea. We'd thought of getting into developing content based on domain expertises (educational tools) and this might one of the aspects of that type of system.
    David C.

Share
Published by
Dennis G. Jerz
Tags: inform7

Recent Posts

The Dog and the Oyster (Aesop Fable)

I always enjoy my visits to the studio. This recording was a quick one!

4 days ago

MLA Citations: Your attention to detail establishes your credibility

After marking a set of bibliography exercises, I created this graphic to focus on the…

4 days ago

The Begotten #StarTrek #DS9 Rewatch (Season 5, Episode 12) Kira and Odo face surrogacy

Rewatching ST:DS9 Odo walks stiffly into the infirmary, where Bashir scolds him for not taking…

5 days ago

Stapler jam during a midterm exam.

My years of watching MacGyver definitely paid off. (Not that my GenZ students got the…

1 week ago

The Tyranny of Now (Appreciation of Harold Innis)

As a grad student at the University of Toronto, I picked up a bit about…

2 weeks ago