top expert

a biting cat website

Let’s WRITE IF #3: same place, different text

How far can we go without going anywhere?

basic ingredients.

Let’s make something very simple.

the story title is "Portrait With Wolf ^_^".
the story author is "Drew Cook".
the story headline is "A fun activity".

release number is 0.

ABR is a room.
the printed name of ABR is "A Brightly Lit Room!"

In terms of output, that will get us this:

Portrait With Wolf ^_^
A fun activity by Drew Cook
Release 0 / Serial number 240821 / Inform 7 v10.1.2 / D

A Brightly Lit Room!

>

Even in this small snippet, we have choices to make. Title and headline are important, naturally. Room names are important, too. Will we be literal or figurative? The name of the current room is in bold type at the top the player’s screen. Consider these possibilities:

  • Bare Room With Table
  • Empty Room
  • Interrogation Room
  • Dead End
  • Interview Room
  • White Out

…and so forth. A room name can be ironic, or humorous, consistent (or not) with the voice of a narrator. My thought: any time text is required, it is an important craft consideration. Sometimes, bare facts are best. At other times, something surreal or evocative might do the trick. Whatever your work requires, make room names a part of your authorial strategy.

Why have I chosen “A Brightly Lit Room!”? As the strange title (complete with heart emoticon) might suggest, I am aiming for something a little off-balance. The exclamation point and heart suggest whimsey, though their textual matches do not. This is a strangeness that I hope will come through.

Let’s continue with some basic placeholder texts. First, a simple room description.

the description of ABR is "A bare place. Bright light emerges from an unknown source above."

A start. It can seem hard sometimes, but resist a tendency to begin room descriptions with “This is…” or “You are in…”. I think a natural gravity pulls our pen in that direction, and why not? They are a direct path to our goal, which is describing the protagonist’s location. The effect, unfortunately, can feel slack and familiar. You doubtlessly have your own style, so don’t worry about my short, punchy sentences. I’m not suggesting anyone write like me, but do be mindful of overused constructions that can sabotage good prose.

Since we talk about the light, we have to put it in the room. Reviewers and testers will howl if we don’t, and why shouldn’t they? Our prose created a reasonable expectation: there is a light in the room with the protagonist. We don’t have to get fancy–not now, anyway–let’s just set it up.

the light is in ABR.

the description of the bright light is "Because its light is so bright, you are unable to look at it directly".

There are different types of things–called “kinds”–some are built into Inform 7, others we can define ourselves. A thing can be “scenery.” In practical terms, that means two things. First, it is not listed in room descriptions. Second, it cannot be taken or moved by the player. Let’s go ahead and make a declaration:

the light is scenery.

We don’t have to work it all out now, but here are some other questions:

  • “light” is the name of the thing in our code. We can specify a different “printed name” for things, just like we can for rooms. How do we want Inform to refer to the light? Just as is the case with room names, we have a lot of flexibility here. Literal is the most common approach, but there still may be questions of emphasis. Names, like any other text, can motivate player action, create mood, etc.
  • Synonyms. There’s no pressing need for this at the moment but consider the words that players can use to refer to the light. Everything in descriptions should probably be accounted for. Here, there’s nothing other than “bright” that’s been mentioned. Let’s handle that now.
understand "bright / light" as the light.

This construction, complete with spaces and slash, will allow for all of these possibilities: “bright”, “light”, and “bright light”. Inform players are used to using adjectives as shorthand for nouns, so it’s best to grant this convenience.

Let’s add just one more thing for today.

the table is a supporter in ABR.

A “supporter” is a specialized thing in Inform 7. We can place things on top of it. Tables, like the one I’ve just made, are supporters. A podium is a familiar kind of supporter. Sometimes a supporter might be “enterable”, as in the case of a bed or a chair. There isn’t a lot to our table at the moment.

The most common type of Inform 7 supporter is scenery. However, for my own sinister reasons, I do not want to take that route. Why? This has been debated over the years: the default behavior of scenery supporters is to print their contents in room descriptions. That’s controversial, because people often create scenery to prevent things from appearing in room descriptions.

I have to admit, I don’t care for it myself. I don’t care much for automated printing of anything. I’m in this to write, after all! You’ll have to decide for yourself how far you want to go in customizing built-in output behaviors. Authors enjoy a lot of success without going as far as I do. Come along for the ride, but do what makes sense for you and your work.

Anyway, how am I going to handle the table? Let’s do a couple of things here. First, let’s set up the description.

the description of the table is "[the table text]".

If you haven’t been reading Top Expert for long, this may be the first time you’ve seen a text substitution. What’s that? It’s something that Inform can substitute for text in a quoted passage. There are multiple ways we can perform such substitutions. This one is very straightforward. We can use what’s called a definition to lay out what it means to say this so-called “[the table text]”. Here:

to say the table text:
	say "A small metal table with chipped, gray paint."

Note that if we declare “the” in our substitution, it must be there in our definition. Such things are read strictly by Inform 7. We can put “the table text” in brackets anywhere in a printed text and it will spit out “A small metal table with chipped, gray paint.”

Why do that instead of just typing in the description? Hold that thought. We need something to talk about next time! For now, let’s handle the way the table is handled in the room description.

If the table is not scenery, it’s easy to tailor how the contents are handled. We don’t have any contents yet, but we’ll get there. The automated list of things in printed room descriptions is called a locale description. Specific information about those things are printed in what are called “paragraphs,” even though they don’t look like the paragraphs we find in blogs or books. Consider this rule:

rule for writing a paragraph about the table:
	say "A small metal table with chipped paint stands under the light.";
	now the table is mentioned.

Before looking at the output, have a look. “Rule for writing a paragraph about the table” is a way for us to do something other than the default (Inform will list it and other items according to their printed names), in this case saying the text we’ve provided. Once an item is “mentioned,” the locale description process will no longer print information about it automatically. We’ve halted the built-in output and replaced it with our own.

The output looks like this:

A Brightly Lit Room!
A bare place. A bright light emerges from an unknown source above.

A small metal table with chipped paint stands under the light.

>

We are almost done. Let’s put a couple of things on the table.

a blue ball is on the table.
a red ball is on the table.

That gets us some automated text:

On the table are a blue ball and a red ball.

Final push for the day. How can we customize our paragraph? Inform is pretty smart about this stuff. If we can list the table contents, Inform will leave it to us. This will be the fanciest bit of code we’ve done in this post. I’m just going to dump the whole thing, and then we can talk about it.

rule for writing a paragraph about the table:
	if something is held by the table:
		say "Some items rest atop a small metal table with chipped paint:";
		say line break;
		list the contents of table, with newlines, indented, with extra indentation;
	otherwise:
		say "A small metal table with chipped paint stands under the light.";
	now the table is mentioned.

We have to deal with two conditions here. Is there something on the table? Inform will accept more than one formulation, but I like “held by the table.” “On the table” works, too. If there is something, I’ll say something specific, then list the contents of the table one at a time. Inform’s list writer is a little hard for me to wrap my head around, but this setup works. You can read more about it here.

How does that look?

A Brightly Lit Room!
A bare place. A bright light emerges from an unknown source above.

Some items rest atop a small metal table with chipped paint:
a blue ball
a red ball

>take all
blue ball: Taken.
red ball: Taken.

>l
A Brightly Lit Room!
A bare place. A bright light emerges from an unknown source above.

A small metal table with chipped paint stands under the light.

>

It may not be clear why I’ve taken this trouble. Bear with me! We have begun work on one of my Spring Thing 2025 projects, Portrait With Wolf ^_^. What’s it about? It’s an effort to explore multiple endings in a game with few objects and highly variable text. Feel free to comment here or on the itch project page!

I’ll be alternating between PWW and Marbles, D, and the Sinister Spotlight. Stick around!

Google Drive source repository for PWW

Portrait With Wolf by Drew Cook (itch.io)

Categories: ,

Leave a comment