# Quest System Overview

{% embed url="<https://www.youtube.com/watch?v=IJfRLWtob1w>" %}

{% hint style="info" %}
Version 1.1 is available. Main feature - Quest Branching. Enjoy!
{% endhint %}

{% hint style="info" %}
Version 1.13 is available. New objectives blocking handling
{% endhint %}

{% content-ref url="quest-system-overview/updates/version-1.1-release-notes" %}
[version-1.1-release-notes](https://dmitriy-vergasov.gitbook.io/ultimate-quest-system/quest-system-overview/updates/version-1.1-release-notes)
{% endcontent-ref %}

{% content-ref url="quest-system-overview/updates/version-1.13-release-notes" %}
[version-1.13-release-notes](https://dmitriy-vergasov.gitbook.io/ultimate-quest-system/quest-system-overview/updates/version-1.13-release-notes)
{% endcontent-ref %}

Ultimate Quest System - Solution that allows to easy implement Quest System to your own project. Plugin has very understandable, flexible and customizeable structure. You can implement it to your project for few minutes.

Main Features:

* Use C++ or Blueprints to work with system
* Flexible structure, easy integrate to any project
* Quest Branching Supports
* Dynamic Objectives and Rewards
* Unlimited quests
* Unlimited objectives for each quest
* Quest Objectives can be completed parallel or in a sequence
* Event based quest objective tracking system. It allow integrate it to any project for few minutes
* Very flexible class structure, easy to customize any quest, objectives or rewards
* Example Project with examples of usage system
* Ready to use Save/Load system to Unreal Saves or Json format
* Add your own data to save for quests.
* Quest Giver implementation in Example Project
* 5 Different types of quests and UI implementation in example project

#### [Marketplace](https://www.unrealengine.com/marketplace/en-US/product/c0856ce0772c418fa68b71afbbe19ba8)

#### [Example Project](https://github.com/DmVergasovSQ/QuestSystemExampleProject)

#### [Playable Demo](https://drive.google.com/drive/folders/1TPM0NpksZBfFxObY0YKH9qrz2nwgkRc3?usp=sharing)

{% hint style="info" %}
Basically, to implement quest system to project you need:
{% endhint %}

## UQSQuestComponent/UQSQuestStorage

Add UQSQuestComponent to entity which will be store and handle quests (e.g. character, game state, etc.).&#x20;

<div align="left"><img src="https://1249461799-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FkjIT8AFqtlVif5xQAvrF%2Fuploads%2FK3cFEahl4g6IweQipLdk%2Fimage.png?alt=media&#x26;token=056b2711-ad28-4e8d-ab4a-4b676ecf954c" alt=""></div>

Quest Component contains QuestStorage object.&#x20;

<div align="left"><img src="https://1249461799-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FkjIT8AFqtlVif5xQAvrF%2Fuploads%2FQehnKWIsLY3kHv7G9LrW%2Fimage.png?alt=media&#x26;token=f58e65d8-e5df-4a8d-a225-ba1f645c838a" alt=""></div>

Quest Storage contains quests, you may have unlimited count of storages if you need it (e.g. for global quests, quests specific on game session etc.)

**Storage Tag** - Need to get access to quest storage from [QuestSubsystem](#questsubsystem)

[**CanBeSaved** ](#save-load)- if this parameter is false - this storage won't save.

[**Load After Registered**](#save-load) - need or not to load this storage after owned actor spawned in world

Each quest storage register to [**Quest Subsytem**](#questsubsystem)

In subsystem you can get any registered quest storage by tag, take quest to storage with tag, add objective counter value. Also it have events on register/unregister of quest storages

Quest Storage have next events and functions:

<div align="left"><img src="https://1249461799-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FkjIT8AFqtlVif5xQAvrF%2Fuploads%2F3qCDkxa7YbG7apnbwAw5%2Fimage.png?alt=media&#x26;token=5cf0b3f4-1cc0-4bb7-8fe1-21fc0f2bd253" alt=""></div>

**Take Quest** - takes quest to selected storage. Return dynamic quest object

**Add Objective Counter Value** - add value to objective with tag. After all objective is done - quest will be marked as ready to finish

**Finish Quest** - allow to finish quest and get reward for it. **IgnoreReadyToFinishState** - allow to ignore unfinished objectives and finish quest forced. You can finish quest by DataAsset of quest or by DynamicQuest Object

Also it have getters for all, active or finished quests.

Also it has events for quests after it finished, ready to finish states changed or when new quest has taken.

## UQSQuestDataAsset/Dynamic UQSQuest Object

To create new quest - just create new data asset based on **UQSQuestDataAsset** class.

![](https://1249461799-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FkjIT8AFqtlVif5xQAvrF%2Fuploads%2FBDZqmw1RNbvFicPpomvb%2Fimage.png?alt=media\&token=66598703-51c9-4a01-bac1-19a0bd726480)

### QuestObject

After quest has taken - quest system creates UQSQuest object for each quest. If you need to have custom quest logic (e.g. in example project quest have track state), or make specific handling for quest states - you can use your own quest class.

![UQSQuest functions](https://1249461799-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FkjIT8AFqtlVif5xQAvrF%2Fuploads%2FuoWT9T5X3JIfL6f0SW0S%2Fimage.png?alt=media\&token=554191fa-f8f1-43fe-981b-72c1f74f4c38)

To save custom data for quest - override **WaitForSaveDataFromQuest** function and call **AddDataToSave** function. It data will be saved and loaded when you need it. On this moment it support only String, float and int32 types. Arrays and structures is not supported.&#x20;

Also it has events after quest taken, loaded after save, finished or rewards was given.

### UIData

For Quest or QuestObjective you may have UIData - it instanced object you need to display any quest data in your UI implementation. You can use default ui data or create own like in Example Project

![](https://1249461799-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FkjIT8AFqtlVif5xQAvrF%2Fuploads%2FtcdaoqtLNLybepIMm4Bg%2Fimage.png?alt=media\&token=3e8b8be0-1ab5-49a3-8e97-074753601833)

To get ui data casted to selected class use GetTypedUIData function.

<div align="left"><img src="https://1249461799-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FkjIT8AFqtlVif5xQAvrF%2Fuploads%2FnqVWTJ4DOBNzqmMiUNZx%2Fimage.png?alt=media&#x26;token=d84809e0-1cb5-4a06-b8b1-8874aa96d9b5" alt=""></div>

### Rewards

Each Quest may to have unlimited count of rewards. To handle reward - just create UQSQuestReward class and override **HandleReward** function. It will be called after quest will be finished.

<div align="left"><img src="https://1249461799-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FkjIT8AFqtlVif5xQAvrF%2Fuploads%2Ffl80DruxqA7XaQ8zkHDg%2Fimage.png?alt=media&#x26;token=36811377-3314-4e10-86a5-fe69afc44ca5" alt=""></div>

### Objectives

Each Quest may have unlimited count of objectives.&#x20;

<div align="left"><img src="https://1249461799-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FkjIT8AFqtlVif5xQAvrF%2Fuploads%2FyGEeYqURYa1DaSfxNNz5%2Fimage.png?alt=media&#x26;token=6ffdbca0-f3c9-4f67-aa4a-b0fd274f3406" alt=""></div>

**Objective must have tag** - it need to use functions, like add counter value to objective. Also objectives will be found by this tag.

**InitialCounter value** - value of counter after quest has taken. After all objective counters == requered values - quest will be marked as ready to finish.

**BlockNextObjectivesBeforeCompleteThis** - If you need to sequence objectives execution - set this parameted on objectives and next objectives after selected will be ignored for changing before it will be completed

**CanBeChangedAfterComplete** - if you need to revert some objective value after it already completed - set this parameter to true. All next blockable objectives will be blocked to change. &#x20;

{% hint style="info" %}
Objective example:&#x20;

To complete quest you need to pick 3 apples. It's mean - you need to add new objective. E.g. tag wil be Pick.Item.Apple.&#x20;

And next step - after you picked up apple call add objective counter value with same tag and value 1. Afer current value wil be == to requered value - objective will be completed. After all objective is completed - quest will be marked as ready to finish. Final step - finish quest by using function FinishQuest from quest storage.
{% endhint %}

Quest Object has next functions and events:

<div align="left"><img src="https://1249461799-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FkjIT8AFqtlVif5xQAvrF%2Fuploads%2FIVlk76SfWGijqpn3jp28%2Fimage.png?alt=media&#x26;token=93c7c15c-39d9-49e3-8a20-e089ab0d9444" alt=""></div>

<div align="left"><img src="https://1249461799-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FkjIT8AFqtlVif5xQAvrF%2Fuploads%2FwbAkFeGF3xw3802P5wuQ%2Fimage.png?alt=media&#x26;token=d6e0f2bf-8193-4350-836b-8e2afa0d11cb" alt=""></div>

**Objective Watcher** - allows to track when seletcted objective is changes value

**FinishObjective** - allows to finish objective immediately

**GetObjectives** - get all objectives, all but not blocked, or just not complited without blocked objectives

And events - after objective changed value, objective complete, quest finished/ready to finish, ready to finish canceled or reward received.

## QuestSubsystem

To get access to subsystem just call **UQSQuestSystemSubsystem** function

<div align="left"><img src="https://1249461799-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FkjIT8AFqtlVif5xQAvrF%2Fuploads%2FUcBBZ3iNWQZGhIBtfvyb%2Fimage.png?alt=media&#x26;token=7222cd80-529e-4b13-ae73-a348a61963e9" alt=""></div>

Subsystem contains all quest storages.&#x20;

You can get access to specific storage by tag

<div align="left"><img src="https://1249461799-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FkjIT8AFqtlVif5xQAvrF%2Fuploads%2FN4vxD1nnAN9lsIHGqiKi%2Fimage.png?alt=media&#x26;token=bb0350d8-541c-4150-b856-0f262df3bbcc" alt=""></div>

Also you can take quest to storage with tag, or add objective counter value to all storages

<div align="left"><img src="https://1249461799-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FkjIT8AFqtlVif5xQAvrF%2Fuploads%2FrXq88WbJnjKbAEUd7y5a%2Fimage.png?alt=media&#x26;token=8b2f02ac-6552-42d8-a915-4fe66515d51e" alt=""></div>

Quest subsystem has event after new quest storage was registered&#x20;

<div align="left"><img src="https://1249461799-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FkjIT8AFqtlVif5xQAvrF%2Fuploads%2FjXeYx1pz5C7rCod2dQaK%2Fimage.png?alt=media&#x26;token=a8284561-0cd6-4458-9cf7-e43bf582cb0d" alt=""></div>

And finaly you can get access to QuestSaver object to save or load your quests.

<div align="left"><img src="https://1249461799-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FkjIT8AFqtlVif5xQAvrF%2Fuploads%2F6zGr0wZl7P9Z3tp6SXrc%2Fimage.png?alt=media&#x26;token=3a14164a-6cd9-494c-8c09-5f446b8b0fd5" alt=""></div>

## Save/Load

You can provide save/load quests and quest data to two formats - used unreal save system, or to Json format. You can change format in **ProjectSettings - UltimateQuestSytem**. Also you can change default name of save slot.

<div align="left"><img src="https://1249461799-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FkjIT8AFqtlVif5xQAvrF%2Fuploads%2Fh5mmREtqmMD8EJNJFa8s%2Fimage.png?alt=media&#x26;token=854ff502-24c4-409c-96cf-129f6222ac04" alt=""></div>

To save or load specific or all storages use next functions:&#x20;

<div align="left"><img src="https://1249461799-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FkjIT8AFqtlVif5xQAvrF%2Fuploads%2FhA3FJxM5NqJu9EVxcdUW%2Fimage.png?alt=media&#x26;token=6f1c1877-b1a4-421c-9921-863cd62cbe76" alt=""></div>

If save slot name is empty - will be used last saved save slot name.

To change last save slot name use this function:

![](https://1249461799-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FkjIT8AFqtlVif5xQAvrF%2Fuploads%2FicN4H0kqPf7ueXMmGZ4P%2Fimage.png?alt=media\&token=5b50e214-a01e-481e-afb6-30db1b257a17)

To get access to last save slot use this:

![](https://1249461799-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FkjIT8AFqtlVif5xQAvrF%2Fuploads%2FLn1OBAaol7l8KOIr2UKy%2Fimage.png?alt=media\&token=4b1cbba8-b89e-4faf-a17b-4e4a97424657)

After new quest storage will be registered, it will be used last slot name to load quest data.

To reset name to name from project settings use this:

![](https://1249461799-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FkjIT8AFqtlVif5xQAvrF%2Fuploads%2Fu9C3OR0Ez25pJI1LDZ5f%2Fimage.png?alt=media\&token=429cd271-0675-4cc5-8530-21894c5d04a7)

To delete saved game use this:&#x20;

![](https://1249461799-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FkjIT8AFqtlVif5xQAvrF%2Fuploads%2FgFvChfZZXDFHz5fYcfwS%2Fimage.png?alt=media\&token=2163d843-a562-4395-9e2f-295f1726a11c)

To get saved games use this function. Optionaly you can set name prefix to filter another saved games

![](https://1249461799-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FkjIT8AFqtlVif5xQAvrF%2Fuploads%2FtYEFpdgHr3SE4Ums7Y9T%2Fimage.png?alt=media\&token=41f7ea2a-a788-4a05-b4b5-3bbe7cd15d82)

After quest storage loaded this event will be called:

![](https://1249461799-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FkjIT8AFqtlVif5xQAvrF%2Fuploads%2FyUfMdd59OX3sdmATGjMk%2Fimage.png?alt=media\&token=9c6fbd49-2a60-440b-9ff0-3a824cac9a7e)

If you use custom quest type and you need to save your quest data you need to override **WaitForSaveDataFromQuest** function and call **AddDataToSave** function. It data will be saved and loaded when you need it. On this moment it supports only FString, float and int32 types. **Arrays and structures is not supported**.

<div align="left"><img src="https://1249461799-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FkjIT8AFqtlVif5xQAvrF%2Fuploads%2Fi1hf4qsKbFsr8CUje1Zf%2Fimage.png?alt=media&#x26;token=8041bbda-2723-4a93-a91e-9134533d2a4b" alt=""></div>

Loading process is fully automated, you dont need to do nothing, saved data will be found by name and saved value will be applied.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://dmitriy-vergasov.gitbook.io/ultimate-quest-system/quest-system-overview.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
