> For the complete documentation index, see [llms.txt](https://black-horizon-studios.gitbook.io/emerald-ai-wiki/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://black-horizon-studios.gitbook.io/emerald-ai-wiki/emerald-components-optional/events-component.md).

# Events Component

<figure><img src="https://content.gitbook.com/content/v03IiZPaMe8fX49a9MnO/blobs/yDso0EgG1g6QwB9dH39S/EventsComponent.png" alt=""><figcaption><p>The Emerald Events Component. Pressing the foldout areas will expand its options.</p></figcaption></figure>

## Using the Events Component

The Events Component allows users to create Unity Events for various functionality that happens both in and out of combat. These events can be used to call custom functions or code. There's also an option to call these through the Emerald Events editor through the inspector. There are 13 built-in Unity Events that are called during various Emerald AI actions. You can use these events to trigger custom function calls and other mechanics to expand functionality with AI.

{% hint style="success" %}
Here are the available tutorials and guides for the Events Component.
{% endhint %}

<table data-view="cards"><thead><tr><th></th><th></th><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></td><td><p>            Applying the </p><p>      Events Component</p></td><td></td><td><a href="https://content.gitbook.com/content/v03IiZPaMe8fX49a9MnO/blobs/OcXbvAj4sbRUoJW0IPGY/AddingTheEventsComponent.gif">AddingTheEventsComponent.gif</a></td><td><a href="/emerald-ai-wiki/emerald-components-optional/events-component/applying-the-events-component.md">Applying the Events Component</a></td></tr><tr><td><p></p><p>Events Through the Editor</p></td><td></td><td></td><td><a href="https://content.gitbook.com/content/v03IiZPaMe8fX49a9MnO/blobs/s9qQAjtfpzhoKPeQYqsO/ExampleUnityEvent.png">ExampleUnityEvent.png</a></td><td><a href="/emerald-ai-wiki/emerald-components-optional/events-component/creating-an-event-through-the-editor.md">Creating an Event Through the Editor</a></td></tr><tr><td></td><td>    Events Through Code</td><td></td><td><a href="https://content.gitbook.com/content/v03IiZPaMe8fX49a9MnO/blobs/9slKyhBOypNjtVru9CVc/CACoverImage.png">CACoverImage.png</a></td><td><a href="/emerald-ai-wiki/emerald-components-optional/events-component/creating-an-event-through-code.md">Creating an Event Through Code</a></td></tr></tbody></table>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://black-horizon-studios.gitbook.io/emerald-ai-wiki/emerald-components-optional/events-component.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
