Specific Tasks

ADRIFT 5 Help ›› Creating Games ›› The Main Items ›› Tasks ››
Parent Previous Next

Specific Tasks

Specific tasks are "Override Command" tasks.  They allow you to override the default behaviour of existing tasks in ADRIFT.


So 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 general ‘drop’ command we defined above will run the same on any object we refer to in the game unless restrictions are put on the task. A simple way of creating this special case is to create a Specific Task.


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.


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



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 have discussed earlier, the drop task has been defined with several different ways of saying the same thing.


Try to ensure that every General and Specific task has a unique Task Name, otherwise the drop-down list may show identical entries for distinct tasks and you will have difficulty working out which one is which.


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



In the example above, the specific case for dropping the tape runs after General drop command. So when the player types "drop tape", the default message for dropping the tape will be displayed, e.g. "You drop the tape." and the tape will move from the player's hands to the room the player is in. Then the above message will be output and the tape will disappear.


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.