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?"

"Going" is not the only action which moves the player. Another is "exiting", an action which moves the player out of whatever he/she is currently in or on. This action is often caused by the player typing just OUT or GET DOWN, and there's no noun as such. But Inform allows the syntax "exiting from" to make it easier to write rules about the exiting of particular containers or supporters:

After exiting from the Mini Cooper:
    say "You painstakingly unpack your limbs from the tiny car."


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

RB
105
* Example  Mattress King
Adding extra phrasing to the action to PUSH something in a direction.

RB
106
** 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.

RB
107
*** Example  Zorb
Replacing the message the player receives when attempting to push something that isn't pushable, and also to remove the restriction that objects cannot be pushed up or down.

RB

There are two aspects of Inform's handling of pushable objects that are particularly prime for modification. One is that we may want to change the language used to refuse the pushing of unpushable objects.

Second, Inform by default assumes that it is impossible to push objects in up or down directions. This makes lots of sense if the player is trying to push a wheelbarrow up a ladder; it makes less sense if instead we're pushing a ball up a slope.

We solve both problems with some syntax borrowed from the chapter on rulebooks: in the first case, we replace the old rule with a new one with more friendly phrasing; in the second, we remove the rule entirely. More about how to do this is described in the rulebooks chapter; and in general we can find out what rules contribute to any given action by looking at the Actions index. In this case, the action is "pushing it to", which has its own set of prerequisites (called check rules) that make sure the object can safely be pushed, before turning processing over to the going action.

"Zorb"

Section 1 - Procedure

The new can't push unpushable things rule is listed instead of the can't push unpushable things rule in the check pushing it to rules.

Include Plurality by Emily Short. [This allows us to use the "is-are" replacement in the following rule.]

This is the new can't push unpushable things rule:
    if the noun is not pushable between rooms:
        say "[The noun] [is-are] not amenable to being pushed from place to place." instead.

The can't push vertically rule is not listed in any rulebook.

And now to provide a scenario where the player can push something up and down a hillside. Most of the rest of the example is there for local color and to provide a way to demonstrate these rule adjustments:

Section 2 - Scenario

The Steep Hill is a room. The Crest is above Steep Hill. The Valley is below Steep Hill.

The flat rock is a fixed in place thing in the Steep Hill.

The Zorb is a transparent open enterable container in the Steep Hill. "[if the player props the Zorb]The Zorb rests here, kept from further rolling by your support[otherwise]The Zorb is here[end if].". It is pushable between rooms. The description of the Zorb is "A giant plastic inflatable ball, like a hamster ball for humans[if someone is in the Zorb]. Inside [is-are list of people in the Zorb][end if]."

Lucy is a woman in the Zorb.

Carry out going with the Zorb when the Zorb contains Lucy:
    say "Lucy whoops delightedly as she rides along in the Zorb."

Every turn when the Zorb is not in the Valley and the player does not prop the Zorb:
    let next room be the room down from the location of the Zorb;
    if the player is not in the Zorb and the player can see the Zorb:
        say "The Zorb succumbs to gravity and rolls down toward [the next room].";
    move the Zorb to the next room;
    if the player is in the Zorb:
        say "The Zorb rolls you down the hill!";
        try looking;
    otherwise if the player can see the Zorb:
        say "The Zorb rolls ponderously but inevitably into the vicinity.";

Propping relates one person to one thing. The verb to prop (it props, they prop, it propped, it is propped, it is propping) implies the propping relation.

Carry out going with the Zorb:
    now the player props the Zorb.

Before doing something when the action requires a touchable noun:
    if the noun is not the Zorb, now the player does not prop the Zorb.

Check waving hands when the player is propping something (called casualty):
    try the player releasing the casualty.

Carry out entering the Zorb:
    now the player does not prop the Zorb.

Understand "let go of [something]" or "let [something] go" or "release [something]" or "free [something]" as releasing. Releasing is an action applying to one thing.

Check releasing:
    if the player carries the noun:
        try dropping the noun instead.

Check releasing:
    if the player does not prop the noun:
        say "You are not supporting [the noun]." instead.

Carry out releasing:
    now the player does not prop the noun.

Report releasing:
    say "You let go of [the noun]."

Test me with "d / push zorb up / look / push zorb up / wave / d / d / push zorb up / release zorb / d / push zorb up / touch rock / push the flat rock south".

108
*** Example  Provenance Unknown
Allowing something like PUSH TELEVISION EAST to push the cart on which the television rests.

RB


PreviousContentsNext