Container in Inventory

Hello, all!

As always, thank you for the continued support, intrepid Inform coevals!

How can I code it so that a container (when open) does not have its content reported when the player examine his inventory? Hopefully this makes sense!

After printing the name of the box when taking inventory: omit contents in listing.

Thank you, my friend!

Can you tell me – how did you learn this? I can’t find anything like it in any of the so-called documentation for Inform 7. Can you point me to somewhere I can learn other commands such as this?

Thank you!

It’s mentioned in §18.10. Printing the name of something - however not in the exact form regarding inventory.

I had actually found it by googling “omit contents in listing inform 7” and looking through a bunch of examples. It’s easy to search for things like this, but you have to familiarize yourself with the phrasings Inform uses to refer to processes.

Although the Inform documentation can seem really long, it does help to make your way through it at least once because all these concepts build upon each other. For example, that chapter says:

Rule for printing the name of the bottle while not inserting or removing: if the bottle contains sand, say "bottle of sand"; otherwise say "empty bottle"; omit contents in listing.

I know from other parts of the manual that “while taking inventory” is a similar phrase to “while not inserting or removing” so I can use it there. I also know I can phrase it as an AFTER rule because the verbiage I want Inform not to list happens after the item in inventory is printed. I don’t need to build an entire new rule as they do above using “Rule for printing…” - I just want it to cut off after printing it as normal. But you could similarly follow their example with something like:

Rule for printing the name of the box while taking inventory: say "that weird box you found on the beach"; omit contents in listing.

If you can sit down with the manual and get through a few chapters a day - I recommend reading it in the IDE and actually hitting the buttons to play with the examples and experiment with them as you go - that’s how you learn to know what to search for. I don’t know everything about Inform - in fact there are parts I shun because I don’t like using them (tables) - but I know how to search for if necessary.

Then once you get through the manual, The Recipe Book is also invaluable because it specifically shows a method to accomplish complex tasks an author might want to do, such as having a money system with different coins and how to do the math. you don’t have to read the recipe book beginning-to-end, but it’s good to at least read the topics so you know what subjects it covers when you need to refer to it.

I appreciate the reply and the guidance, my friend. Thank you!