For example I have a barn and a barn door which is causing a problem.
I also have an empty stable which is a container, with a reindeer in it which you can’t see until you examine the stable.
I seem to recall seeing a description of just such a problem, which i can’t find now.
I could make the stable another room which would solve that problem but now I’m invested in solving the problem as stated.
While not a hard and fast rule, it’s often a good choice to name things with an adjective - like “old barn” instead of just “barn”. The reason for that is to avoid the disambiguation situation where the parser asks “Which do you mean, the barn or the barn door?” There are circumstances where if the player answers BARN the parser still isn’t sure in this case and will keep asking, making it impossible to interact with single-word objects when there is another similarly-named object that uses that other object name as an adjective when both are in scope. Each object name needs a unique word to avoid this.
For the stable, make it a transparent container (as well as “fixed in place” and “enterable” most likely) and it should say “…in which is a reindeer…” by default.
Some IF systems, such as (iirc) ZILF, get around this sort of ambiguity by storing nouns and adjectives separately, then requiring at least one word from an object’s noun list (plus any number of words from its adjective list). So “barn” doesn’t match the barn door (because it’s an adjective for the door, but not a noun, so there’s no noun present), but does match the old barn (because it’s a noun for this object).
However, no version of Inform (as far as I’m aware) takes this tack by default, and I7’s object-name-storing mechanism is opaque enough that I’m not comfortable modifying it. (The parser modifications are easy by comparison; I think it’s even an example in the DM4.)
If you really want to have the barn just be called “barn,” you could make sure that “barn” by itself can’t refer to the barn door by something like this:
The barn-door is a door. The printed name of the barn-door is "barn door". Understand "barn door" or "door" as the barn-door.
Thank you. I think I’ve read about it so it was probably there. I’ll take another look.
That’s a good idea. Thank you.