Specific tasks

From ADRIFT 5 Manual Wiki
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

Say you want to create a task "drop the vase", and instead of the default action of moving the vase from being held by the player to being in the same location as the player, you wanted something specific to happen such as the vase breaking.

The ‘drop’ command defined in the "drop objects" general task in the standard library will display a message like "Ok, you put down the vase." and move the vase from the inventory to the players current location.

We need to create a Specific Task to change that behavior.

Specific Tasks allow you to override the default behaviour of any General Task. You should find that most tasks you create using ADRIFT are Specific Tasks. That's because most things that happen throughout the game are special cases of default responses.

To create a new task, click on the Task button at the top of the screen, or right-click in a folder and select Add New > Task. This brings up the New Task form. This defaults to Specific tasks because that is the most common task type.

In the following screenshot we can see an example of overriding the drop command.

DropTape.jpg

To override a General command, select it from the dropdown list. This will change the displayed command on the line underneath the dropdown. This is a 'sample' command that could be typed. In fact, as we discuss on the General tasks page, the "drop" task has been defined with several different ways of saying the same thing.

  • Ensure that every general and specific task has a unique Task Name, otherwise the drop-down list will show two identical entries and you wont be able to tell which one is the one that you want.

Any references defined in the General Task are displayed in the command bar with a hyperlink. By clicking on the hyperlink, you can pick the specific object you want to create the special case for. In the case above, I didn't want the tape to just move back to the room, and instead it burns up and disappears. In the actions for this task I move the tape to 'Hidden'.

Because Specific Tasks only override General tasks that run, you don't need to repeat the restrictions of the General task. I.e. because the General drop task already checks that the player is holding the object to begin with, you don't need to add that check to the specific task. You would add additional restrictions if you only wanted the Specific task to run under special circumstances.

You can also make a specific task which is specific to a particular room or circumstances, but which is not specific to a particular object. Just leave the command bar hyperlink set to object, character or direction instead of changing it to a specific object, then use the Restrictions of the specific task to determine when it should override the general task.

Overriding

There are three different ways that a Specific task can override a General task. These are

  • Run before – This means the Specific task will run before the general task (but after its restrictions are checked). If you select this option you can select whether the parent/general task message is displayed, and also whether the parent/general actions are run.
The parent of the task is the one we are overriding or running before/after. In the example above it is the "Drop objects" general task in the standard library.
If "Run before" is selected then we have a choice, we can select either or both of the check boxes.
  1. The restrictions of "Drop Objects" are checked, if they pass then:
  2. Check the restrictions of the "Drop tape" specific task, if they pass then:
  3. Display the message of the "Drop tape" specific task, and execute its actions (in the order specified on its advanced tab)
  4. IF "Display parent message" is selected then display the message of the "Drop object" general task e.g. "You drop the tape.".
  5. IF "Execute parent actions" is selected then execute the actions of the "Drop object" general task (the tape will move from the player’s hands to the room the player is in).
  • Swap the order of 4 & 5 if "Display completion message AFTER executing actions" is specified on the "Drop object" advanced tab.
  • If "Drop tape" fails restrictions then "Drop object" displays its message and performs its actions normally.
  • Override – This means the Specific task completely overrides the General task. Neither the General message will be displayed, nor the actions run, although its restrictions must still pass.
Neither check box can be selected so we get:
  1. The restrictions of "Drop Objects" are checked, if they pass then:
  2. Check the restrictions of the "Drop tape" specific task, if they pass then:
  3. Display the message of the "Drop tape" task, and execute its actions (in the order specified on its advanced tab)
  • Run after – This means the Specific task will run after the General task completes. The General message will be output and actions run, then the Specific actions will be run and message output (if either are defined).
In this case both check boxes are selected and can't be changed.
  1. The restrictions of "Drop Objects" are checked, if they pass then:
  2. Display the message of the "Drop Objects" task, and execute its actions (in the order specified on its advanced tab)
  3. Check the restrictions of the "Drop tape" specific task, if they pass then:
  4. Display the message of the "Drop tape" task, and execute its actions (in the order specified on its advanced tab)

Note that the restrictions on the general task must all pass before any of the specific tasks can override it.

If a general task in the standard library contains a restriction that prevents your specific task from running when it should, then you will need to create a new general task that overrides it.

The commands for this task must be identical to the original. You can make an exact copy of it by right clicking and selecting "copy", then right click on the folder you want it in and select "paste". Open the new task and rename it to something appropriate, then go to the advanced tab and ensure it has a higher priority (lower number) than the original. Remove the unwanted restriction and add new restrictions so that this task only overrides the original when it should.

Best Practice

So do you really need to create a General Task plus a Specific Task every time you want to do something new with a specific object? Well, yes. The reason for doing this is so if a verb is understood in one part of the adventure, it will be understood throughout.

Consider a trampoline. You might think to add a general task "jump on {the} trampoline". Then when the player types "jump on trampoline" your task runs. But what if they came across a box in the game. They might try "jump on box". And because the jump verb worked earlier, they would expect it to work here. But because you only created the general verb for the trampoline, Runner would respond with a "do not understand" message.

So the verb should be set up with a general task "jump on %object%". You can then create a Specfic task for the trampoline. The general task (if not overridden by a specific task) could then give a default response for jumping on objects you don't want jumped on, for example "Jumping on %object%.Name isn't a very good idea."

Parent/Child buttons

To the right hand side of the task name are two buttons. These are the Parent and Child buttons. Every Specific task is the child of either a General task, or another Specific task. Clicking on the first button (Edit Parent task) will open up the task the current task is overriding.

Clicking on the second button (Edit Child task) will display a list of all tasks that override the current General (or Specific) task. Selecting one of these will open up the child task.

If the buttons are greyed out, this means the task does not override or is not overridden by another task.


<<< TasksMain_PageGeneral tasks >>>