Managing Quest States

Quest states change the way a quest is treated. For example, a quest with the state Abandoned cannot be accepted again (unless the state is somehow changed).

Quest States

Name
Description

Locked

The quest cannot be accepted and shouldn't be viewed to the player.

Unlocked

The quest can be accepted and thus, should be viewed to the player.

Accepted

The quest should be on the players active quest list and the player must work towards completing the quest.

RequirementsComplete

All requirements of the quest are completed, but not the quest itself. This is similar to the Accepted state as the quest should still be in the players active quest list (marked as completed). The player must "hand in" the quest to an entity to officially complete the quest.

Completed

The quest is completed; rewards should be granted and it should be removed from the players active quest list.

Abandoned

The player decided to abandon this quest. removing it from their active quest list while still incomplete.

Failed

The player reached a point in the game where the quest can no longer be completed. It is removed from the players active quest list while still incomplete.

Changing States

A new quest is always in the Locked state unless altered manually. Quest states can be changed from the quest itself. Before editing quests, ensure that the quest already exists in the database (usually true unless your creating quests at runtime). If you've set up QT with the default method, quest states will be handled automatically. However, the below information is still good to understand.

It's recommended to use the 'Try' methods to change states, as quests may need to run some checks to see if it makes sense for the quest to change to a new state. These methods return true or false, depending on if the state was successfully changed or not.

Unlocking a Quest

Since quests have a level requirement, you may need to provide the player level.

quest.TryUnlock(myPlayerLevel);

Accepting a Quest

quest.TryAccept(myPlayerLevel);

Completing Quest Requirements

To set a quest to the RequirementComplete state, you can either literally complete all quest requirements or call ForceCompleteRequirements. If a quest has autoCompleteEnabled set to true, the state will be set to Complete rather than RequirementsComplete.

quest.ForceCompleteRequirements();

Completing a Quest

A quest may not be marked as complete if its requirements are incomplete.

quest.TryComplete();

Abandoning a Quest

quest.TryAbandon();

Failing a Quest

quest.TryFail();

Last updated