> For the complete documentation index, see [llms.txt](https://infinitypbr.gitbook.io/magic-pig-games/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://infinitypbr.gitbook.io/magic-pig-games/game-modules-4/module-documentation/quests/demo-scene-quests/rescue-the-puppy.md).

# Rescue the Puppy

### Quest Details

In this quest I want to demonstrate a few concepts. First, the quest will not be given until the player "talks" to an NPC by moving close to them. At that point the quest is started, and another NPC (the lost puppy) is notified via the **QuestEvent** mechanism. A timer starts, which will "kill" the dog if it runs out before the player finds them.

When the timer runs out, the dog will die, and notify the **Blackboard**, at which point the **QuestCondition** will fail. However, the quest is not set to *Auto-fail*, so the player will not know that they've failed until they find the dog.

When they find the dead dog, the quest will be set to complete via the in-game dialogue.

However, if the dog is still alive (timer has not run out), then the quest will be marked as complete as the dog will be rescued, sending a **BlackboardNote** with that data. The quest will not be completed until the player returns to the original NPC to "Turn in" the quest.

<figure><img src="/files/UE1OJHeuuZDyJZ951msh" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
At least one **QuestCondition** requires an *Object ID* as the **Blackboard** *Topic*. This can be taken from the owner of the **GameQuest**, set manually at runtime (often when the quest is assigned), or set in the inspector.

This **Quest** sets the *Object ID* as "Puppy". We know in the demo there will only be one object with this ID, so it's fine to just set it now.
{% endhint %}

The **QuestCondition** objects *"NPC Is Rescued"* and *"NPC Is Dead"* are set up the same, but with opposite outcomes. Both are met if `true`, and they can be used in many situations, with different quests, as the **Blackboard Topic** is marked as *"Use Object Id"*, rather than a fixed value.

<figure><img src="/files/AfsphBOKzrFt2e15rvGB" alt=""><figcaption></figcaption></figure>
