Descriptions of supported items.

Why is the spoon description used but not the knife in this story?

“Story” by Geoffrey Matthews

The kitchen is a room. “A bright yellow kitchen.”
The table is in the kitchen. “An old oak table.”
The knife is on the table. “A sharp knife.”
The spoon is on the table. The description of the spoon is “A dull spoon.”

test me with “x table/x knife/x spoon”

You may want to look at section 3.11 of the help - it talks about the two types of descriptions of things. Because they’re on the table, you aren’t seeing their initial description in the same way. If you get rid of the table in your example and just put the two things on the floor with the descriptions you have you’ll more easily be able to see the difference.

That’s not the problem. Look carefully at the difference between the knife and the spoon. Why do we have to say “The description is” in order to attach the description to the object if it is on something?

When you write a bare string like that for a room, it sets the room’s description property. But when you write one for a thing, it sets the thing’s initial appearance property – it’s not the same thing. Like mktacoma said, read section 3.11.

The initial appearance of the spoon and the knife are not used in this game because they start out on the table. Initial appearances only appear when you “look” in a room, the object is lying on the ground, and the object has never been taken.

The description of both the spoon and the knife appear when you “examine” them.

Interesting. If the knife starts out on the floor, we see the initial description. If it starts out on the table, there appear to be no circumstances under which we can see that description. I don’t see that information anywhere in the documentation. I assume it applies to the knife begin in, on, worn, anything except on the floor. But then, I can’t be sure because it’s not documented.

It’s always bothered me too. From time to time I’ve thought about writing an extension to change that behavior, or at least look into existing extensions that do similar things.

You can, of course, cheat, and have the initial appearance of the knife say it is on the table even though it is really on the floor. As long as the table is fixed in place, that should be completely safe, except in the case of the removing action, which will give you a parser error. Maybe I should write an extension to fix THAT.

Doesn’t that then lead to:

(Well, actually it seems like “look in table” is the default syntax in I7 for some reason, but still.)

That’s true. I guess there is a need for such an extension after all.

I have a related question (if this is too off topic, sorry, I’ll start a new thread):

The kitchen is a room. "A table stands in a bright yellow kitchen." The table is in the kitchen. It is undescribed and fixed in place. The knife is on the table. The spoon is on the table.
Will produce:

kitchen
A table stands in a bright yellow kitchen.

Q: How can I get the table description in with the room description paragraph? It would then read:

A table stands in a bright yellow kitchen. On the table are a knife and a spoon.

Is it as easy as something like:

The kitchen is a room. "A table stands in a bright yellow kitchen. [perform examining table]." ?
Preferably, I’d test for the number of items on the table, and only display if it’s greater than zero.

Probably not quite that simple, but something like that. Defining a “to say perform examining table” phrase would make that work, but to get all the details right, you’d probably need to look at the library code for examining a supporter.

This code is adapted from the describe what’s on scenery supporters in room descriptions rule in the Standard Rules. I haven’t tested it:

To say perform examining table:
	if something is on the table:
		say "On the table ";
		list the contents of the table, as a sentence, including contents, giving brief inventory information, tersely, not listing concealed items, prefacing with is/are, listing marked items only;
		say ". ";

Thanks! That worked (once I removed the “listing marked items only”).

Emily Short’s Single Paragraph Description seems to be designed to do just that out of the box, though I haven’t used it.

It requires the Room Description Control extension, which I haven’t used either; combined they’re definitely something that wouldn’t be easy to come up with on your own, though it might be easier to roll your own single paragraph description if that’s all you want. But if you want the functionality without the joy (semi-serious there) of writing the code yourself, that’s probably the simplest option.

Something along these lines worked for me:

The kitchen is a room. "A table stands in a bright yellow kitchen.[if the table supports something] On the table is [a list of things on the table].[end if]"

The table is a supporter. It is in the kitchen.  It is undescribed and fixed in place.

The knife is on the table.
The spoon is on the table.

I think it’s a textbook case of a scenery supporter:

[code]The Kitchen is a room. “A table stands in a bright yellow kitchen.[if the table supports something] On the table [is-are a list of things on the table].[end if]”.
The table is a scenery supporter in the kitchen.
The knife is on the table.
The spoon is on the table.

The describe what’s on scenery supporters in room descriptions rule is not listed in any rulebook.[/code]

Jon Ingold presents an elegant solution to the OP’s question here:
http://threeedgedsword.wordpress.com/2011/03/07/on-the-desk-is-a-helpful-bit-of-code/#comments

Nice! That’s one of those bits of code that looks too small to be an extension, but it’s so useful it probably should be anyway.

I was thinking of submitting it as a bug-and-fix. After all, there’s no ambiguity since the author has positioned the item and provided the initial text, and at first glance it does look like an oversight.