§17.15. Understanding things by their properties
Items are ordinarily understood only by their original given names. For instance, if we have:
In the Herb Garden is a china pot.
then the player could refer to this as "pot", "china pot" or "china". We can embellish this by adding extra forms:
Understand "chinese pot" or "chinese vase" as the china pot.
But suppose the pot changes its nature in the course of play? If we have:
The china pot can be unbroken or broken. The china pot is unbroken.
After dropping the china pot:
say "Crack!";
now the china pot is broken;
now the printed name of the pot is "broken pot".
So now the player would reasonably expect to call it "broken pot", a wording which would have been rejected before. We can achieve this by writing:
Understand the unbroken property as describing the pot.
which allows "unbroken" or "broken" to describe the pot, depending on its state. And, since the player might well use a different adjective but with the same idea in mind, we can even add:
Understand "shattered" or "cracked" or "smashed" as broken. Understand "pristine" as unbroken.
This is something of a toy example, but the feature looks rather more useful when there are more pots than just one:
A flowerpot is a kind of thing. A flowerpot can be unbroken or broken. Understand the broken property as describing a flowerpot.
After dropping an unbroken flowerpot:
say "Crack!";
now the noun is broken;
now the printed name of the noun is "broken flowerpot";
now the printed plural name of the noun is "broken flowerpots".
The Herb Garden is a room. In the Herb Garden are ten unbroken flowerpots.
We then have the dialogue:
Herb Garden
You can see ten flowerpots here.
>get two flowerpots
flowerpot: Taken.
flowerpot: Taken.
>drop all
flowerpot: Crack!
flowerpot: Crack!
>look
Herb Garden
You can see two broken flowerpots and eight flowerpots here.
>get an unbroken flowerpot
Taken.
and so on and so forth.
There are in fact two slightly different forms of this kind of sentence:
Understand the broken property as describing a flowerpot.
Understand the broken property as referring to a flowerpot.
The only difference is that in the "describing" case, the property's name alone can mean the thing in question - so "take unbroken" will work; whereas, in the "referring to", the property's name can only be used as an adjective preceding the name of thing itself - so "take unbroken flowerpot" will work but "take unbroken" will not.
![]() | Start of Chapter 17: Understanding |
![]() | Back to §17.14. Tokens can produce values |
![]() | Onward to §17.16. Understanding things by their relations |
|
|
|
|
|
|
|
Inform can also understand text properties:
This may not seem very much different from having the pattern be a kind of value -- except that texts can, of course, hold almost anything. Further exploration of these possibilities may be found in the chapter on Advanced Text. |
|
Inform can also understand text properties:
This may not seem very much different from having the pattern be a kind of value -- except that texts can, of course, hold almost anything. Further exploration of these possibilities may be found in the chapter on Advanced Text. Inform can also understand text properties:
This may not seem very much different from having the pattern be a kind of value -- except that texts can, of course, hold almost anything. Further exploration of these possibilities may be found in the chapter on Advanced Text. |