Chapter 8: Vehicles, Animals and Furniture
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


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

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

WI

We need to designate certain rooms as roads. Since the status of being a road will not change during play, we do this with a kind:

"No Relation"

A road is a kind of room. Definition: a room is offroad if it is not a road.

Instead of going by a vehicle (called the auto) to somewhere offroad:
    say "You can't drive [the auto] off-road."

Trafalgar Square is a road. "The Square is overlooked by a pillared statue of Admiral Lord Horatio Nelson (no relation), naval hero and convenience to pigeons since 1812."

The National Gallery is north of Trafalgar Square. The Strand is east of Trafalgar Square. The Strand is a road.

The car is a vehicle in Trafalgar Square. The ignition is a device. The ignition is part of the car. Instead of going by the car when the ignition is switched off: say "The ignition is off at the moment." Instead of switching on the car, try switching on the ignition. Instead of switching off the car, try switching off the ignition.

Test me with "get in car / n / e / turn on car / n / e / get out / w / n / s / e / get in car / turn off car / w / turn on ignition / w".

(In the course of the writing of Inform 7, much of Trafalgar Square was pedestrianised, making this example already out of date.)

A further technical note: notice "going by a vehicle" in the above rule, rather than "going by something". A rule such as "Instead of going by something..." will be matched whenever the player tries to go some direction while in an enterable object, whether or not that object is actually capable of movement. This is sometimes useful, but in this case we want the warning to apply only when the player is in a vehicle; if we added Trafalgar Square's statue bases to the scenario, we would not want

You can't drive the pedestal off-road.

So we restrict the rule to "Instead of going by a vehicle..."

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

WI
28
*** Example  Hover
Letting the player see a modified room description when he's viewing the place from inside a vehicle.

WI


PreviousContentsNext