Chapter 8: Vehicles, Animals and Furniture
8.4. Furniture

Most domestic furniture consists of supporters and containers of one size or another. This means that the simplest furniture needs no elaborate instructions:

The candlestick is on the dining table. The dining table is fixed in place.

The silver salt cellar is on the serving trolley. The serving trolley is pushable between rooms.

The pillow is on the bed. The bed is enterable and fixed in place.

The examples below are therefore mostly ways to get around the usual restrictions on containers (that they only have one interior) and supporters (that they cannot simultaneously be containers as well).

Yolk of Gold provides a set of drawers, that is, a container with multiple interiors.

U-Stor-It provides a way to have containers with a lid which is also a supporter.

Swigmore provides a supporter which holds up the player, but has no top surface as such, and cannot hold up anything else. Kiwi demonstrates a kind of high shelf, whose objects cannot be seen or used unless the player stands on a ladder.

Princess and the Pea shows how a pile of supporters, each on top of the last, could be managed.

Tamed demonstrates furniture large enough to get inside, or on top of.

Circle of Misery demonstrates a conveyor belt, which can hold multiple items but only brings one of them within the player's reach at a time.

* See Position Within Rooms for a box that can be positioned and used as a stepping stool

* See The Human Body for letting the player take different postures on furniture or on the floor

* See Room Descriptions for tables and other furniture whose content listing is suppressed or modified in a room description

* See Entering and Exiting, Sitting and Standing for making the player automatically rise from a seat before leaving the room

* See Clocks and Scientific Instruments for a grandfather clock

* See Kitchen and Bathroom for a mirror the player can look into


83
** Example  Yolk of Gold
Set of drawers where the item the player seeks is always in the last drawer he opens, regardless of the order of opening.

WI
172
* Example  Princess and the Pea
The player is unable to sleep on a mattress (or stack of mattresses) because the bottom one has something uncomfortable under it.

WI
57
*** Example  U-Stor-It
A "chest" kind which consists of a container which has a lid as a supporter.

WI

Suppose we want to write a game in which there are a number of chests. Each of these chests will be a container, but have a lid which is a supporter.

"U-Stor-It"

Section 1 - Assemblies and Supporters

A chest is a kind of container. A chest is always openable. A chest is usually fixed in place. A chest is usually closed. The specification of a chest is "Represents a container with a separately implemented lid; the lid is itself a supporter."

A lid is a kind of supporter. A lid is part of every chest. The specification of a lid is "A supporter attached to a chest, which can only support things when the chest is closed."

(The "specification" of a kind is not really a property, and is used instead to describe the kind in the Index. So the text of these specifications is never found in the game.) Of course, this doesn't get us very far. We will also want the game to correctly interpret variations on "open the chest" and "close the lid", redirecting actions appropriately.

Section 2 - Opening and closing

Before opening a lid which is part of a chest (called the item):
    try opening the item instead.

Before closing a lid which is part of a chest (called the item):
    try closing the item instead.

Before opening a chest when something is on the lid (called the obstruction) which is part of the noun:
    repeat with item running through things on the obstruction:
        say "(first removing [the item])";
        try taking the item.

Instead of opening a chest when something is on a lid (called the item) which is part of the noun:
    say "You'd have to remove [the list of things on the item] from the lid first." instead.

Instead of looking under a lid which is part of a chest (called the item):
    try opening the item.

We may also want to be able to deal with "put in" and "put on" appropriately, even if the player names the wrong part of the object:

Section 3 - Insertion and Support

Before inserting something into a lid which is part of a chest (called the item):
    try inserting the noun into the item instead.

Before putting something on a chest when a lid (called the item) is part of the second noun:
    try putting the noun on the item instead.

Furthermore, we don't want the player to be able to put things on the lid while the chest is open:

Before putting something on a lid which is part of an open chest (called the item):
    say "(first closing [the item])";
    try closing the item.

Instead of putting something on a lid which is part of an open chest (called the item):
    say "[The item] would need to be closed first."

And then we may also want a couple of rules for describing our assembled object nicely:

Section 4 - Description in Rooms

Instead of examining a closed chest when something is on a lid (called the top) which is part of the noun:
    say "[The noun] is closed, and there [is-are a list of things on the top] on top."

After printing the name of a chest (called the item) while listing contents of a room:
    if a lid (called the second item) which supports something is part of the item:
        say " (on which [is-are a list of things on the second item])";
        omit contents in listing.

Now we are free to create entire treasure rooms at a single blow:

Section 5 - U-Stor-It Facility

The U-Stor-It Facility is a room. The sea trunk, the shipping crate, and a metal box are chests in the U-Stor-It Facility. The metal box contains a sapphire, a gold coin, and a signed photograph of Babe Ruth.

Even though we have never explicitly defined it, the metal box has a "metal box's lid", which we can use at need.

The metal box's lid supports a small card. The description of the small card is "It reads, 'Back in 5 mins - Pandora.'"

Test me with "open trunk / x card / open metal box / put all in metal box / get card / put card on box".

393
** Example  Swigmore U.
Adding a new kind of supporter called a perch, where everything dropped lands on the floor.

WI
347
* Example  Kiwi
Creating a raised supporter kind whose contents the player can't see or take from the ground.

WI
12
* Example  Tamed
Examples of a container and a supporter that can be entered, as well as nested rooms.

WI
423
* Example  Circle of Misery
Retrieving items from an airport luggage carousel is such fun, how can we resist simulating it, using a list as a ring buffer?

WI


PreviousContentsNext