How tasks work

From ADRIFT 5 Manual Wiki
Revision as of 01:30, 1 February 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

This is a step-by-step description of how ADRIFT processes a players command and chooses which tasks to run.

It is not meant to be read through start to finish, it is provided as a reference for more advanced ADRIFT uses to help design more complex multiple-task commands and debug problems.

  1. The first thing the parser does is replace the words "it", "them", "him" and "her" with the appropriate object or character that the player most recently refered to.
  2. The parser now checks each general task, starting from the one with the lowest number in the "Task Priority:" field on its "Advanced" page and proceeding in order until it finds a match between the player's input and one of the command lines of a task, using "Advanced Command Construction" matching.
  3. When it finds a matching general task, it now tries to match the references. Eg.If the command contains an %object% reference then ADRIFT searches through all of the objects in the game trying to find one which matches what the player typed in that part of the input. Note that the player may have entered the names of several objects, eg. "the watch and the pendant" or "all except the hat" or "pens" (which can mean all objects with "pen" as the noun if no objects are called "pens"). All of these must match objects in the game.
  4. The player may have typed an ambiguous name that matches several items in the game, for example "pen" could match "red pen", "blue pen" or "green pen" if these all exist. To decide which one the player meant, ADRIFT contains a "scope" system to help choose between them.
    1. The first thing scope does is to check the items against the restrictions of the general task, if only one of them passes then it is assumed to be the one the player meant.
    2. If more than one passes restrictions then scope checks to see if one of those is currently visible to the player and chooses it.
    3. If none of them are currently visible, then scope checks to see if one of the items has ever been seen by the player.
    4. If more than one item passes these scope checks, then the player is asked a disambiguation question such as "Do you mean the red pen, the blue pen or the green pen?" to determine which item they meant.
  5. ADRIFT has now matched all of the objects, characters and/or locations that the player mentioned to the references in the command, so it can start to execute the ask. If there are multiple items for a reference then ADRIFT executes the task once for each item.
  6. The restrictions of the general task are now checked. If a restriction fails and it contains text then that text is displayed to the player as a failure message and the player is prompted to enter their next command.
  7. If a restriction fails but that restriction has a completely blank text box, then ADRIFT skips that general task and resumes searching through the lower priority general tasks for the next match.



<<< Executing sub-tasksMain_PageCharacters >>>