Tasks

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

Jump to: navigation, search
THE MAIN ITEMS
Locations
Objects
Tasks
--- Specific
--- General
--- System
--- Executing sub-tasks
--- How tasks work
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).

The ADRIFT command parser decides which task to run by matching what the player types with the commands defined in general tasks, and with the names of the objects, characters and locations in the game.

A task is like an IF statement in a programming language, when it is executed it first checks its restrictions to see if they pass. Each restriction contains text that is displayed to the player if it is the first one to fails.

If the restrictions pass then the task does two things, it displays the text in its main text box, and it performs the actions on its actions page.

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. This is the most common type of task that you will use.
General tasks Use these to define new 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

How ADRIFT decides which tasks to execute

Whenever the player types a command into Runner, ADRIFT searches through all of the General tasks in the Standard library as well as those that you have created yourself, trying to find any that match.

It does this is by pattern matching the command against each of the command definition lines in each general task.

In most cases there will only be one general task that matches what the player typed, but if more than one matches it will try the one with the highest Task priority.

All of the restrictions of the general task must pass, otherwise one of two things will happen. If the first restriction that failed contained text, then that message is displayed and the player is prompted for their next command. If however it was blank, then ADRIFT will try the next matching general task in priority order.

ADRIFT now checks the Specific tasks that override that general task, and if it finds one that passes its own restrictions and matches the items that the player refered to, then that specific task is executed (its Actions are performed and the contents of its text box is displayed)

If none of the specific tasks override the general task, then it acts as a default, its actions are performed and its text box contents is displayed.


<<< ObjectsMain_PageSpecific tasks >>>