Code Causing Runtime Error

Sorry to be back again so soon. I’ refactoring my code to be more efficient but this snippet causes a runtime error. I’m at a loss.

The lab is a room.

Color is a kind of value. The colors are aqua, crimson, emerald, gray, indigo, khaki, magenta, and non-descript. 

A fuse is a kind of thing. A fuse can be lost or found. A fuse is usually lost. A fuse has a color. A fuse is usually non-descript. The description of a fuse is "This is a [color of the noun] colored electrical fuse." The printed name of a fuse is "a [color of the noun] colored fuse".

fuse1 is a fuse. It is in the lab. The color of the fuse is aqua. 
fuse3 is a fuse. It is in the lab. The color of the fuse is crimson. 
fuse5 is a fuse. It is in the lab. The color of the fuse is emerald. 

Error Message:
Not everything has every property. For instance, a room cannot have the property carrying capacity: it would not mean anything. Generally speaking, the properties available to something are specified by its kind. If we say that A room has a number called maximum population. then the property maximum population is available to any room. This applies to either/or properties as well: you might say that a room is not transparent, but Inform takes the firm line that we cannot even ask, because it is meaningless for a room to be either transparent or opaque.

So, anyway, here it seems that you have tried to access a property for something not allowed to have it.

thanks in advance,
d.

Try “item described” here.

Just to expand on @BadParser 's answer: the noun refers specifically to the direct object of the current action. Something can have its name printed when it isn’t the noun, e.g. while printing a room description (in fact, while printing the initial room description, the noun is nothing, which is what gives this error). Inform is smart enough to infer that naming a property in the description of a thing means that property of the item described, so you can just write a [color] fuse and it will treat it as if you said a [color of the item described] fuse.

It’s not, however, quite as smart at resolving anaphora as you want it to be. When you write The color of the fuse is emerald it can’t work out that you mean the most recent declared fuse, so in your example, after fixing the run-time error, all of the fuses appear emerald. You will need to say the color of fuse1 is aqua etc. to have it understood the way you want.

2 Likes

Thank you both. I’m learning!

1 Like