I7 : How does inform deal with things with similar names?

A lot of objects will naturally have kinda the same name:

unmarked key
cabinet key
crystal key

Should I just assume that Inform can figure this out? Or should I do something like

Dark Hole is a room a key-00 is a thing. key-00 is in the Dark Hole. the printed name of key-00 is "silver key". understand "silver key" as key-00. understand "key" as key-00.

Inform 7 would handle the example you provided without any problems whatsoever. It could even handle having an object called “cabinet” and an object called “crystal” in the same game. You just have to remember to use the object’s full name whenever it comes up in code. You would also want to make sure that there are enough synonyms for the player to differentiate the items during the game.

Just don’t ever have

Iron key
Silver key
Key

Because disambiguation won’t work on the last one.

Also, if you use a word in the source that could refer to multiple objects, Inform will preferentially choose an object defined within the same heading (section, chapter, …) over one that’s not. See the end of §2.6 (Why using headings is a good idea).

Right. And if you want to be extra safe in making sure the player can refer to everything (or just make it more convenient for the player to disambiguate), you can use Numbered Disambiguation by Aaron Reed. It’s a very handy extension.

Way late, but … thanks for the help! It was one of those small headaches that I just coldn’t figure out. I think I have made the mistake of shortening the names in my code somewhere, writing ‘Key’ instead of ‘Cabinet Key’. Must look out for that one!

I find the “Gazeteer” section of the Index (under the “World” tab) very helpful for situations like that. It lists every object defined in your game in alphabetical order. You can scan the list for likely suspects like “cabinet key”, and then easily scroll down to the K’s to see if you’ve accidentally also defined “key” somewhere.

Also watch out for the case where you define “key” as a kind of thing, and then “iron key” etc as instances of it. If you then refer to “…a key”, you might wind up with an anonymous key. Which does not appear in the Gazetteer page, I notice.

(The TREE debugging command will list everything.)

I think it should also appear in the Map tab of the index. At least, when I try this code:

Lab is a room. A key is a kind of thing. An iron key is a key. The player carries the key.

which creates the iron key out of play and an anonymous key carried by the player, the anonymous key shows up in the Map tab (as carried by the player) but not in the Gazetteer.