Chapter 6: Commands
6.8. Taking, Dropping, Inserting and Putting

We may want to change the default refusal message when the player tries to pick up scenery: Replanting demonstrates this case simply.

Removal modifies responses to successful TAKE commands, with the effect that when the player picks up an item, he gets a response such as "You take the book from the shelf."

Croft modifies the DROP command, so that objects dropped on specific surfaces get reported in a special way. Celadon allows the player to drop even objects he is carrying indirectly, for instance on a tray or in a sack.

Morning After introduces a simple rule that changes the behavior of the whole game: whenever the player takes an item he hasn't already looked at, he automatically examines it. This picks up the pace of exploration passages where the player is likely to be collecting a large number of objects.

By default, when the player tries to put or insert an item that he isn't holding, Inform prints a refusal message; Democratic Process and Sand offer ways instead to have the player first pick up the relevant items. (The former applies to single items the player is trying to place; the latter expands coverage to work even if the player uses a command affecting multiple objects.)

Taking also happens as a result of other commands. Such takes can be made unnecessary with a procedural rule to turn off the "carrying requirements rule" under particular circumstances, or presented differently using the implicitly taking activity.

* See Modifying Existing Commands for procedural rules to adjust carrying requirements


15
* Example  Replanting
Changing the response when the player tries to take something that is scenery.

WI
200
* Example  Removal
TAKE expanded to give responses such as "You take the book from the shelf." or "You pick up the toy from the ground."

WI

Suppose that we want to change the reporting of "take" so that the player is always told something like "You take the book from the shelf." or "You pick up the toy from the ground." In order to generate these reports, we will need to know where the object started, even though by the time we are printing the output, the object will have moved.

"Removal"

The Pharmacy is a room. A desk and a trash can are in the Pharmacy. The pill-counter, a prescription, and a computer are on the desk. The computer is fixed in place. The pill-counter contains some Vicodin. The trash can contains an empty box.

The taking action has an object called previous locale (matched as "from").

The previous locale could in theory be either a thing or a room, so we make it "an object" -- that is, the most generic possible kind, to which both things and rooms belong. Now we record what the previous locale is at the beginning of each taking action:

Setting action variables for taking:
    now previous locale is the holder of the noun.

Report taking something from the location:
    say "You pick up [the noun] from the ground." instead.

Report taking something:
    say "You take [the noun] from [the previous locale]." instead.

Test me with "get all".

202
*** Example  Croft
Adding special reporting and handling for objects dropped when the player is on a supporter, and special entering rules for moving from one supporter to another.

WI
225
* Example  Celadon
Using the enclosure relation to let the player drop things which he only indirectly carries.

WI
90
* Example  Morning After
When the player picks something up which he hasn't already examined, the object is described.

WI
86
*** Example  Democratic Process
Make PUT and INSERT commands automatically take objects if the player is not holding them.

WI
87
**** Example  Sand
Extend PUT and INSERT handling to cases where multiple objects are intended at once.

WI


PreviousContentsNext