# How to add new quest

Files needed:

> assets/gameplay/quests.json

Quest JSON structure:

{% code title="quests.json" %}

```json
{
    "id": "quest_unique_ID",
    "title": "quest.language.key.name",
    "money": 0,
    "reward": [],
    "map_spot_id": null
}
```

{% endcode %}

{% code title="Properties description" %}

```ini
money = reward money that will be added to player after quest completed
reward = list of items IDs that will be added to player
map_spot_id = cut-off feature, always set to null
```

{% endcode %}

You can create new quest by adding new structure with unique ID to the quests file.

{% code title="quests.json" %}

```json
{
  "id": "my_mod_quest",
  "title": "my.mod.quest.name",
  "money": 1500,
  "reward": ["medkit","medkit","antirad","ammo_ak"],
  "map_spot_id": null
}
```

{% endcode %}

Now you can add this quest in <mark style="color:orange;">assets/scripts/p\_game.gd</mark> file with GameManager:

```gdscript
GameManager.AddQuestJson("my_mod_quest")
```

And complete it with GameManager:

```gdscript
GameManager.CompleteQuest("my_mod_quest")
```

How it looks like in the game:

<figure><img src="/files/9eF7NaTGJsa75pvgEoLK" alt=""><figcaption><p>Quest added to the journal</p></figcaption></figure>

<figure><img src="/files/A48fE5kTbcTCODgWxw0y" alt=""><figcaption><p>Quest completed and reward is received</p></figcaption></figure>


---

# 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://picnic-in-the-oblivion.gitbook.io/assets/modding/how-to-add-new-quest.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.
