Adding a new command

From ADRIFT 5 Manual Wiki
Revision as of 06:58, 26 August 2012 by Saabie (Talk | contribs) (typo)

Jump to: navigation, search

If the ARIFT standard library already contains the command (verb) that you want to use, then it is a simple matter to create a specific task to change the default behaviour for a specific object or if specific restrictions pass.

But what if we want to add a new command that is not in the standard library?

In this tutorial i will be creating a new "Rub Lamp" command that will summon a magic genie.

The General Task

There is no "Rub" command in the standard library, so the first thing we need to do is create a new general task to define it.

But if we just do a "Rub lamp" command, then the player will probably try to rub other objects and that will produce the message "Sorry, i didn't understand that command" which does not look very professional.

What we need to do is create a "Rub %object%" command that will respond when the player tries to rub anything.

General task's also need to respond appropriately if the player tries to do something to an object that does not exist or is not currently at the same location as the player.

This can involve writing several restrictions, however if the standard library contains a command that operates in a similar way to the one you want to create then you can right-click on it's task and select copy, then go to your own folder and right-click to paste in a copy of the task which you can then edit.

Here are the restrictions copied from the "Pull object" task:

TaskRestrictionsPull.jpg

You will still need to check the text of each restriction, in this case we need to change the word "pull" to "rub" in the first two restrictions.

Note that we could also add a restriction that the object must be being held by the player, but i am going to allow them to rub it without having to pick it up first.

On the description page we change the name of the task, put in the appropriate command, and write the message to display on completion.

TaskGeneralRub.jpg

As the player might type "polish" instead of rub, and polishing the lamp should work the same way as rubbing it, we add this as an alternative command. It is a good idea to have a thesaurus on hand so you can check for any similar verbs that you may want to add to your new task.

In the message box we write the default message that we want to be displayed if the player tries to rub something that they have no reason to be trying to rub.

The %CharacterName% function displays I, you or the players characters name depending on the player perspective set in the options dialog.

Likewise [1] displays one of three alternatives depending on the player perspective.

The %TheObject[%object%]% function displays the full name of the object that the player is trying to rub.

Dont forget to ensure that the "Task is repeatable" checkbox is selected.

A bit more specific

TaskSpecificGroup.jpg

A specific object

TaskSpecificObject.jpg