![]() | Chapter 4: Kinds | ![]() ![]() |
4.10. Conditions of things |
We have already seen that the names for either/or properties can be used as adjectives, so that we can talk about "a dark room" (meaning: a room which has the dark property rather than the lighted property). The same goes for the named possibilities for a newly created kind of value:
Colour is a kind of value. The colours are red, blue and green. A building block is a kind of thing. A building block has a colour.
In the playroom are a red building block and a green building block.
Potentially, at least, "colour" is a widely applicable kind of value, and we already have two different things which have colour. But it often happens that we need adjectives to apply just to a single thing, and if so then a shorthand form is allowed:
The cask is either customs sealed, liable to tax or stolen goods.
Inform deals with this by creating a new kind of value, whose possibilities are the named options supplied, and then giving the named object a property whose value has to be one of the possibilities. Initially the cask will be "customs sealed", as that was the first value in the list. We could now write, for instance,
The description of the cask is "A well-caulked Spanish wine cask. [if liable to tax]It really is a shame to have to pay duty on it!"
We will often not need to know this, but the kind of value and the property are usually given the name of the object with the word "condition" tacked on: so in this case "cask condition". For instance, we could write:
The printed name of the cask is "wine cask ([cask condition])".
Only usually, because we might need to define several different conditions of the same thing, and then the names would collide. For instance, suppose we write:
A fruit is a kind of thing. A fruit can be citrus, berry, melon, or pome.
This makes a property and a kind of value each called "fruit condition". But now suppose we add that:
A fruit can be unripened, ripe, overripe, or mushy.
This is a quite unrelated property - a fruit could have any combination of these two properties, in fact. Left to itself, Inform will call the second one "fruit condition 2", but that isn't really ideal if we ever do need to refer to it in other source text. So we are also allowed to give these conditions names of our own choosing:
A fruit can be unripened, ripe, overripe, or mushy (this is its squishiness property).
And now the resulting property and kind of value would be called "squishiness".
Previous | Contents | Next |