Custom listing contents of a supporter

Hey all–

So I’d like to get rid of the parentheses around a list of things on a supporter in a room description, and I’m having trouble with the syntax.

I’ve tried a lot of variations on:

After printing the name of the counter while listing contents of a room:	
	say " on which [is-are a list of things on the counter]".

and I get stuff like this:

You can see a counter on which are a glass, a bowl, and a spoon here.

Which is oddly phrased. And if I take everything off the counter:

You can see a counter on which are nothing here.

Can someone help me phrase this correctly? Thanks!

2 Likes

You could mention the counter in the room description, and change the wording based on whether there’s anything on the counter. If you make the counter “scenery,” I don’t think it will print the “You can see a counter here” line.

Lab is a room. The description of Lab is "This is a lab.[paragraph break]A counter stretches across the north wall[if a thing is on the counter]. [paragraph break]On the counter [is-are a list of things on the counter][end if]."

A counter is a scenery supporter in Lab.

A pen is on the counter. A pencil is on the counter.
2 Likes

Or if you say “[A counter]” in brackets in the description, it will count as “mentioned”, and not be listed again.

2 Likes

Thanks! I think I will do this, but I’d still like to know how to code it if it’s not scenery. I always pivot to something else instead of finding the answer, and I’m trying to stop doing that so much since the same issues tend to come up.

2 Likes

I think you could do this:

Lab is a room. The description of Lab is "This is a lab."

A chair is a supporter in Lab. The chair is portable.

A cat is an animal on the chair.

Rule for writing a paragraph about the chair:
	say "You see a wooden chair[if a thing is on the chair]. On the chair [is-are a list of things on the chair][end if]."
4 Likes

One way can be to use the activity “Writing a paragraph about”:

The Lab is a room.

The counter is a supporter in the Lab.

The glass is on the counter.
The bowl is on the counter.
The spoon is on the counter.

Rule for writing a paragraph about the counter:
	say "You can see a counter here, on which [is-are a list of things on the counter].";

See 18.24. Writing a paragraph about, but the other Activities in chapter 18 can also be useful.

Edit: Ninja’d by bg, whose solution is also better because it takes care of the empty case. :slight_smile:

4 Likes

There’s a great breakdown of the looking action and which activities you use to accomplish what in “Looking” in the Inform 7 Programmer’s Manual.

[ Edited: I had said “(It’s so useful I really need to give it an id in the HTML so I can link to it directly.)” but doing it doesn’t take much more effort than talking about doing it, so I did it. Above link updated to go directly to the Looking section. ]

2 Likes