Understanding the printed name

While working on an issue in another (very helpful) thread, I came across the issue where a printed name for an object is not understood as the object unless specified in the code. This is easy enough to fix with an Understand line of code, but I am always looking for ways to simplify and automate as much of the code as possible. So, what I’m wondering is instead of having to define this after each one, if a “global catch-all” would be possible to add to the code. The below is wrong, of course, but is something (not wrong) like this possible? Basically, the line of code I’m trying to write would just automatically make any printed name usable by the player to refer to the noun that has that printed name, instead of having to declare each one in the code.

Understand "[the printed name] of [the noun]" as "[the noun]".

Well, this sort of works:

[code]Lab is a room.
A thing has an indexed text called indexed printed name.

When play begins:
repeat with item running through things:
now the indexed printed name of the item is “[item]”.

Understand the indexed printed name property as describing a thing.
EPM is in Lab. The printed name of EPM is “Eyeless Patch Man”.[/code]

But this only allows the player to use the whole phrase “eyeless patch man”; “eyeless” alone won’t work. And it won’t track any changes to the printed name that you make in the course of play.

I think, from your earlier code, that many of your problems will go away if you write

Understand "eyeless", "patch", "man" as EPM. 

Earlier you had

Understand "eyeless patch man" as EPM.

Which, unless I’m mistaken, only allows the player to type the whole thing - where as breaking them allows the player to type any or all of them.

That loop works like a charm! Now, I think I understand the loop itself generally speaking, but I would like to better understand how the token “[item]” ends up putting the value of the printed name into the indexed printed name. Does referring to a thing in a loop by token return it’s printed name?

The Swedish I7 translation (because of certain pecularities of the Swedish language) has a Use Option that makes the game understand the Printed Name of things, including single words in a name and tracing changes to the Printed Names. It works fine as far as I can tell, but it comes at a performance cost that can be noticeable (on slow machines, indeed, intolerable), especially if the objects in your game tend to have rather long Printed Names.

When you use [something] inside a string, it’s expanded using the to say phrases. The default happens to be something like “To say (obj - an object): Say ‘[the printed name of obj]’.” Normally when you use these, they are not expanded until they are printed. If you put them in an indexed text, they are expanded immediately.