[HOWTO] How To: Step Back in a Quest

Announcements, support questions, and discussion for Quest Machine.
Post Reply
User avatar
Tony Li
Posts: 22104
Joined: Thu Jul 18, 2013 1:27 pm

[HOWTO] How To: Step Back in a Quest

Post by Tony Li »

In item collection quests, once the player has collected the required number of items, you'll usually want to check if the player then loses or drops items before turning in the quest. If so, revert the quest back to the previous node until the player reacquires enough items.

To do this, add a node that checks if the player no longer has enough items. If this node's conditions becomes true (i.e., not enough items), revert the state of the quest.

Here's an example from the Inventory Pro integration:

backtrackQuest.png
backtrackQuest.png (54.53 KiB) Viewed 1327 times

This was auto-generated by Quest Machine's procedural quest generator, but you can do the same thing with hand-written quests. When the "Fetch 5 Apples" node becomes successful, it activates two nodes: "Talk to Villager" and "Revert Fetch 5".

The "Revert Fetch 5" node checks if the player has less than 5 apples. If so, it sets the nodes back to a state where the "Fetch 5 Apples" node is active again. Since it was auto-generated, the node IDs shown in the Actions section aren't as human-readable as they could be if you made the quest by hand. but it should convey the idea. The node whose ID is "1" is the "Fetch 5 Apples" node, BTW.
Post Reply