Automated Drawers

version 4 by Emily Short

  • Home page
  • Beginning
  • Previous
  • Next



  • Section: Description

    Automated Drawers also adds a line to the description of a drawered object, by default. This description tells us how many drawers there are and which are open currently, as in

        The large dresser has five drawers. The top drawer and the fourth drawer are closed.

    This line is created by the describe drawered objects rule, which may be removed if we dislike it. We may also individually change the pieces of the rule using the describing the drawer layout activity; so for instance we might write

        Rule for describing the drawer layout of the tiny table:
            say "There are two tiny inlaid drawers in the table. "

    to produce

        There are two tiny inlaid drawers in the table. The left drawer is open.

    rather than the usually "The tiny table has two drawers." line. Or we might chain on further descriptive matter, as in:

        After describing the drawer layout of something (this is the list open drawer content rule):
            if an open drawer which is part of the noun contains something
            begin;
                say line break;
                repeat with item running through open drawers which are part of the noun
                begin;
                    if the item contains something, say "In [the item] [is-are a list of things which are in the item]. ";
                end repeat;
                say paragraph break;
            end if.

    Version 2 adds rule names to several rules and slightly modifies textual output. Version 3 updates for compatibility with Inform versions from 5T18.