| Chapter 7: Basic Actions |

| 7.14. Going by, going through, going with

Adding to the previous example game, we apply rules which depend on travelling by a particular vehicle:

> The book trolley is in the Musicology Section. "The book trolley, a sort of motorised tractor for trundling around through the stacks, is parked here." The trolley is a vehicle. Instead of going nowhere by the trolley, say "Don't go crashing the trolley into walls."

> Instead of going to the Front Stacks by the trolley, say "The Front Stacks are far too confined for the trolley to manoeuvre into them."

And, lastly, rules which apply to movements through particular doors:

> The green baize door is east of the Catalogue Room and west of the Clerk's Office. The green baize door is an open door.

> Before going through the green baize door, say "Through you go..." After going through the green baize door: try looking; say "...and here you are."

(Note that these apply whether the action is "going east" or "entering the green baize door", each having the same effect.) The last rule is worth a second look: the normal way that a "going" action is reported is to produce the room description of the new location. So if an "after" rule stops the action before we get to reporting, we have to produce any room description by hand (hence the "try looking" to cause the looking action). Alternatively, we could simply say something and let the normal course of events take place:

> After going through the green baize door: say "...and here you are:"; continue the action.

Finally, going is an action which can also happen while the player is pushing something from one room to another, and we can describe this like so:

> Instead of going from the Office with the trolley, say "But it looks perfectly placed here. Why push any further?"

88
| Example Mattress King Adding extra phrasing to the action to PUSH something in a direction.

By default, when the player pushes something a direction, Inform checks to make sure that the object is pushable between rooms. If not, it blocks the action; if so, it carries out a normal going action with the pushed object taken along. Also by default, this action produces only a description of the new room that we've traveled into. But suppose we would like to print a short message describing the pushing action first: "Mattress King" Monica's Bedroom is a room. The Living Room is south of Monica's Bedroom. Rachel's Bedroom is south of the Living Room. After going a direction (called way-pushed) with something (called the thing-pushed): say "You push [the thing-pushed] [way-pushed] to [the location]."; continue the action. The race car bed is an enterable supporter in Monica's Bedroom. It is pushable between rooms. Test me with "push bed south".

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

90
| Example One Short Plank A plank bridge which breaks if the player is carrying something when he goes across it. Pushing anything over the bridge is forbidden outright.

Previous | Contents | Next