Suppressing supporter contents list in room decription

When an open container is scenery, it’s contents are not printed in the room description. How can I make a supporter (in this case a shelf on which things can be placed) work in the same way?

Thanks for reading.

must be something like :

Rule for printing the name of a supporter:
omit contents in listing.

Thanks StephaneF

That code doesn’t produce any errors, but it’s not what I’m looking for. The room description now says ‘On the is a book’ rather than ‘on the shelf is a book’. I want it to say nothing at all, just leave the whole line out of the room description. The other problem with the code is that the object name is now never printed, so if you put something on the shelf it returns ‘You put the book on the .’ I only want to affect the room description, not other responses.

Any other ideas?

EDIT - Found this in the documentation (3.24 - Concealment)

Looks like exactly what I need, but when I add ‘The shelf is undescribed.’ in the source, the room description still says ‘On the shelf is a book.’ How can I make this work?

Thanks again.

What you need is this:

The describe what's on scenery supporters in room descriptions rule is not listed in any rulebook.

without using the “undescribed” property or “omit contents in listing.” In this case, it can help to type “rules” and then “look,” which tells you what rule prints out the description of what’s on the scenery supporters.

This rule is mentioned in section 17.26 of Writing with Inform:

(Do note that it can be extremely annoying if the player misses a critical object because the room description says “There’s a long wide table here” and doesn’t mention that the player has to “x table” to find out that the keys to the car are on it. To quote my review of a game, “the key to the puzzle was that you have to examine a large flat object in the middle of the room, thus learning there’s a bunch of stuff sitting on it that wasn’t mentioned in the room description.” It was dumb of me not to examine it, but still, annoying.)

Thanks Matt W, that works perfectly. I agree completely with your point about annoying undescribed items, and in this case I want to include the shelf items in the room description paragraph, so it looked unnatural to have them repeated underneath.

Where do I put this sentence? If I put it into the “When play begins” paragraph, nothing changes. If I put it into the paragraph of the supporter the content of which I don’t want to have listed separately, nothing changes. Thanks in advance!

(Specific problem: I have a hook onto which I can put things. Current output:

This is a hook. There’s an object hanging from it.
On the hook is an object.

The last sentence is what I’d love to get rid of.)

The examine supporters rule is not listed in any rulebook.” seems to work for what you want. I worked this out using the rules command, but can’t guarantee that won’t have unintended consequences (e.g. currently it would have the same effect on all supporters throughout the game).

"Hook" by Jonathan

The describe what's on scenery supporters in room descriptions rule is not listed in any rulebook.

The examine supporters rule is not listed in any rulebook.

The Hall is a room. "There is a hook here."

A hook is a scenery supporter in the Hall.  The description is "This is a hook. There’s a key hanging from it."

A key is on the hook.

Output:

Hall
There is a hook here.

>x hook
This is a hook. There's a key hanging from it.

Edit: ignore the above! This is probably better as it has the same effect but only for the hook.

"Hook2" by Jonathan

The describe what's on scenery supporters in room descriptions rule is not listed in any rulebook.

The Hall is a room. "There is a hook here."

A hook is a scenery supporter in the Hall. 

A key is on the hook.

Instead of examining the hook, say "This is a hook. There’s a key hanging from it."

If you don’t want it to say anything at all about the hook (specifically), then this is all you need (without anything else):

Rule for printing a locale paragraph about the hook:
	set the locale priority of the hook to 0.

The other technique to avoid mentioning items a second time is to officially mention them in the first place – in the description:

"There is [a hook] here."

Putting the square brackets around the item tells Inform that you’ve already mentioned it, so it won’t be mentioned again unless there’s something interesting to add. (By default, the contents of a supporter are interesting enough to mention, but you can override that too, either in general or in specific.)

1 Like

The fundamental problem here is that you’re listing the contents of the hook in its description, which is only going to work if you include code that makes sure that the contents are not listed when the key is removed from the hook. Otherwise, the description will continue to say the key is there even when it’s not. For example:

The description is "This is a hook. [regarding the number of things on the hook]There [are] [if the number of things on the hook is at least one][a list of things on the hook][else]presently nothing[end if] hanging on it."

or, more ambitiously, incorporate the full extent of the usual listing logic for describing the content of supporters from the Standard Rules:

The description is "This is a hook. There [what is on the hook] hanging on it.".

To say what is on the (item - a supporter):
	if a locale-supportable thing is on the item:
		set pronouns from the item;
		repeat with possibility running through things on the item:
			now the possibility is marked for listing;
			if the possibility is mentioned:
				now the possibility is not marked for listing;
		list the contents of the item, as a sentence, including contents,
			giving brief inventory information, tersely, not listing
			concealed items, prefacing with is/are, listing marked items only;
	otherwise:
		say "is presently nothing";

What you need to do to suppress listing the contents of the hook separately after its description depends on whether you’re concerned with what’s printed when examining the hook, or what’s printed in the room description (when either entering the room or ‘looking’).

If it’s ‘examining’ that’s the issue and nothing will ever be removed from or added to the hook under any circumstances, it would be OK to use the ‘Instead of examining’ as a blunt approach, but if that’s not the case, you want to intercept the ‘carry out examining supporters’ rule specifically for the hook only:

Carry out examining (this is the suppress contents of the hook rule) :
	If the noun is the hook:
		rule succeeds;
		
The suppress contents of the hook rule is listed before the examine supporters rule in the carry out examining rules.

This insertion prevents the usual ‘examine supporters’ rule from running for the hook only, but also allows the usual ‘After’ & ‘Report’ rules still to run.

If it’s the room description that’s the issue, then then this will suppress separately listing the contents of the hook after its description but not affect any other supporters in the game:

Rule for printing a locale paragraph about the hook (this is the suppress printing a locale paragraph about the hook contents rule):
	rule succeeds.

The suppress printing a locale paragraph about the hook contents rule is listed before the describe what's on scenery supporters in room descriptions rule in the for printing a locale paragraph about rules.

but the more blunt

The describe what's on scenery supporters in room descriptions rule is not listed in any rulebook.

will achieve the same goal for all scenery supporters in the game.

If you also want to suppress separately listing the contents in room descriptions of non-scenery supporters that have already been ‘mentioned’ in the Inform sense (i.e. already had a paragraph written about them, or had their name expanded in a ‘say’ phrase, e.g. say “Here is [a hook]” or say “What a beautiful [noun]”) you can apply all of the above principles to the rule governing that too, e.g.:

The describe what's on mentioned supporters in room descriptions rule is not listed in any rulebook.

or

Rule for printing a locale paragraph about the hook (this is the suppress printing a locale paragraph about the hook contents rule):
	rule succeeds.

The suppress printing a locale paragraph about the hook contents rule is listed before the describe what's on mentioned supporters in room descriptions rule in the for printing a locale paragraph about rules.
2 Likes
"Hook" by Jonathan & PB

The Hall is a room. "There is [a hook] here."

A hook is a scenery supporter in the Hall.  The description of the hook is "This is a hook. There [what is on the hook] hanging on it.".

To say what is on the (item - a supporter):
	if a locale-supportable thing is on the item:
		set pronouns from the item;
		repeat with possibility running through things on the item:
			now the possibility is marked for listing;
			if the possibility is mentioned:
				now the possibility is not marked for listing;
		list the contents of the item, as a sentence, including contents,
			giving brief inventory information, tersely, not listing
			concealed items, prefacing with is/are, listing marked items only;
	otherwise:
		say "is presently nothing";		

An aspidistra is in the  Hall. "A magnificent aspidistra sprouts from a massive glazed pot in one corner.". It is fixed in place.

A key is on the hook. The player carries a cape and a hood.

Carry out examining (this is the suppress contents of the hook rule) :
	if the noun is the hook:
		rule succeeds.
		
The suppress contents of the hook rule is listed before the examine supporters rule in the carry out examining rules.

Rule for printing a locale paragraph about the hook (this is the suppress printing a locale paragraph about the hook contents rule):
	rule succeeds.

The suppress printing a locale paragraph about the hook contents rule is listed before the describe what's on scenery supporters in room descriptions rule in the for printing a locale paragraph about rules.

Test me with "examine hook / put cape and hood on hook / look / examine hook".

Thanks. The flexibility (and complexity) of Inform 7 never ceases to amaze me.

Wow. Okay, before I try Peter’s code, this is what I currently have and which does not work:

Somewhere at the top of the source code, close to where I define global variables:

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

Then, in the code block of the room where the hook is:

The hook is here. It is undescribed and fixed in place. It is a scenery supporter. The description of the hook is “A large metal hook used to unload goods from boats.[if something is on the hook] Currently there’s [a list of things on the hook] hanging from it.[end if]”. Understand “hook” as the hook.
Rule for printing a locale paragraph about the hook:
set the locale priority of the hook to 0.

Result:

x hook
A large metal hook used to unload goods from boats. Currently there’s a thing hanging from it.

On the hook is a thing.

I’ll try to fiddle with Peter’s solution now but if I just made a simple error please yell. Thanks!

I assume that somewhere else in the code is A Thing, which is on the hook!

The problem is that the solutions you have applied here (removing the ‘describe what’s on scenery supporters in room descriptions rule’ and setting the locale priority of the hook to 0) are both applicable to when Inform is printing out room descriptions (which usually occurs in response to ‘look’, or due to arriving in a location- or to a changed position in that location, such as getting off a bed).

They have nothing to do with examining, which is why the code isn’t doing what you want. You need to interfere with the examining action in some way if you want to suppress the listing of contents of something while examining it. Inserting the ‘carry out examining’ rule I mentioned should do the trick.

It works now. Thanks Peter! “Carry out examining” did the trick. I got a stroke when it didn’t compile but putting the “The suppress contents” rule in the top section of the entire source code helped. Thanks again! I had no idea this would be so complicated!

Being such a large and fundamental part of the game/player interface, Inform goes to a great deal of trouble over how, when, where and why it describes rooms and objects, in an effort to make everything flow as naturally as possible, avoiding repetition but at the same time not omitting things the player can reasonably expect to be informed about. That makes the Standard Rules for describing quite extensive, subtle and complex. Interfering with them (by, for example, deciding to transplant a list of contents into the description of a supporter) inevitably bumps up against that complexity!

Another good example is the possibly unwanted consequence of getting rid of the ‘describe what’s on scenery supporters in room descriptions rule’, which naturally exists for a reason.

Now, if in the middle of an otherwise nondescript room you have a nondescript scenery table, on which sits the Enormous Ravenous Bugblatter Beast Of Traal, although the totally unexciting table may be mentioned in the description you have written for the room, on entering it you won’t by default be made aware of the most noticeable thing about the ghastly scene that confronts you, (i.e. The Beast), even though it is in plain view on something you have had mentioned to you. Which can seem somewhat jarring. Unless you go to the additional effort of making sure that The Beast is described, and attend to all similar situations in your story, contrary to the default rules you have now set up.

Yeah but in Inform 6 that would have taken 5 minutes. :frowning:

Yeah, but I suspect that’s a function of your relative familiarity with I6 & I7 :wink:

Dat true. :wink:

One thing I’ve tried that seems to work on a room-by-room basis is this:

“The describe what’s on mentioned supporters in room descriptions rule does nothing when the location is X.”

This is a relatively narrow way to get rid of it without wading too far into the standard rules or breaking other locations.

An even narrower approach, targeting an individual supporter, would be

For printing a locale paragraph about the hook: do nothing.

which will pre-empt the describe what’s on mentioned/scenery supporters rules from running.

1 Like