Tasks

From ADRIFT 5 Manual Wiki
Revision as of 04:54, 30 January 2014 by Saabie (Talk | contribs)

Jump to: navigation, search
THE MAIN ITEMS
Locations
Objects
Tasks
--- Specific
--- General
--- System
Characters
Events
Variables
Groups
Properties
Text Overrides
Hints
Synonyms
User functions

Everything that happens within an ADRIFT adventure is the result of a task. Tasks do things. All tasks have a set of restrictions (conditions that must be met in order for the task to run) and a set of actions (things that will be carried out if the task runs).

There are three main types of task in ADRIFT 5. These are:

Specific tasks Use these to define what happens when the player uses a command on a specific object, character or location, or in specific circumstances
General tasks Use these to define the commands that the player can enter. You create a new general task if you want to use a command (verb) that is not defined in the standard library
System tasks Controls what happens when the player first starts the game or whenever they enter a particular location

Whenever you type something at the cursor in Runner, that command is "parsed". The way ADRIFT does this is by pattern matching the command against a set of known phrases. The way you define this command is to use a General task.

Specific tasks allow you to run special cases for General tasks, for example, if you wanted something different to happen when you used a particular object in a task.

System tasks are simply ones that are not triggered directly by what the user types on the command line.

Lets look at these in detail.


An Example

In Jacaranda Jim, I needed to create a "chop" verb. So, as with any new verb, this needs to be set up as a General Task. The task is defined with a very simple command:

ChopObjectWithObject.jpg

The default response for chopping an object with another object is simply an error, saying you can’t chop the first object with the second one. Because, for example, if the player tries to chop a door with a torch, I need to tell them that's not a good idea, but they still need to know that chop is a valid action. For an explanation of the functions used in this response, see the Functions section.

I added a few restrictions to the task as follows:

ChopRestrictions.jpg

Most General tasks will have restrictions that any objects referred to must exist, that they have been seen by the player (because if they haven't, they may as well not exist as far as the player is concerned), and that the object doing the chopping (Referenced Object 2) must be held. I also need to ensure that the object the player is trying to chop is visible, otherwise I give an error saying "You can't see that."

There are no actions for the default 'chop' command, because it is generic and I don't want anything to happen when the user tries it on an incorrect object.

Now, if the player tries to chop something with an axe, I don't want a generic "You can't do that" sort of response. So I can create a Specific task for the axe by selecting the axe from the second object hyperlink, like so:

ChopObjectWithAxe.jpg

I can then give a sensible response to this action when the player tries chopping random objects with the axe. This task is a sort of cross between a General task and a Specific one, because one reference has been left general, and one has been specified.

Clearly, many objects could be changed drastically with an action such as this, so the real purpose of this task is to prevent us having to create a response for every single object the player tries to chop. There are no restrictions (because it obviously passed all the General task restrictions) and no actions (because it is again a generic response) on this task.

There will be certain objects that when chopped, you want to give a specific response to, or do actions. In my case, I want something specific to happen when the player tries to chop through a door. So I create a new Specific task which overrides the General/Specific task defined above, like so:

ChopDoorWithAxe.jpg

In the actions for this task, I increase the score. I also have a restriction on the movement from one of the rooms that depends on this task being completed.


<<< ObjectsMain_PageSpecific tasks >>>