Mini-Tutorial

TREE HOUSE

Written by Rich Dersheimer


In this mini-tutorial, we'll make a room (The treehouse) that is only accessible when the player has tied a rope to the tree.

First create a room, lets call it "In the backyard" and give it a description, something like "In the middle of the backyard sits a mighty oak tree."

Create a second room, called "In the treehouse" and give it a suitable description. In the directions tab, have "Move down" go to "In the backyard" and click Yes when it asks you if you want to move Up to the treehouse from the backyard. We will modify the direction restrictions later in this tutorial.

Add a static object called "the tree" and have it exist "In the backyard." Give it the attribute "object has a surface (i.e. you can put things on it." Give it a description like "The tree towers over the backyard. Through the leaves you can see a treehouse perched on the massive branches."

Add a dynamic object "a rope" and give it a description like "It is a 12 foot length of sturdy hemp rope, knotted every foot or so." Have its initial position be "In the backyard."

Add a task called "* tie * rope * tree *" with the message "You manage to lodge the end of the rope in the branches. It reaches from about 4 feet off the ground right up to the treehouse." Make it completeable in both "In the backyard" and "In the treehouse." Give it a restriction of "a rope must be held by player." Give it an action of "move a rope onto a tree" and make it repeatable. DON'T make it reversible.

To the "In the backyard" room description (1) box you can add "If task * tie * rope * tree * is complete then show: The knotted rope hangs down from the tree."

This lets you tie the rope to the tree. You should add other verb/noun pairs to the task, like "* put * rope * tree *" or "* throw * rope * tree *" When the rope is tied to the tree, you will see it in the room description.

Add a task "* untie * rope *" and make it completeable in both rooms. Give it a restriction of "a rope must be on object tree" and an action "move a rope to carried by player." Have the task be repeatable. Give it a description something like "You pull the rope off of the branch."

This gets the rope back to the player. Be sure to add the verb/noun pairs "* get * rope *" and "* take * rope *" etc., to cover all the bases.

Now we add two events that let the player tie or untie the rope as many times as he wants to, and the room descriptions will always show if the rope is there.

Call the first event "Reset tie" and have it start after "* untie * rope *" is complete. Make it last 0 to 0 turns, and NOT restart when it is finished. Under the Advanced tab, set "When the event finishes then" to "Undo task * tie * rope * tree *"

Call the second event "Reset untie" and have it start after "* untie * rope *" is complete. Make it last 0 to 0 turns, and NOT restart when it is finished. Under the Advanced tab, set "When the event finishes then" to "Undo task * untie * rope *"

Why do you have to reset both tasks? You have to reset the "tie" task to get the room descriptions right (that's next). And you have to reset the "untie" task because events aren't triggered by a repeating task after it has been done once. You have to reset the task to get the event to trigger again. It sounds confusing, but it works.

To both room descriptions, in the (1) window, set it to - if task "* tie * rope * tree *" is completed then show "The knotted rope hangs down from the tree."

To both rooms again, under the Directions tab, add the restriction only if "* tie * rope * tree *" is completed.

The game will handle "Up" and "Down" commands, but you should add two other tasks for climbing up and down the rope, restricting them to only be completeable when the rope is on the tree.

To sum up: The player can get the rope and tie it to the tree, either from the ground, or while in the treehouse. The room descriptions for both rooms indicate if the rope is tied to the tree. He can't go "up" the tree unless the rope has been tied to the tree.

Thanks to Lendorien for asking how to do this, and to KF for "planting the seed" from which this tutorial grew.