Suppressing container state indicator in Inform 7

First post here!

I’m experimenting with Inform 7 and while I like the approach I find it’s really hard to find what you don’t know. I’m hoping to pick up some tips on how to look for information. My specific example is this: I created a container that is closed and in the game text it says “You can see a small box (closed) here.”

I don’t want it to say (closed) like that. But how are you supposed to find how to deal with that? I searched the documentation for “closed” but that returned way too many results to be useful as would be expected. I looked for “container” but that was still a lot of stuff to wade through.

I’m not sure what that text of “(closed)” is actually called in Inform so I can’t search on that. For example ‘container state’ or something. It’s also not clear what I want to do in Inform-speak, such as ‘suppress container state.’ I eventually figured out it might be a property but I don’t see how to not print the property.

I’m finding Inform’s structure makes it really hard unless you already know what you’re looking for but I’m guessing this is just due to lack of familiarity with what to search for.

Any tips?!

2 Likes

Welcome to the forum!

Check out Recipe Book 3:1. There’s a way to remove these messages for nondescript (things without a written description) wholesale with “room description details”.

Another method is to write an “initial appearance” for containers. You can declare this: "the initial appearance of the fancy box is “…” or just put the initial appearance description in quotes after you declare the item.

Initial appearance only shows up until the item is moved and dropped again. If you don’t stop the rule for printing room description details rule, it will then pick up the (open)(closed) tags.

Lab is a room.

a plain box is an openable, closed container in Lab.

a fancy box is an openable, closed container in Lab. "A fancy box strikes your fancy."

Rule for printing room description details:
	stop.

Another handy phrase is “omit contents in listing” if you don’t want open containers to have contents described unless the player looks inside.

I agree, the built-in documentation is not a complete success as a reference, it often really isn’t intuitive either from the index (especially given the need to keep expanding top-level headings) or from the results of many searches where to find what one is looking for.

My tips are:

  1. Be sneaky and try to include as much ‘peripheral’ text or punctuation (brackets etc.) in your searches as possible to narrow down the matches. In this case, try searching for ‘(closed)’ (9 matches) rather than ‘closed’ (>200 matches).

  2. The search box accepts multiple-word searches, so again include as many contiguous words as possible, e.g. rather than searching for ‘matching’ search for ‘text matching’

  3. Visually filter the search results first by looking under the Document heading ideally for a section heading (rather than a code example) which seems to correspond to what you’re looking for and, failing that, by scanning the Result column for surrounding text that looks promising

  4. Learn to find your way round the Index. Here I mean the Index tab of your game (this is available once you have clicked ‘Go’ to compile it), rather than the index of the Documentation tab. It’s often easier to look stuff up there than in the documentation. What you were seeking here is in the Index under Rules => Standard => How things are described => Printing room description details, with a hyperlink to the relevant page in the Documentation

  5. Make a print-out of the expanded headings & sub-headings of the Documentation as a quick-reference to scan for what you might be looking for. For example, what you were seeking here is most properly described under §18 Activities => §18.16. Printing room description details of something, which sort of looks a promising place to look when it’s staring you in the face.

1 Like

Oh, and another useful alternative to a printed out headings/sub-headings reference sheet (in Windows, anyway) is to:

  1. Go to the home of the Documentation
  2. Click on the [+] symbol next to the top ‘Writing with Inform’ and ‘The Inform Recipe Book’ headings to expand all of their subheadings
  3. Type [Ctrl]-F to bring up the Find dialog
  4. Use this to rapidly search the headings & subheadings for keyword(s), e.g. (in this case) print or describe or describing or description
1 Like