Suppressing (open) and (closed) in container names

I’ve been searching for an answer to this for hours and have been unable to find it. How can I suppress the (closed) that shows up as the printed name of a clock? I still want the clock to be mentioned, but I don’t want the player to know right away that it can be opened and closed. Thanks for your help.

The answer is not exactly in an obvious place in the documentation unfortunately; look in “17.15. Printing room description details of something”.

An example:

The player is in a room called Sichotense. A moose, birdhouse, and frumplesnitch are in Sichotense. The birdhouse and the frumplesnitch are closed containers. 

Rule for printing room description details of a birdhouse: stop. 

I only found this myself by searching “suppressing open container name” on RAIF.

Also Jim Aikin’s I7 handbook is a good reference for this sort of thing, and to quote from it:

Note that the last two lines of code there should be indented with tabs.

Besides what George said, look at the documentation for “omit contents in listing” in 17.10; it not only omits the contents, but also omits the (open) or (closed) tag. I forget how I found it – I think just a general sense that we wanted something to do with “Printing the name of something.”

This seems to be a more general way of doing what you want – I added a bit of code to make sure that once you open (or close) the clock, it does appear with (open) or (closed), since now you know it can be opened:

[code]

Hall is a room. The clock is a container in Hall. The clock is openable. The clock is closed.

A container can be covert or overt. A container is usually overt. The clock is covert.

Rule for printing the name of a covert container (called coverture):
say “[printed name of coverture]”;
omit contents in listing.

After opening a covert container:
now the noun is overt;
continue the action.

After closing a covert container:
now the noun is overt;
continue the action.[/code]

“Continue the action” in the “after” rules seems to be necessary in order to get the default message for opening and closing things, and perhaps anything else you’ve programmed for the opening and closing

Interesting fact: if you type [coverture] instead of [printed name of coverture], I7 will set up an infinite loop when you try to compile, and it will freeze the I7 IDE, and if you aren’t quick it’ll freeze whatever else you’re doing, and there will be much weeping and gnashing of teeth, thus: :frowning: :open_mouth: :astonished: :imp:. BLUH. (Another interesting fact: “coverture” doesn’t mean that.)

Oh, if you just want something to apply to the clock and don’t want to mess around with extra properties like “covert,” this seems to work:

[code]Hall is a room. The clock is a container in Hall. The clock is openable. The clock is closed.

Rule for printing the name of the clock:
unless the clock has been open:
say “[printed name of the clock]”;
omit contents in listing;
otherwise:
continue the action.[/code]

This may even be more general, because it works if the clock is opened by something other than the player, I think. I’d been trying something like this before, but didn’t succeed, either because I forgot about “unless” or because I got confused by my infinite loop or because I hadn’t figured out about “omit contents in listing” yet.

Thanks, everyone. Works beautifully!