A Handy Kit

An interactive fiction by Andrew Plotkin (2006) - the Inform 7 source text

Home page

Contents
Next

Complete text
Chapter 1 - Setting up

Use full-length room descriptions.

When play begins:
    Say "A relaxing day at home, with nothing to do but play with your toys."

The player carries the toolcase. The player carries a boring pebble.
[An object-fiddling example should always have a neutral object to compare effects to.]

[Changing the standard inventory listing.]
This is the print wide inventory rule:
    say "You are carrying ";
    list the contents of the player, as a sentence, giving inventory information, tersely, including contents;
    say "."

[Sure wish there was a way to do this without a procedural rule. Feature request filed.]
Procedural rule:
    substitute the print wide inventory rule for the print standard inventory rule.

[In a few (rare) cases, I want to handle "read" differently from "examining".]
Reading is an action applying to one visible thing, requiring light.
Understand the command "read" as something new. Understand "read [something]" as reading.
Carry out reading something: try examining the noun.

[I need to break up the standard "set [x] to [topic]" grammar into "set [x]" and "set [x] to [number]". Both of these need to be new actions.]
Setting vaguely is an action applying to one thing.
Dialing it to is an action applying to one thing and one number.
Understand the command "set" as something new. Understand "set [something]" as setting vaguely. Understand "set [something] to [number]" as dialing it to.
Understand the command "adjust" as something new. Understand "adjust [something]" as setting vaguely. Understand "adjust [something] to [number]" as dialing it to.
Understand "turn [something] to [number]" as dialing it to.
Understand "rotate [something] to [number]" as dialing it to.
Check setting vaguely: instead say "You can't set that."
Check dialing it to: instead say "You can't set that."

[For fun, I decided to come up with a "one shot" facility -- a way to easily display a message the first time you come across something (but never again). This could be extended to handle "fire on Nth try", etc.]
A oneshot is a kind of thing. A oneshot can be fired.
To decide whether first trying (item - oneshot):
    if item is fired, decide no;
    now item is fired;
    decide yes.