§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 story: 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 by turning off the "carrying requirements rule" under particular circumstances, or presented differently using the implicitly taking activity.


arrow-up.pngStart of Chapter 6: Commands
arrow-left.pngBack to §6.7. Inventory
arrow-right.pngOnward to §6.9. Going, Pushing Things in Directions

*ExampleReplanting
Changing the response when the player tries to take something that is scenery.

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

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

*ExampleCeladon
Using the enclosure relation to let the player drop things which he only indirectly carries.

"Stop" and "Continue" are most useful when we need to write rules that will have to stop the action some of the time but at other times let it pass; so for instance:

paste.png "Democratic Process"

Before inserting something which is not carried by the player into something:
    if the noun is in the second noun, say "Already done." instead;
    say "(first taking [the noun])[line break]";
    silently try taking the noun;
    if the player is not holding the noun, stop the action.

Before putting something which is not carried by the player on something:
    if the noun is on the second noun, say "Already done." instead;
    say "(first taking [the noun])[line break]";
    silently try taking the noun;
    if the player is not holding the noun, stop the action.

The Assembly Room is a room. "On most days, this room is used for elementary school assemblies; at the moment, it serves as a voting place." The ballot is on the desk. The desk is in the Assembly Room.

The machine is a container in the Assembly Room. "On the ballot machine is a sign which reads 'PUT BALLOTS IN ME :)'." Understand "ballot machine" as the machine.

Test me with "put ballot in machine".

***ExampleDemocratic Process
Make PUT and INSERT commands automatically take objects if the player is not holding them.

"Stop" and "Continue" are most useful when we need to write rules that will have to stop the action some of the time but at other times let it pass; so for instance:

paste.png "Democratic Process"

Before inserting something which is not carried by the player into something:
    if the noun is in the second noun, say "Already done." instead;
    say "(first taking [the noun])[line break]";
    silently try taking the noun;
    if the player is not holding the noun, stop the action.

Before putting something which is not carried by the player on something:
    if the noun is on the second noun, say "Already done." instead;
    say "(first taking [the noun])[line break]";
    silently try taking the noun;
    if the player is not holding the noun, stop the action.

The Assembly Room is a room. "On most days, this room is used for elementary school assemblies; at the moment, it serves as a voting place." The ballot is on the desk. The desk is in the Assembly Room.

The machine is a container in the Assembly Room. "On the ballot machine is a sign which reads 'PUT BALLOTS IN ME :)'." Understand "ballot machine" as the machine.

Test me with "put ballot in machine".

***ExampleCroft
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.

***ExampleLollipop Guild
Overriding the rules to allow the player to show something to another character without first taking it.

****ExampleSand
Extend PUT and INSERT handling to cases where multiple objects are intended at once.