Keyword Interface

version 4 by Aaron Reed

  • Home page
  • Beginning
  • Previous
  • Next



  • Section: Objects

    When object keyword highlighting is set to true, the extension will automatically highlight objects listed in bulk when looking or taking inventory, as well as objects manually invoked in room descriptions if their names are bracketed.

        The Office is a room. "Only a single [lamp] illuminates this dim office, bare except for a solitary [desk].". A metal lamp and a desk are scenery in the office. A telephone book is on the desk.

    This produces output like the following (where emphasis is marked with asterisks):

        The Office
        Only a simple metal *lamp* illuminates this dim office, bare except for a solitary *desk*.

        On the *desk* is a telephone *book*.

    The emphasized word will be the final word of the object's printed name. To change this, you can use the object's "keyword" property, which should be one of the other words in the printed name. You can also define an object as "keywordless," in which case it will not be emphasized. Finally, you can manually mark a "[o]word[x]" with the o and x tags to emphasize it in object style.

        A telephone of Swedish origin with keyword "telephone" is in the Office. The description of the telephone is "You notice a faint [o]smudge[x] of lipstick on the receiver.". Some scattered cigarettes are a keywordless thing in the Office.

    Produces:

        "You can also see a *telephone* of Swedish origin and some scattered cigarettes here."

    Object highlighting, when activated, highlights keywords when looking or taking inventory. If you want to disable one of these you can use code like the following:

        The Keyword Interface highlight objects when looking rule is not listed in any rulebook.

    Conversely, if you want object highlighting during other times, you can use code like this:
        
        Rule for printing the name of a thing (called item) while asking which do you mean:
            carry out the object keywording activity with item.

    In certain cases, the same object may be highlighted twice in a room description. This is due to a limitation of Inform's rules for printing the name of an object wherein there's no easy way to tell whether it's being printed to memory or the screen; anyone who knows a workaround for this, please let me know.