Building a Fetch Quest with Story Framework

- by

Fetch quests are missions in which the player needs to go off and collect something, often in multiple quantities. For this example we’ll collect three bones for an NPC. I’ll create a new interactable blueprint for this, making it a child of Story Framework’s Interactable Base BP. I’ll add three copies of this class into my level, representing the three items the player has to collect.

After the correct dialogue choice, we’ll add a task to the queue to keep the player on track. This is on my custom NPC class.

Next we’ll build out the custom code on our intractable class. We’ll put it on Event Destroyed, which is called right after pickup. Let’s take a look at the first sequence pin.

First we’ll check if the item is already in our inventory and check how many copies there are, using Find Item in Inventory by Name. We can use the current quantity from the inventory to update the task header so that the player knows how many are left to collect.

For the second sequence pin we’re assuming all items have been found, so we’ll update our task one last time so the player knows what to do next. In my case it’s “return to the NPC that gave you the quest”. We’ll also add a consequential tag so that a new dialogue can be kicked off on the NPC.

On our NPC we’ll remove the consequential tag as part of the dialogue options and complete the current main quest.

What if the player has all items when the quest begins?

There’s an edge case we need to be prepared for: just in case the player has already collected everything necessary to complete the quest. The above is a little ugly in that we need to pick up at least one item to perform the check, but that item may no longer existing in the game world, potentially leading to a soft lock.

Thankfully that’s not a problem, since the “found all” consequential tag is issued when all items have been collected, which means the next dialogue option will be unlocked by the time the player talks to the NPC.



If you enjoy my content, please consider supporting me on Ko-fi. In return you can browse this whole site without any pesky ads! More details here.

Leave a Comment