# Defold Quest - Quest System for Defold

**URL:** <https://forum.defold.com/t/defold-quest-quest-system-for-defold/82416>\
**Category:** The Defoldmine\
**Created:** [February 22, 2026, 10:08am UTC](https://forum.defold.com/t/defold-quest-quest-system-for-defold/82416 "2026-02-22T10:08:10Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Insality](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/insality/32/39737_2.png) [@Insality](https://forum.defold.com/u/Insality)\
**Post date:** [February 22, 2026, 10:08am UTC](https://forum.defold.com/t/defold-quest-quest-system-for-defold/82416/1 "2026-02-22T10:08:10Z")

</div>

![logo](https://forum-defold-uploads.b-cdn.net/original/3X/5/4/5456c37fe8217abedf987c2af1f547053ea7e991.jpeg)

# Quest

**Quest** - module is a comprehensive system for managing quests in a game. It allows for the registration, tracking, and completion of quests, with various events and callbacks to handle quest-related activities.

Quest here is a set of tasks that player needs to complete the quest. Just trigger in a required place a function call like `quest.event("collect", "coin")` and all logic will be handled automatically.

## Features

- **Quest Management** - Create, start, and complete quests with ease.
- **Quest Progress** - Track the progress of quests and their tasks.
- **Quest Events** - Listen for quest-related events and adjust it for your needs.
- **Quest Configs** - Flexible quest config system which allows to use quests in various ways.

## Setup

See the [**Defold Quest**](https://github.com/Insality/defold-quest) repository on Github

- [Setup](https://github.com/Insality/defold-quest?tab=readme-ov-file#setup)
- [API Reference](https://github.com/Insality/defold-quest/?tab=readme-ov-file#quick-api-reference)
- [Use Cases](https://github.com/Insality/defold-quest/blob/main/USE_CASES.md)

## Basic Usage

In Quest library, you have to create a config for quests and start quest system. After that you can trigger events for quests and subscribe to events to handle them for your needs.

```lua
local quest = require("quest.quest")

-- Fill the quests config and start quest system
quest.init({
	["quest_01"] = {
		autostart = true,
		autofinish = true,
		category = "quests",
		tasks = { { action = "intro_completed" } },
	},
	["quest_02"] = {
		autostart = true,
		autofinish = true,
		category = "quests",
		required_quests = { "quest_01" },
		tasks = { { action = "collect", object = "coin", required = 10 } },
	},
	["quest_03"] = {
		autostart = true,
		autofinish = true,
		category = "quests",
		required_quests = { "quest_02" },
		tasks = {
			{ action = "kill", object = "enemy", required = 5 },
			{ action = "kill", object = "boss", required = 1 }
		},
	},
})

-- Throw events for active quests
quest.event("kill", "enemy")
quest.event("kill", "enemy", 2)
quest.event("collect", "coin", 3)

-- Subscribe to quest events to handle them for your needs
quest.on_quest_event:subscribe(function(event_data)
	print("Type", event_data.type) -- "register"|"start"|"progress"|"task_completed"|"completed"
	print("Quest ID", event_data.quest_id) -- Quest ID
	print("Quest Config", event_data.quest_config) -- Quest Config table
	print("Delta", event_data.delta) -- Progress delta (for "progress" type)
	print("Total", event_data.total) -- Total progress (for "progress" type)
	print("Task Index", event_data.task_index) -- Task index (for "progress" and "task_completed" types)

	-- This is a queue and we have to handle event by returning true
	-- If we don't return true, the event will be fired again
	return true
end)

-- Check if any quest is active for specific action and object
local quests = quest.get_current_with_task("kill", "boss")

```

Read [Use Cases](https://github.com/Insality/defold-quest/blob/main/USE_CASES.md) for more examples.

## ❤ Support project ❤

Your donation helps me stay engaged in creating valuable projects for **Defold**. If you appreciate what I’m doing, please consider supporting me!

[![Github-sponsors](https://img.shields.io/badge/sponsor-30363D?style=for-the-badge&logo=GitHub-Sponsors&logoColor=#EA4AAA)](https://github.com/sponsors/insality) [![Ko-Fi](https://img.shields.io/badge/Ko--fi-F16061?style=for-the-badge&logo=ko-fi&logoColor=white)](https://ko-fi.com/insality) [![BuyMeACoffee](https://img.shields.io/badge/Buy%20Me%20a%20Coffee-ffdd00?style=for-the-badge&logo=buy-me-a-coffee&logoColor=black)](https://www.buymeacoffee.com/insality)

---

<div class="post-metadata">

**Author:** ![Insality](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/insality/32/39737_2.png) [@Insality](https://forum.defold.com/u/Insality)\
**Post date:** [February 22, 2026, 10:08am UTC](https://forum.defold.com/t/defold-quest-quest-system-for-defold/82416/2 "2026-02-22T10:08:38Z")

</div>

There is several Debug Panels Druid’s Widgets in the [Asset Store](https://github.com/Insality/asset-store). One of them is **Quest Debug Panel** which allows you inspect all loaded quests, their configs, add progresses to quests, track and fire quest events for debugging purposes.

Live example: [Asset Store 1.0](https://insality.github.io/asset-store/examples/widget/Insality:debug_page_quest@1/index.html)  
Source code: [asset-store/widget/Insality/debug\_page\_quest/example/example\_debug\_page\_quest.gui\_script at main · Insality/asset-store · GitHub](https://github.com/Insality/asset-store/blob/main/widget/Insality/debug_page_quest/example/example_debug_page_quest.gui_script)

This debug panel built with **Druid** Properties Panel Widget. You can easily extend it to your own needs by adding new properties or modifying the existing ones.

---

<div class="post-metadata">

**Author:** ![JuLongZhiLu](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/julongzhilu/32/42720_2.png) [@JuLongZhiLu](https://forum.defold.com/u/JuLongZhiLu)\
**Post date:** [February 22, 2026, 12:57pm UTC](https://forum.defold.com/t/defold-quest-quest-system-for-defold/82416/3 "2026-02-22T12:57:13Z")

</div>

Thank you 👍
