System tasks

From ADRIFT 5 Manual Wiki
Revision as of 03:24, 30 January 2014 by Saabie (Talk | contribs) (Created page with "== System Tasks == System Tasks are just the same as any other tasks except they are not triggered directly by what the player types at the command line. In most cases, they are...")

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

System Tasks

System Tasks are just the same as any other tasks except they are not triggered directly by what the player types at the command line. In most cases, they are just called by other task actions, or by events. However, there are other ways of triggering them also. The options for triggering a System task are:

  • Only if called by event/task - This task will never run unless explicitly called.
  • Immediately - This task will run at the start of the game.
  • Player enters location - This task will run when the player enters a particular location.

The first option here is the default. Basically this means that the task is never triggered automatically. If you select one of the other options, you can still call the task from an event or other task.

The second option is useful for initialising things at the start of the game. For example, you may want to set variables to random values, place characters randomly within a location group, or ask the player to enter their name, gender and age.

The third option is useful, because it triggers whenever the player enters a particular location. You could override the 'Player Movement' task, but if the location had several entrances then you would need to override each entrance. This task ignores which entrance you came in, and will trigger as soon as you arrive at the specified location.

System tasks dont use references. If you want to call a task and pass references to it as parameters, then create a general task but use "#" as the first character of the command. Then just list the references it needs to use for its restrictions or actions.

Restrictions and Actions

The restrictions page of a task contains a Restrictions list which determines whether a task will be executed. When the command template on a general task matches the user input, or an attempt is made to execute a system task, Adrift checks these restrictions before deciding to execute the task. If the boolean relation of the Restrictions in this list evaluates to true, then the task executes:

  • The "Message to display on completion" is shown.
  • The Actions listed on the Actions page are executed.

If the boolean relation evaluates to false then the first restriction test that failed will display its failure message to the player.

Hints

Hints are not yet functional in ADRIFT 5.

Advanced

On the Advanced tab are a series of settings that allow you to tweek how the task behaves and how it interacts with other tasks that also match the player input.

AdvancedMode.jpg The ADRIFT developer must be in Advanced mode for this tab-page to be available.

TaskAdvanced.jpg

The task priority determines which task Adrift should execute if more than one matches the players' input. The one with the lowest number in this field has the highest priority and will be executed first. The tasks in the Standard Library always have very large priority numbers, while the tasks that you create will initially be numbered in order of creation starting at 1. This means that any task you create will execute before any Standard Library task by default. You will only need to alter this field if you have two tasks which are both able to match the same player input and pass their restrictions at the same time, and you wish to change the order in which they are executed.

The "Auto-fill priority" is only available on General Tasks and is responsible for the auto-completion feature whereby the player only has to type part of a command or object name and the rest of the word will be filled in automatically. Normally a player will expect common commands such as "north" or "examine" to be chosen by this feature, but if you create a new command such as "exit" or "nobble" then you may need to change the value in this field to stop them being selected.

ImgTip.png Setting the auto-fill priority to zero will prevent this general task's commands from ever being displayed by the auto-fill.

If "Prevent this task from being inherited" is selected on a General task then it will not be possible to override it with a specific task. You are unlikely to need to select this. One example where it is used is in the Take Objects (Parent Task) library task, because we want to override the Take Objects from Object or the Take Objects from Location tasks individually.

If you edit a library task, the "On load, if another task exists with the same key, this should replace it" checkbox becomes available. If you have multiple libraries, and those libraries contain the same key (for example, both libraries have a task with the key Inventory), the second library will import and the key will be renamed (e.g. to Inventory1). What this checkbox does is allows you to specify that the task should override any existing tasks with the same key. This is useful if you want to customise an existing library task.

The default behaviour is for tasks that pass restrictions to override higher priority tasks that do not, even when the failing higher priority task has output. To change this behaviour, you need to check the "This task can be overridden by other task restriction failures (apart from other tasks with this checked)" checkbox on the lower priority task.

Whenever ADRIFT finds a task that matches user input and passes it's restrictions, it will run that task. If that task has output text, that text will be displayed and no more tasks will be checked. In some instances, you might want to continue to match lower priority tasks after the initial task has run. To do this, you would select the "Continue executing matching lower priority tasks (multiple matching)" checkbox.

The drop-down list "Display completion message before/after executing actions" controls the order in which the task executes.

  • Before: The contents of the tasks' text box is displayed first, then the Actions of the Actions tab are executed.
  • After: The actions are executed first and then the text is displayed.

This is only important if:

  • An action alters a variable which is then displayed as part of the text output.
  • An action alters something which is used to determine if a restriction passes on an alternate description in the text box.

Finally, the text box at the bottom allows a special message to be displayed, instead of the usual restriction failure message, if the player entered "All" instead of a specific object in the command.


<<< General tasksMain_PageCharacters >>>