# Craft Quests

## Begin Game Maker 6

### Integrate Quests & Objects

#### :yellow\_circle: MEDIUM

In this activity, you will learn how to guide players through your gameplay with Objectives, or quests, and icons to help players find quest objects like NPCs, collectable objects, and more.

{% embed url="<https://youtu.be/IxlSAtCvtBk>" %}

{% tabs %}
{% tab title="About" %}

### **What are Quests?**

Located in the [**Objectives**](https://docs.sandbox.game/en/creator/game-maker/docs/objectives) system, **Quests** are used to guide players through your game's story, geography, game mechanics, and more with a sleek user interface. Objects in the game world can be linked to quests so they're easier to find.

{% hint style="info" %}
A quest may be triggered and completed only one time.
{% endhint %}

### **Launch Game Maker**

* <mark style="background-color:yellow;">Open the Experience from the previous activity</mark> to reuse some of its logic.

{% hint style="info" %}
To track individual player progression in single and multiplayer games, <mark style="color:green;">**\[SP]**</mark> behaviors and components must be used to send messages to the **Objectives** system.

&#x20;<mark style="color:yellow;">**\[MP]**</mark> logic works like <mark style="color:green;">**\[SP]**</mark> logic in singleplayer games.
{% endhint %}
{% endtab %}

{% tab title="Starting a Quest" %}

### Locked/Unlocked

Open the Objectives window and toggle on quests.&#x20;

Let's add two quests to compare when they'll appear on the right side of the player screen in the Objectives UI, or user interface. Ignore other quest settings for now.

<table data-card-size="large" data-view="cards"><thead><tr><th></th></tr></thead><tbody><tr><td>Name: Auto Quest<br>1. Unlock quest: Auto Unlock<br>2. Launch quest: Auto Launch</td></tr><tr><td>Name: Triggered Quest<br>1. Unlock quest: Requires Message<br>Message: <code>DoorA.Open</code><br>2. Launch quest: Auto Launch<br><br>Note: In the last activity, an Ancient Lever object sends this message when players interact with it.</td></tr></tbody></table>

#### Test

Press **`TAB`** to see the "Auto Quest" open at game start.&#x20;

Interact with the Ancient Lever that sends `DoorA.Open` to All, which will make the "Triggered Quest" appear in the UI because the quest is set to auto launch.

### When to Launch

Modify both quests to require a message to launch:

<table data-card-size="large" data-view="cards"><thead><tr><th></th></tr></thead><tbody><tr><td>Name: Auto Quest<br>1. Unlock quest: Auto Unlock<br>2. Launch Quest: Requires Message<br>Message: <code>DoorA.Open</code></td></tr><tr><td>Name: Triggered Quest<br>1. Unlock quest: Requires Message<br>Message: <code>DoorA.Open</code><br>2. Launch Quest: Message Required<br>Message: <code>Night</code><br><br>Note: In the last activity, a logic asset with a Trigger Volume component sends this message when players enter the volume.</td></tr></tbody></table>

#### Test

Press **`TAB`** to test. Notice that no quests appear in the UI yet.

Try entering the trigger volume (remember that your game will shift to night from the previous activity's settings). The "Triggered Quest" will not launch yet because it is still locked.

Interact with the Ancient Lever asset to send `DoorA.Open` and you'll make the "Auto Quest" launch in the UI. The "Triggered Quest" is also unlocked by this message.

Now you can enter the trigger volume and launch the "Triggered Quest" in the UI.

{% hint style="info" %}
Launch settings allow you to control how many quests may be activated at a time, while unlock settings allow you to control when players are permitted to start a quest.
{% endhint %}
{% endtab %}

{% tab title="Variety" %}

### Different Quest Types and Conditions

{% hint style="info" %}
There are four types of quests: counter, asset death, timer, and wait for message.
{% endhint %}

First let's set up interactive assets for a counter quest:

<table data-card-size="large" data-view="cards"><thead><tr><th></th><th></th><th></th><th></th></tr></thead><tbody><tr><td><strong>Asset name:</strong> Ancient Artifact<br><strong>Tag:</strong> artifact<br><mark style="background-color:red;">Remove</mark> Predator behaviour</td><td><p><strong>Health</strong> component</p><ul><li>Health: 10</li></ul></td><td><p><strong>Drop</strong> component</p><ul><li><mark style="color:green;"><strong>Assets to Spawn:</strong></mark> Ancient Treasure A</li><li><mark style="color:green;"><strong>Components</strong>:</mark> [SP] Collectable</li><li><mark style="color:green;"><strong>Tags:</strong></mark> treasure</li></ul></td><td>Note: Duplicate this asset (5 total)</td></tr></tbody></table>

### Counter- Destroy Objects

Create a new quest (auto unlock and launch):

Name: Treasure Hunt\
Description: "Destroy the ancient artifacts and collect all of the treasure.”

3\. Counter

* Type: death
* Tag: artifact
* Amount: 5

Test - The quest counts the number of objects destroyed with the tag you set for it to watch.

### Counter - Collect Objects

Modify the quest:

3\. Counter

* Type: collected objects
* Tag: treasure
* Amount: 5

#### Test

Press **`TAB`** to test. When you attack and destroy each artifact, nothing happens. When you collect each pile of treasure dropped after each artifact is destroyed, the quest counts the number of objects collected with the tag you set for it to watch.

{% hint style="info" %}
You can apply the same tag to collect or destroy different types of objects, such as ingredients to make a meal.
{% endhint %}
{% endtab %}

{% tab title="States" %}

### Quest States

A quest may be in three states: inactive, in progress, and finished. We can use NPC dialogue to tell players how to start or complete a quest and confirm the quest is finished.

Create an NPC and dialogue:

<table data-card-size="large" data-view="cards"><thead><tr><th></th><th></th><th></th></tr></thead><tbody><tr><td><strong>Asset:</strong> Adventurer Jet</td><td><p><strong>Asker</strong> behaviour</p><ul><li>Question: Can you help me find ancient treasure hidden inside the artifacts?</li><li>Answer 1: Sounds like fun!<br>A1 Message: <code>Q.Treasure.Launch</code></li></ul></td><td><p><strong>Toggle</strong> behaviour</p><ul><li>Turn OFF Message: <code>Q.Treasure.Launch</code></li></ul></td></tr><tr><td><strong>Asset:</strong> Logic asset</td><td><p><strong>Asker</strong> behaviour</p><ul><li>Question: Did you find the artifacts yet?</li><li>Answer 1: I'm still looking for them!<br>A1 Message: <code>Q.Treasure.InProgress</code></li></ul></td><td><p><strong>Toggle</strong> behaviour</p><ul><li>Turn ON Message: <code>Q.Treasure.Launch</code></li><li>Turn OFF Message: <code>Q.Treasure.InProgress</code></li></ul></td></tr><tr><td><strong>Asset:</strong> Logic asset</td><td><p><strong>Asker</strong> behaviour</p><ul><li>Question: Awesome! You found the treasure!</li><li>Answer 1: That was a piece of cake!</li></ul></td><td><p><strong>Toggle</strong> behaviour</p><ul><li>Turn On Message: <code>Q.Treasure.Complete</code></li></ul></td></tr></tbody></table>

Now connect the dialogue to timing of the quest:

Name: Treasure Hunt\
2\. Launch quest: Requires Message\
Message: `Q.Treasure.Launch`\
5\. Action after completion: Requires Message\
Message: `Q.Treasure.Complete`

#### Test

Press **`TAB`** to test.

**Quest inactive** - Interact with the NPC to start the quest. This dialogue is then toggled off by its own message out when you answer the question.

**Quest in progress** - Interact after the quest is launched to see the dialogue, which can be a helpful reminder for players. No message is needed unless you want to trigger a hint for players.

**Quest complete** - Interact after the quest is complete to see the dialogue.
{% endtab %}

{% tab title="Indicators" %}

### Adding Polish with Indicators

You can apply three types of icons to objects that are linked to a quest:

<div><figure><img src="https://331512196-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F83PS3g9zpWmq73xzlwFn%2Fuploads%2FWoay1gVc4YgSEambx817%2Fimage.png?alt=media&#x26;token=980b27fd-b3d7-44b3-85b3-7dccdce497b9" alt="" width="43"><figcaption><p>Giver</p></figcaption></figure> <figure><img src="https://331512196-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F83PS3g9zpWmq73xzlwFn%2Fuploads%2F3YEd4oQsNGf4AiNMTJtg%2Fimage.png?alt=media&#x26;token=03381546-1226-4f2d-b59c-5c827af8218c" alt="" width="49"><figcaption><p>Objective</p></figcaption></figure> <figure><img src="https://331512196-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F83PS3g9zpWmq73xzlwFn%2Fuploads%2FWnDOoI9qD1FloCDdE9j5%2Fimage.png?alt=media&#x26;token=18cadcd1-308f-4b39-83ea-ed22dbfe276a" alt="" width="39"><figcaption><p>Receiver</p></figcaption></figure></div>

These icons are displayed above objects in the game world when an Indicator component is applied to the objects, a quest is linked, and quest settings match the type of icon to use.

Modify Jet and the "Treasure Hunt" quest so he can be a quest giver:

<table data-card-size="large" data-view="cards"><thead><tr><th></th><th></th></tr></thead><tbody><tr><td>Modify <strong>Asset:</strong> Adventurer Jet</td><td><p>Add an <strong>Indicator</strong> component<br><strong>Linked quest ID:</strong> Treasure Hunt<br><strong>Quest cursors:</strong> True</p><ul><li><strong>Giver:</strong> Adventurer Jet</li></ul></td></tr></tbody></table>

#### Create a Custom Preset to Drop

Since the tagged object that the quest counts is a dropped item (meaning it is spawned), we'll modify the ancient artifact assets to use a Preset with custom settings that link to a specific quest. You don't need to create a preset for quest items, but we've chosen an example that's a bit more fun for players.

Create an object:

<table data-card-size="large" data-view="cards"><thead><tr><th></th><th></th><th></th></tr></thead><tbody><tr><td><strong>Asset:</strong> Ancient Treasure A<br><strong>Tag:</strong> treasure</td><td><p><strong>Indicator</strong> component</p><ul><li><strong>Linked Quest ID:</strong> Treasure Hunt</li><li><strong>Quest cursors:</strong> True</li><li><strong>Objective:</strong> Treasure Hunter</li></ul></td><td><strong>Collectable</strong> component</td></tr></tbody></table>

Save this object as a Preset. This allows you to spawn or place an object or group of objects with more complex custom settings during edit or play modes.&#x20;

Modify all ancient artifact assets to spawn this preset.

#### Test

The exclamation point appears above the NPC before the quest starts because it's the quest giver.&#x20;

After you interact with it, the target icons appear above each quest objective, the ancient artifacts to destroy.&#x20;

Once you have collect all of the treasure, the icons and quest are no longer visible.

{% hint style="warning" %}
Save your Experience to reuse the logic in the next activity.
{% endhint %}
{% endtab %}
{% endtabs %}

### Follow Up

Quests are a great way to guide players through the flow of your Experience. They can be very simple, or they can have complex steps and hints to help players when connected with objects.

* A Counter quest can be used in different ways to count what players destroy or collect.
* A Timer quest can be a fun challenge to survive or defend an asset during a time period.
* An Asset Death quest can be used for a special boss fight.
* A Wait for Message quest is extremely flexible in use since it only requires a message to complete it.

In the next activity, we'll learn how to create more interesting game mechanics with Game Rules.

***

## :heavy\_plus\_sign: Relevant Resources

<table data-view="cards"><thead><tr><th data-type="content-ref"></th><th></th><th data-hidden data-card-target data-type="content-ref"></th><th data-hidden data-type="files"></th><th data-hidden data-card-cover data-type="files"></th></tr></thead><tbody><tr><td><a href="../docs/objectives">objectives</a></td><td>Learn the details of every quest type and the controls to manage them</td><td><a href="../docs/objectives">objectives</a></td><td></td><td><a href="https://331512196-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F83PS3g9zpWmq73xzlwFn%2Fuploads%2F20utJFOsBveLtek6GDD9%2Fimage.png?alt=media&#x26;token=dddbbb06-1719-4638-941a-a71adf3409b1">gm quest types.png</a></td></tr><tr><td><a href="../creative-guides/logic-guide/text-quests-and-icons">text-quests-and-icons</a></td><td>Discover more resources about templates, quest cursors, dialogue states, and how dialogue is used</td><td><a href="../creative-guides/logic-guide/text-quests-and-icons">text-quests-and-icons</a></td><td></td><td><a href="https://331512196-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F83PS3g9zpWmq73xzlwFn%2Fuploads%2FL3zDBLr7X1iIl63CGsTZ%2Fimage.png?alt=media&#x26;token=9b2c7fd7-66ce-4603-b1a2-f739b72e4164">gm counter quest thumb.png</a></td></tr><tr><td><a href="broken-reference">Broken link</a></td><td>Learn what dialogue strings are used for and how they're made</td><td><a href="broken-reference">Broken link</a></td><td></td><td><a href="https://331512196-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F83PS3g9zpWmq73xzlwFn%2Fuploads%2FW9p5q3tnHEYhyQ5668fd%2Fimage.png?alt=media&#x26;token=5e6837ef-7c80-4cb1-a05a-def376a8298e">gm asker behavior thumb.png</a></td></tr><tr><td><a href="../creative-guides/experience-design-techniques/narrative-design/dialogue">dialogue</a></td><td>Find expert tips to write great dialogue, stay within technical guidelines, and stay organized</td><td><a href="../creative-guides/experience-design-techniques/narrative-design/dialogue">dialogue</a></td><td></td><td><a href="https://content.gitbook.com/content/83PS3g9zpWmq73xzlwFn/blobs/FM87wn99RkoEERiHC59b/agencies.png">agencies.png</a></td></tr></tbody></table>

***

## Forum: Community Ideas & Support

<table data-card-size="large" data-view="cards"><thead><tr><th></th><th data-hidden data-card-cover data-type="files"></th><th data-hidden data-card-target data-type="content-ref"></th></tr></thead><tbody><tr><td><a href="https://forum.sandbox.game/t/begin-game-maker-series-6-craft-quests/1841"><strong>Visit the Forum</strong></a></td><td><a href="https://content.gitbook.com/content/83PS3g9zpWmq73xzlwFn/blobs/R2GdZMImITUqYrmiThBY/13%20community%20%20-%20%20blog.png">13 community  -  blog.png</a></td><td><a href="https://forum.sandbox.game/t/begin-game-maker-series-6-craft-quests/1841">https://forum.sandbox.game/t/begin-game-maker-series-6-craft-quests/1841</a></td></tr><tr><td><p>A forum post has been created for this learning activity! Visit to:</p><ul><li>Ask or answer questions</li><li>Post ideas about the topic</li><li><p>Share what you've learned or created</p><ul><li>from the activity</li><li>from the bonus resources</li></ul></li></ul></td><td></td><td><a href="https://forum.sandbox.game/t/begin-game-maker-series-6-craft-quests/1841">https://forum.sandbox.game/t/begin-game-maker-series-6-craft-quests/1841</a></td></tr></tbody></table>

***

## Other "Begin Game Maker" Videos

<table data-header-hidden><thead><tr><th data-type="content-ref"></th></tr></thead><tbody><tr><td><a href="play-test">play-test</a></td></tr><tr><td><a href="build-with-blocks">build-with-blocks</a></td></tr><tr><td><a href="place-assets">place-assets</a></td></tr><tr><td><a href="set-object-actions">set-object-actions</a></td></tr><tr><td><a href="trigger-logic">trigger-logic</a></td></tr><tr><td><a href="craft-quests">craft-quests</a></td></tr><tr><td><a href="set-up-mechanics">set-up-mechanics</a></td></tr><tr><td><a href="build-multiplayer-games">build-multiplayer-games</a></td></tr></tbody></table>
