-
Notifications
You must be signed in to change notification settings - Fork 0
Actions
Actions represent a single task that a player must complete in a quest. such as goto a location, kill an enemy, or report to the quest giver. Actions are generic and do not require you to know which location/enemy/person/object/etc. the action is actually being performed on (That is defined during strategy creation, see the "strategies" page). An action is created with an array of condition functions to check to determine if the action is complete. For example, we could define a "kill" action as follows:
questGen.atomicActions.kill = QUESTIFY.createAtomicAction([...]);
The use of the word "atomicAction" is there to differentiate between a feature that is planned for the future.
To check if the action is actually completed, we need to check if a certain character is dead. To make sure the player was actually present for the killing of that character, we will make sure the character is at the enemy's location. We now pass those condition functions in to createAtomicAction():
questGen.atomicActions.kill =
QUESTIFY.createAtomicAction([questGen.conditionFunctions.checkIfCharIsAtLocation,
questGen.conditionFunctions.checkIfCharIsDead]);
For more information on how to define those condition functions, check out the relevant page on the right.
Now every time the quest is updated, if this action had not previously been finished, these two conditions will be called, and if they are BOTH true, the action is completed. It's important to note that an action should only have multiple condition functions if they should all be true at the same time. For things to be handled in sequence, you should define a separate action.
The parameters to these condition functions are not defined at this point. That is handled during the definition of strategies. Check out the relevant page on the right for more information.