> For the complete documentation index, see [llms.txt](https://docs.convai.com/api-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.convai.com/api-docs/plugins-and-integrations/convai-unreal-engine-plugin/features/narrative-design/narrative-design-quick-start.md).

# Narrative design quick start

Invoke a named narrative trigger from Blueprint and confirm a section change by printing the new section ID to the screen.

We will invoke a named narrative trigger on a Convai character and confirm that the story graph advances. After setup, pressing a bound key calls **Invoke Narrative Design Trigger**; when Convai advances the graph, **On Narrative Section Received** prints the new `Narrative Section ID` to the screen.

### What we will build

A character Blueprint that binds **On Narrative Section Received** on its `UConvaiChatbotComponent`, then calls **Invoke Narrative Design Trigger** when the player presses a key. A **Print String** node and the **Output Log** confirm the section change.

### Prerequisites

* The Convai Unreal Engine plugin is installed and the API key is configured. See [Install the Convai plugin](/api-docs/plugins-and-integrations/convai-unreal-engine-plugin/getting-started/install-the-convai-plugin.md) and [Configure your API key](/api-docs/plugins-and-integrations/convai-unreal-engine-plugin/getting-started/configure-your-api-key.md).
* A character `Actor` Blueprint with a `UConvaiChatbotComponent` (`Convai Chatbot`) and `CharacterID` set to a valid ID. See [Add your first Convai character](/api-docs/plugins-and-integrations/convai-unreal-engine-plugin/getting-started/add-your-first-convai-character.md).
* At least one section and one trigger configured in the Convai dashboard for that character ID. See [Narrative Design | Playground](/api-docs/convai-playground/character-customization/narrative-design.md).

Before you open Unreal Engine, confirm in the dashboard:

| Check          | What to verify                                                                  |
| -------------- | ------------------------------------------------------------------------------- |
| Graph exists   | The character has at least one section and one outbound trigger.                |
| Trigger name   | Copy the trigger name exactly — it is case-sensitive.                           |
| Reachable edge | The trigger is an outbound edge from the section the character starts on.       |
| Character ID   | The `CharacterID` on `UConvaiChatbotComponent` matches the dashboard character. |

### Build the Blueprint

{% stepper %}
{% step %}

#### Open the character Blueprint

Open the Actor Blueprint that contains your `UConvaiChatbotComponent`. In the **Event Graph**, click the component in the **Components** panel to select it.
{% endstep %}

{% step %}

#### Bind On Narrative Section Received

Drag the `UConvaiChatbotComponent` reference from the **Components** panel into the Event Graph. From the component pin, drag off and search for **On Narrative Section Received**. Select **Assign On Narrative Section Received** to create a bound event node.

The generated event node exposes two output pins: `Chatbot Component` (`UConvaiChatbotComponent` reference) and `Narrative Section ID` (`FString`).
{% endstep %}

{% step %}

#### Print the section ID

Connect a **Print String** node to the event's execution pin. Feed the `Narrative Section ID` output pin into **Print String**'s `In String` input. This prints the new section ID to the screen whenever Convai advances the story graph.
{% endstep %}

{% step %}

#### Call Invoke Narrative Design Trigger on a key press

From the Event Graph, add a **Keyboard** event node (for example `F` key). Drag the `UConvaiChatbotComponent` reference from the **Components** panel and call **Invoke Narrative Design Trigger** from it.

Set `Trigger Name` to the trigger name exactly as it appears in the Convai dashboard (for example `start_inspection`). Connect the **Pressed** execution pin of the keyboard event to **Invoke Narrative Design Trigger**.

{% hint style="info" %}
`bAutoInitializeSession` defaults to `true` on `UConvaiChatbotComponent`, so the session opens on **Begin Play**. If you press the key before the session connects, the trigger queues in `PendingTriggers` and replays once the connection is open.
{% endhint %}
{% endstep %}

{% step %}

#### Play In Editor and activate the trigger

Click **Play In Editor**. After the session connects, press the key you bound. Watch the screen for a printed section ID string.

If the trigger name matches a trigger reachable from the character's current section, Convai advances the story graph and **On Narrative Section Received** fires with the new `Narrative Section ID`.

If nothing prints, see [Troubleshoot narrative design](/api-docs/plugins-and-integrations/convai-unreal-engine-plugin/features/narrative-design/troubleshoot-narrative-design.md). Common causes: trigger name mismatch, wrong `CharacterID`, or a trigger not connected to the current section in the dashboard.
{% endstep %}
{% endstepper %}

A non-empty section ID printed to the screen confirms that Convai received the trigger and advanced the story graph.

### Next steps

{% content-ref url="/pages/Khv7SfpK36SvMkUjcjoW" %}
[Narrative triggers](/api-docs/plugins-and-integrations/convai-unreal-engine-plugin/features/narrative-design/narrative-triggers.md)
{% endcontent-ref %}

{% content-ref url="/pages/WlLowI3BqDYQNs4lfQM4" %}
[Template keys](/api-docs/plugins-and-integrations/convai-unreal-engine-plugin/features/narrative-design/template-keys.md)
{% endcontent-ref %}

{% content-ref url="/pages/5UHlXoAxUOLuWB0TElfn" %}
[How narrative design works](/api-docs/plugins-and-integrations/convai-unreal-engine-plugin/features/narrative-design/how-narrative-design-works.md)
{% endcontent-ref %}

Use the troubleshooting page if the trigger call runs but no section ID prints in Play In Editor.

{% content-ref url="/pages/uGDfbeU2MRjQlg7HV1GY" %}
[Troubleshoot narrative design](/api-docs/plugins-and-integrations/convai-unreal-engine-plugin/features/narrative-design/troubleshoot-narrative-design.md)
{% endcontent-ref %}


---

# 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://docs.convai.com/api-docs/plugins-and-integrations/convai-unreal-engine-plugin/features/narrative-design/narrative-design-quick-start.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.
