> 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/zh/cha-jian-yu-ji-cheng/unreal-engine/guides/narrative-design/narrative-design-keys.md).

# Narrative Design 键

我们将创建一个简单场景，角色会欢迎玩家，并根据玩家当前的时间段询问他们晚上或早上过得怎么样。

1. 在 playground 中，为你的角色启用 Narrative Design，并将起始章节名称更改为 `欢迎`.<br>
2. 将以下内容添加到 Welcome 部分的 Objective 字段：\
   `当前时间段是 {TimeOfDay}。欢迎玩家，并询问他这个 {TimeOfDay} 过得怎么样。`\
   \
   请注意，在花括号中添加任意字符串后，它就会成为一个变量；而我们在这里所做的是将时间段作为变量加入，然后在 Unreal 中我们可以传入“Morning”或“Evening”这两个词，角色会据此做出相应回应。

   <figure><img src="/files/71bd9a33890d500a22c6cbafb76db8f797b15f8c" alt=""><figcaption><p><br></p></figcaption></figure>
3. 回到 Unreal，打开角色的蓝图。<br>
4. 设置 `叙事模板键` 带有一个包含相同变量名的映射的变量 `TimeOfDay` 为了演示，我们将把该值硬编码为“Morning”。<br>

   <figure><img src="/files/574a18445643b5e6a624b56ccf2e4716519171be" alt=""><figcaption><p><br></p></figcaption></figure>
5. 启动播放模式并试试看。<br>

   <figure><img src="/files/583e799e2f42f063c5c7cdc0695e7dc42bdf9828" alt=""><figcaption></figcaption></figure>
6. 不妨尝试其他场景和设置，以更好地适配你的用例。

{% hint style="info" %}

* 你可以在 Sections 和 Triggers 中使用叙事设计键功能。
* 确保变量名位于花括号内，且中间没有空格。
* 你可以在 Unreal 蓝图中动态设置、修改或清除叙事键。
  {% endhint %}


---

# 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 dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.convai.com/api-docs/zh/cha-jian-yu-ji-cheng/unreal-engine/guides/narrative-design/narrative-design-keys.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.
