1
0
Fork 0
mirror of https://github.com/ganelson/inform.git synced 2024-07-07 17:44:22 +03:00
inform7/resources/Documentation/Examples/NoRelation.txt
2023-07-24 11:56:58 +01:00

32 lines
2.1 KiB
Plaintext

Example: * No Relation
Location: Going by, going through, going with
RecipeLocation: Bicycles, Cars and Boats
Index: Car which can only be driven on roads
Description: A car which must be turned on before it can be driven, and can only go to roads.
For: Z-Machine
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..."