Fiction is a Three-Edged Sword

Fiction, interactive fiction and narrative

On the desk is a helpful bit of code

1 Comment

After a bit of a break from I7 I’d forgotten some of its quirks, not the least the difficultly involved in changing:

On the desk is an origami bird.

into, well, anything else; say:

Annabel has left an origami bird on the table for you.

Here’s a quick solution. I’ll probably package it into an extension later.

[— I7 code —]

The intercept supportable items rule is listed before the describe what's on scenery supporters in room descriptions rule in the for printing a locale paragraph about rulebook.

For printing a locale paragraph about a supporter (called table-top-place) (this is the intercept supportable items rule):
carry out the describing what's on activity with table-top-place;
continue the activity;

Describing what's on something is an activity. The currently important supporter is a thing that varies.

Before describing what's on something (called the table-top-place): now the currently important supporter is table-top-place.

To describe (x - a thing) by saying (p - some text):
if x is on the currently important supporter begin;
now the x is mentioned;
say p, paragraph break;
end if;

[— End of code —]

This creates a quick activity for describing things with things on, and a phrase for actually describing the thing that’s doing the on. You use it like this:

Rule for describing what's on the writing desk:
describe the origami bird by saying "Annabel has left an origami bird on the table for you."

Advertisements

Author: joningold

Jon Ingold is a writer and games designer from Cambridge, UK. He is co-founder of inkle, a company specialising in interactive narrative for mobile devices. He has written prose, plays, short films as well as interactive fiction, both in hypertext and parser-based systems. His short stories have appeared in Interzone magazine and his IF works have won competitions and awards.

One thought on “On the desk is a helpful bit of code

  1. And this is even better:

    The intercept supportable items rule is listed before the describe what's on scenery supporters in room descriptions rule in the for printing a locale paragraph about rulebook.

    For printing a locale paragraph about a supporter (called table-top-place) (this is the intercept supportable items rule):
    repeat with item running through not handled things on the table-top-place which provide the property initial appearance:
    now the item is mentioned;
    say initial appearance of the item, paragraph break;
    continue the activity;

    …as this just lets you use the normal format, so writing:

    The apple is on the table. "An apple has been left for you."

    will now work as expected, with the appearance being displayed until the apple is picked up. (And if there’re other things on the table, they’re not affected).

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s