I7 Not Omitting Contents in Listing

Hello,

I told someone how to do this the other day, and it worked for them. Now I’m doing it, it isn’t. I had a search for “omit contents in listing”, but didn’t find my problem.

I have a log which can support up to 2 things. When the player first discovers it, it is mentioned in the room description, and it has a feather on it. I want the player to discover the latter by examining the log, so I write:

Rule for printing room description details of the log:
	omit contents in listing.

The source compiles, but contents are still listed, separate from the log’s paragraph in the room description. Same behaviour with for writing a paragraph about, printing the name of, and even with the added (somewhat redundant) condition, “if the old log supports something:”

Here’s the source for the log, sans understand grammar and some extra messages. Source shows my latest attempt at solving the problem.

An old log is a fixed in place enterable supporter in Eastward Bending Path.

Rule for writing a paragraph about the old log:
	if the log is broken:
		say "A crumbling old log lies to one side.";
	else:
		say "An old log lies to one side.";
	if the old log supports something, omit contents in listing.

The old log can be broken.
Rule for printing the name of the broken old log:
	say "hunk of decaying wood."

The old log has carrying capacity 2.

The tiny sable feather is on the old log. It is a black feather.

The chunk of wood is a thing. "A small chunk of wood is discarded here." The description is "Scarred with deep indentations, this piece of wood came from a very dead tree."

Instead of taking the old log:
	say "As you try to lift it, the softened wood gives way with an implacable 'CRUMP!' And falls from your hands to the ground in a mulchy mess, leaving you only with a small piece of rotting wood.";
	now the old log is broken;
	now the chunk of wood is carried by the player;
	if the tiny sable feather is undiscovered:
		say "A small dark something lands at your feet. You pick up a tiny black feather.";
		silently try taking the tiny sable feather.

This is a quirk of the difference between containers and supporters.

By default, containers have their contents printed in a parenthetical immediately following the mention of the container itself, and this can be disabled by omit contents in listing (among a few other techniques).

Supporters, on the other hand, don’t show their contents this way, but rather do it in a separate paragraph following the main description. This is unaffected by omit contents, but instead relies on whether things are mentioned or not (among a few other techniques).

I’m not entirely sure why this is, other than historic reasons with Ye Olde Infocom stories. Part of it might be that containers could be closed, opaque, or otherwise concealing their contents from view, whereas supporters tend to always be on full display.

So one simple trick to getting this to work is to use this:

Rule for writing a paragraph about the old log:
	if the log is broken:
		say "A crumbling old log lies to one side.";
	else:
		say "An old log lies to one side.";
	now every thing on the old log is mentioned.

mentioned is set automatically for anything that actually is printed as its object, e.g. if your paragraph about the old log had said "A crumbling old log lies to one side, upon which is [a sable feather]." (note the brackets), this would count as a mention and it would not be listed separately, but other things on the log might be.

But you can pretend that something has been mentioned even when it hasn’t to effectively hide it from the description list, as above.

2 Likes

Thanks very much, that helps a lot. How simultaneously unexpected and unsurprising of you, Inform.

Can I use bracketed text to mention things in descriptions, too? I’ve done that in room descriptions before, and it’s worked. Trying it for my log when the feather is on it still gives the feather its own paragraph.

The description of the old log is "The cracked log sits on the forest path, a step away from the tangled roots of a tree. It has a sunken, packed look, as though it has been there a long time, and might not even really be wood at all[if the tiny sable feather is on the old log]. There is a [tiny sable feather] stuck in a crack[end if]."

Mentioning it in the description of the log won’t affect the LOOK display (since that doesn’t print the log’s description, only the room’s description).

Mentioning it in the room’s description would work, as does mentioning it in the log’s initial appearance (although that only works if you remove the writing a paragraph about rule).

In theory, mentioning it in the description of the log should prevent it showing the extra paragraph about the feather when you X LOG, but it doesn’t, and I’m not sure why not off the top of my head. (Don’t have time to look into it right this moment.)

1 Like

In theory, mentioning it in the description of the log should prevent it showing the extra paragraph about the feather when you X LOG , but it doesn’t, and I’m not sure why not off the top of my head. (Don’t have time to look into it right this moment.)

Essentially it’s because the examine supporters rule, which prints out the contents of supporters when examining, doesn’t reference the mentioned property- it prints out the full contents regardless.

To change this would require replacing this rule.

1 Like