Chapter 4: Kinds
4.7. New value properties

Moving on to properties which contain values, such as the "matching key" property of a door or a container, we need to use a different formulation.

A dead end has some text called river sound. The river sound of a dead end is usually "a faint whispering of running water". The Tortuous Alcove has river sound "a gurgle of running water".

The property "river sound" is now applicable only to dead ends, and we would not be allowed to talk about it in any other context. As can be seen, it holds a piece of text. If we tried the following:

The river sound of the Tortuous Alcove is 7.

...then Inform would object, because the number 7 is the wrong kind of value to go into the "river sound" property. If we need a numerical property, we can try this instead:

A dead end has a number called the difficulty rating. The Tortuous Alcove has difficulty rating 7.


43
 Example  Would you...?
Adding new properties to objects, and checking for their presence.


PreviousContentsNext