Climbing a Tree

From ADRIFT 5 Manual Wiki
Revision as of 07:01, 27 February 2012 by Saabie (Talk | contribs)

Jump to: navigation, search

Construction.gif


In this tutorial you will create a tree that the player can climb up into.

We will be demonstrating how to add new commands (verbs) to ADRIFT using a general task, how to change the way the standard commands work at a specific location, and how to call an existing task from your own to execute its actions and give its output.

Climbing up & down

First create a "Front Yard" location in which you describe a large climbable tree.

To create the actual tree, press the add object button: IconStaticObject.jpg next to the location name, and create a simple static object.

In its description text box add a more detailed description of the tree than you had in the front yard description. You could describe what type of tree it is, how tall it is, and what the player would see looking up into it.

Close both of these items with their OK buttons and create a new location called "Top of tree".

We should get a good view from up here, so in its text box we could describe what all of the surrounding area would look like from above, and say how far into the distance they can see.

On the directions tab select "Front Yard" as the destination for the "Down" direction, then click OK to close the location.

ADRIFT will ask you if you want to create the reverse link "Up" from the front yard to the top of tree (unless you have turned off this feature). Choose YES.

TaskClimbTree.jpg

Add a restriction so that our modified climb task is specific to the player being at the "Front Yard" location.

RestrictionFrontYard.jpg

We will be using this same restriction, or one for the "Top of tree" location, in most of the specific tasks for the tree.

We want the player to be at the "Top of the tree" location after climbing it, so add an action to move them there:

ActionMoveToTopOfTree.jpg

If the player types "up" or "climb up" instead of "climb tree", then they will just get the default "You move up" message.

To change this you can override the "Player Movement" task with a specific task for the "up" direction, and with a restriction for the "Front Yard" location.

The UP and CLIMB TREE commands are separate commands that in this case we want to give the same output and do exactly the same actions. Instead of re-entering the description and any restrictions and actions, we can just call the existing task like this:

ExecuteClimbObject.jpg

Dropping Objects to the Ground

If we drop an object while we are at the top of the tree then it should fall to the ground below. To do this we need a specific task that overrides the default "Drop Objects" and describes the object falling.

TaskDropFromTree.jpg

Make it specific to this location by adding a restriction that the "Player Character" must be at the "Top of the tree".

The dropped object needs to end up in the front yard below the tree, so add an action to move it there:

ActionMoveObjectsToFrontYard.jpg

Jumping out of the Tree

The standard library (v5.00.21) does not have a "Jump" command, so we need to create a general task to add it.

A general task describes what the command generally does. Most of the time jumping wont do much so we do:

TaskJump.jpg

But if they jump while at the top of a tree then they are going to end up at the bottom of it, so create a specific task for "Jump" with a restriction that the player must be at the top of the tree.

If its a particularly tall tree and there is nothing soft to land on then they may be seriously injured, so we would describe a bad fall in the task and then call the "End game in defeat" action.

TaskJumpFromTree.jpg

Requiring an Object to Reach the Lowest Branch