Chapter 3: Things
3.5. Kinds

The following description runs to only 33 words, but makes a surprisingly intricate design. It not only places things within rooms, but also places them very specifically with respect to each other:

"Midsummer Day"

East of the Garden is the Gazebo. Above is the Treehouse. A billiards table is in the Gazebo. On it is a trophy cup. A starting pistol is in the cup.

Inform needs to identify the places and objects being described by the nouns here, and to guess what it can about them. For instance, the pistol can be picked up but not walked inside, whereas the Treehouse is the reverse. (This is obvious to someone who knows what these words mean, less obvious to a computer which does not, but the text contains sufficient clues.) Inform does this by sorting the various nouns into different categories, which are called "kinds". For instance:

Garden, Gazebo, Treehouse - room
billiards table - supporter
cup - container
starting pistol - thing
East, up (implied by "above") - direction

(A container is something which can contain other things, and a supporter similarly.) For instance Inform knows that if one thing is in another, then the second thing is either a room or a container, and if one thing is on another, the second thing is a supporter. This worked nicely for the design above, but:

In the Treehouse is a cardboard box.

results in the cardboard box being made only a "thing": because nothing has been put inside it, there is no reason for Inform - which does not know what a cardboard box looks like - to guess that it is a "container". So we need to add:

The box is a container.

It is rather clumsy to have to write two sentences like this, so we would normally write this instead:

In the Treehouse is a container called the cardboard box.


10
* Example  First Name Basis
Allowing the player to use different synonyms to refer to something.

RB

Sometimes we create objects that we want the player to be able to call by different names: a television that should also answer to "tv" and "telly", for instance, or a refrigerator the player might also call "fridge". In this case, we can use instructions like

Understand "tv" and "telly" as the television.

to add extra names to the object we've defined.

"First Name Basis"

The Crew Lounge is a room. "Deliberately spartan: the crew feels weight restrictions here first, so there aren't any chairs, just a few thin pads on the ground."

The holographic projector is a device in the Crew Lounge. "The one major source of entertainment is the holographic projector, a top of the line Misthon 9000, on which you view every beam you can get." Understand "holo" or "holograph" or "Misthon" or "9000" as the projector.

The description of the projector is "[if switched on]The projector is now playing a documentary about the early politics of the Mars colony.[otherwise]The air above the projector is disappointingly clear.[end if]".

(This description is for local color; we will learn more about devices, and conditions like "if switched on", later in this chapter.)

By default, Inform does not understand the names of an object's kind as referring to that object, unless the object has no other name of its own. We can change this, if we like, by defining names that should be applied to everything of a given kind:

Lewis and Harper are men in the Crew Lounge. Understand "man" or "guy" or "chap" or "lad" or "male" as a man. Understand "men" or "chaps" or "lads" or "guys" or "males" as the plural of a man.

The description of Lewis is "A wiry, excitable engineer who just signed aboard last week." The description of Harper is "Harper's a good guy: taciturn when sober, affectionate when drunk, but rarely annoying in either state."

Test me with "x holo / x man / lewis / x guy / harper / turn on projector / x holo projector / get men".

Inform's naming abilities go considerably further, in fact: we can also instruct it to understand words only under certain circumstances, or only when they appear with other words. Fuller details may be found in the chapter on Understanding.

11
* Example  Midsummer Day
A few sentences laying out a garden together with some things which might be found in it.

RB


PreviousContentsNext