Skip to main content

Tasks

Tasks are objectives within your quest. Things that the player needs to accomplish in order to complete the current branch.

A branch can contain multiple tasks which all need to be completed before the branch can move to the next state.

Narrative comes with a bunch of pre-defined tasks to help you build your game.

Narrative has two main types of tasks, a blueprint based task that allows you to combine all your task code into a single asset and data assets.

Blueprint tasks

Blueprint tasks are Blueprint based assets that allow you to add all the logic required into a single asset.

It will be one of the most common assets created and reused. Common examples are KillEnemy - where you provide some reference to the enemy and it auto completes when the enemy has died.

Creation

Create a new blueprint task by right-clicking in the Content Drawer -> Narrative -> Task.

You then call AddProgress or CompleteTask when you want to update the task. Upon reaching the required quantity, the task will call EndTask and finish.

Task Properties

Each task has the below default properties. You can easily add extra variables to capture the data you require.

NameTypeDescription
RequiredQuantityint32The number of times the task needs to be completed before the quest updates.
DescriptionOverrideFTextOverride the auto-generated description of the task with a custom one.
bOptionalboolWhether or not this task is optional.
bHiddenboolCheck this box to hide this task in the narrative UI.
TickIntervalfloatDefines how often the task should tick. Set to 0 to disable ticking.
MarkerSettingsFTaskNavigationMarkerShould we add a navigation marker to the world for the duration of this task.
CurrentProgressint32The current progress this task has made.
OwningCompUNarrativeComponentThe narrative component that owns this task.
OwningPawnAPawnThe pawn that owns this task.
OwningControllerAPlayerControllerThe player controller that owns this task.
OwningQuestUQuestThe quest that owns this task.

Data tasks

Data tasks are a sub-set of tasks which allows you to complete a task from an existing blueprint.

Useful for when you are using another plugin or existing logic that you need to complete a task.

note

Data tasks simply complete a pre-defined Task called Complete Narrative Data Task

Creation

Create a new data task by right-clicking in the Content Drawer -> Narrative -> Data Task.

You then call CompleteNarrativeDataTask when you want to update the task.

Using tasks

Tasks once setup are super easy to use.

Simply select or create a branch then populate the tasks array with your task.

quest-tasks.webp