Hookleft.pngChapter 8: ChangeHookup.pngHookright.png

ยง8.4. Change of either/or properties

When we have an either/or property, we can set it like so:

Instead of waiting when the oaken door is closed:
    say "There is a slow, creaky click! sort of noise as the door swings open, apparently all by itself.";
    now the oaken door is open.

If it is open already, nothing changes: in any case nothing is said to the player unless we give explicit instructions to that effect, as we've done here.

Inform protects its model world from accidental damage in several ways, one of which is to ensure that things are not given properties which they are not allowed to have. So this, for instance, will not be accepted:

now the oaken door is unvisited

More subtle problems arise if it is not possible to tell, when the game is being constructed, what the object in question will be: for instance, if we try to change a randomly chosen object to be "unvisited". Inform therefore makes additional checks during play, printing up a suitable message only if the rules are violated. The net effect is that it is impossible for the oaken door ever to have the "unvisited" property.


*ExampleVitrine
An electrochromic window that becomes transparent or opaque depending on whether it is currently turned on.


PreviousContentsNext