Chapter 8: Vehicles, Animals and Furniture

§8.1. Bicycles, Cars and Boats; §8.2. Ships, Trains and Elevators; §8.3. Animals; §8.4. Furniture; §8.5. Kitchen and Bathroom

arrow-up-left.pngContents of The Inform Recipe Book
arrow-left.pngChapter 7: Other Characters
arrow-right.pngChapter 9: Props: Food, Clothing, Money, Toys, Books, Electronics
arrow-down-right.pngIndexes of the examples

§8.1. Bicycles, Cars and Boats

The vehicle kind in Inform refers to an object which can carry at least one person, but is small enough to fit into a single location:

In the Garden is a vehicle called the motor mower.

We can then apply different rules to a player going somewhere on foot or in the vehicle. Peugeot (a bicycle) is an easy example; No Relation (a car) adds an ignition switch to the vehicle; Straw Boater (a motorboat) gets around areas of lake where travel on foot is not just slower but impossible.

Hover (a sci-fi "hover-bubble") changes the appearance of the landscape when it is seen from inside the vehicle.

* See Ships, Trains and Elevators for larger conveyances


arrow-up.pngStart of Chapter 8: Vehicles, Animals and Furniture
arrow-left.pngBack to Chapter 7: Other Characters: §7.16. Social Groups
arrow-right.pngOnward to §8.2. Ships, Trains and Elevators

*ExamplePeugeot
A journey from one room to another that requires the player to be on a vehicle.

*ExampleNo Relation
A car which must be turned on before it can be driven, and can only go to roads.

**ExampleStraw Boater
Using text properties that apply only to some things and are not defined for others.

Suppose we want the player to see a modified room description when he's viewing the place from inside a vehicle. There are several conceivable ways of doing this; the example here shows a rather advanced way, but is very flexible and will let us write all sorts of special cases.

paste.png "Hover"

Use full-length room descriptions.

Emerald City is a room. "All the buildings are spires and none of them have doors." The Vast Desert is west of Emerald City. "[if the player is in a vehicle]Outside, a[otherwise]A[end if] trackless waste stretches as far as the eye can see in every direction."

The hover-bubble is a vehicle in the Emerald City. "Your hover-bubble awaits." The description is "The hover-bubble is a clear globe-shaped vehicle capable of transporting you anywhere you could walk, but faster." Understand "bubble" as the hover-bubble. The hover-bubble contains a chocolate wrapper and a parking ticket.

Here's the tricky part, which relies on material from the chapters on Activities and Rulebooks:

The container interior rule is listed before the room description body text rule in the carry out looking rules.

This is the container interior rule:
    if the actor is the player and the player is in an enterable thing (called current cage), carry out the describing the interior activity with the current cage.

Describing the interior of something is an activity.

Now we've done that, we can write a "rule for describing the interior" of something, which will print whatever we like:

Rule for describing the interior of the hover-bubble:
    say "The hover-bubble is transparent, but tints everything outside very faintly lavender."

In fact, as a special refinement, we could even say:

Rule for describing the interior of the hover-bubble when the hover-bubble contains more than one thing:
    say "The hover-bubble is transparent, but tints everything outside very faintly lavender. Beside you you can see [a list of other things in the hover-bubble]."

Definition: a thing is other if it is not the player.

Rule for listing nondescript items of the hover-bubble when the player is in the hover-bubble: do nothing.

Test me with "get in bubble / look / west / take all / look / get out / east".

And now anything that's beside us in the vehicle will be described during that first paragraph, rather than later on.

***ExampleHover
Letting the player see a modified room description when he's viewing the place from inside a vehicle.

Suppose we want the player to see a modified room description when he's viewing the place from inside a vehicle. There are several conceivable ways of doing this; the example here shows a rather advanced way, but is very flexible and will let us write all sorts of special cases.

paste.png "Hover"

Use full-length room descriptions.

Emerald City is a room. "All the buildings are spires and none of them have doors." The Vast Desert is west of Emerald City. "[if the player is in a vehicle]Outside, a[otherwise]A[end if] trackless waste stretches as far as the eye can see in every direction."

The hover-bubble is a vehicle in the Emerald City. "Your hover-bubble awaits." The description is "The hover-bubble is a clear globe-shaped vehicle capable of transporting you anywhere you could walk, but faster." Understand "bubble" as the hover-bubble. The hover-bubble contains a chocolate wrapper and a parking ticket.

Here's the tricky part, which relies on material from the chapters on Activities and Rulebooks:

The container interior rule is listed before the room description body text rule in the carry out looking rules.

This is the container interior rule:
    if the actor is the player and the player is in an enterable thing (called current cage), carry out the describing the interior activity with the current cage.

Describing the interior of something is an activity.

Now we've done that, we can write a "rule for describing the interior" of something, which will print whatever we like:

Rule for describing the interior of the hover-bubble:
    say "The hover-bubble is transparent, but tints everything outside very faintly lavender."

In fact, as a special refinement, we could even say:

Rule for describing the interior of the hover-bubble when the hover-bubble contains more than one thing:
    say "The hover-bubble is transparent, but tints everything outside very faintly lavender. Beside you you can see [a list of other things in the hover-bubble]."

Definition: a thing is other if it is not the player.

Rule for listing nondescript items of the hover-bubble when the player is in the hover-bubble: do nothing.

Test me with "get in bubble / look / west / take all / look / get out / east".

And now anything that's beside us in the vehicle will be described during that first paragraph, rather than later on.