First Name Basis

Example 11

Allowing the player to use different synonyms to refer to something.

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".
Test me with "x holo / x man / lewis / x guy / harper / turn on projector / x holo projector / get men".
Crew Lounge
Deliberately spartan: the crew feels weight restrictions here first, so there aren't any chairs, just a few thin pads on the ground.

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.

You can also see Lewis and Harper here.

>(Testing.)

>[1] x holo
The air above the projector is disappointingly clear.

The holographic projector is currently switched off.

>[2] x man
Who do you mean, Lewis or Harper?

>[3] lewis
A wiry, excitable engineer who just signed aboard last week.

>[4] x guy
Who do you mean, Lewis or Harper?

>[5] harper
Harper's a good guy: taciturn when sober, affectionate when drunk, but rarely annoying in either state.

>[6] turn on projector
You switch the holographic projector on.

>[7] x holo projector
The projector is now playing a documentary about the early politics of the Mars colony.

The holographic projector is currently switched on.

>[8] get men
What do you want to get those things from?

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.