Illegal Value in Printing the Name of Something

Hi everyone

Would anyone mind telling me what I’ve done wrong here? Code is short and self-explanatory. Result is below it.

The Clearing is a room.

A color is a kind of value.
The colors are red, orange, yellow, green, blue, purple, black, white, gray.

A feather is a kind of thing.
A feather has a color.
Understand the color property as describing a feather.
Rule for printing the name of a feather:
	say "[color of the noun] feather".

There is a blue feather in the clearing.


You can see a <illegal color> feather here.

This happens with any color on the list.

You need to use [color of the item described] instead. It’s not the noun unless the player is referring to it in a command, which isn’t the case there.

1 Like

‘noun’ is a variable set to an object associated with an action in progress, so is not a valid value while printing the name of something as part of a room description, as here. When printing descriptions of objects, the variable ‘the item described’ is always set to the object in question:

Rule for printing the name of a feather:
	say "[color of the item described] feather".

Although if you’re printing the value of a property, you can just give the name of the property and Inform assumes it applies to ‘the item described’ if it has such a property. So this works too:

Rule for printing the name of a feather:
	say "[color] feather".

Thanks a lot.

Thanks Gavin