# Conditions

## Overview

The **Conditions** modules brings Condition objects to your project. These are Stat-affecting objects which will automatically set Stats to recompute when added, and will remove themselves from the objects which contain them automatically as well, unless you choose to manually decide when they are removed.

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

{% hint style="success" %}
Observant viewers may notice that the video above and below each show *different* ways to cause damage to health using **Conditions**.

**Game Modules** is very very flexible, and there are many ways to use them to achieve desired game mechanics.

The "Conditions Setup" showcases how to set specific damage values at runtime to an "Instant" Condition, while the "Causing Damage..." video shows how an Instant Condition can pull the damage value directly from the "Damage" stat of the player.

Both work, but you may wish to choose one method over the other (or something else entirely) based on your project.
{% endhint %}

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

{% hint style="info" %}
[**Timeboard**](/magic-pig-games/game-modules-4/module-documentation/gametime-and-timeboard/timeboard.md) is required for **Conditions** to operate properly and automatically. Make sure you bring the Timeboard prefab into the scene.
{% endhint %}

***

{% hint style="warning" %}
Tutorials below should be accurate, though they are from the previous version of Game Modules. There are slight UX changes, and perhaps new features in Game Modules 4. These will be re-done at some point in the future.
{% endhint %}

{% embed url="<https://www.youtube.com/watch?v=zabU2QBXWSU>" %}
This video demonstrates the creation of a new `Condition`.
{% endembed %}

{% embed url="<https://www.youtube.com/watch?v=kmOCMGTlYkk>" %}
In this video, I show how I'm adding a `Condition` to a magic spell (which uses the **Items** module), to apply when the spell is cast on a player.
{% endembed %}


---

# 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://infinitypbr.gitbook.io/magic-pig-games/game-modules-4/module-documentation/conditions.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.
