I7 : 'list of opinionated-name of garments' did not work

I want to print a list of garments. But instead of listing the garments actual names, I want to list their opinionated-name:

[code]A garment is a kind of thing. A garment is usually wearable.
A garment have some text called opinionated-name.
The opinionated-name of a garment is usually “(error: opinionated-name of this garment is not defined)”.

Instead of examining a person (called p):
say “He is wearing [list of garments worn by p].”; [Here, it should list the garments opinionated-name instead]

Chapter - the world

Coffee Shop is a room.
Nick is a person in Coffee Shop.

Some sunglasses are garment.
Some sunglasses are worn by Nick.
The opinionated-name of sunglasses is “cheap sunglasses”.

The jeans are some garment.
The jeans are worn by Nick.
The opinionated-name of jeans is “dirty jeans”.[/code]

I can’t get the list to mention the opinionated-name instead. Do I need to somehow create a listing garments opinionated-name rule from scratch?

You can simply hook into the “printing the name of” activity.

[code]A garment is a kind of thing. A garment is usually wearable.
A garment have some text called opinionated-name.
The opinionated-name of a garment is usually “(error: opinionated-name of this garment is not defined)”.

Instead of examining a person (called p):
say “He is wearing [a list of garments worn by p].”

For printing the name of a garment (called item) while examining:
say the opinionated-name of the item.

Chapter - the world

Coffee Shop is a room.
Nick is a person in Coffee Shop.

Some sunglasses are garment.
Some sunglasses are worn by Nick.
The opinionated-name of sunglasses is “cheap sunglasses”.

The jeans are some garment.
The jeans are worn by Nick.
The opinionated-name of jeans is “dirty jeans”.[/code]

Keep in mind, though, that if you’re just going to prepend adjectives, you might be better suited to having said adjective as a property. That way, Inform will be able to understand “dirty jeans” as referring to the jeans.

Thanks! However, that would also trigger if the player examines a garment lying on the ground. But this can be fixed by examining “the holder of the item”:

For printing the name of a garment (called item) while examining the holder of the item:
	say the opinionated-name of the item.

By the way, what does For printing mean? Beginning a sentence with “for” doesn’t sounds like proper english. That word usually connect two other words, like A Source Book for Mediaeval History, Votes for Women, An Apology for the Life of Mr. Colley Cibber, etc.

It’s short for “Rule for printing the name of…” Printing the name of is an activity, so it’s carried out with a “Rule for printing the name of” (there can also be rules “Before printing the name of…” and “After printing the name of…”). See chapter 18 of Writing with Inform, especially §18.3 and §18.6.

Sometimes English lets you start something with “For”; I might give a gift with a label “For you,” or say “For a pompadour that stays in place, try Brylcreem!” (No express or implied warranty.) But the main moral is, Inform doesn’t obey the rules of English–usually it’s that something that makes sense in English doesn’t make sense to Inform, but sometimes it’s the other way around.

“FOR GLORY!” :slight_smile: