[HOWTO] How To: Step Back in a Quest
Posted: Fri Apr 17, 2020 2:29 pm
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:
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.
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:
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.