> 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/web-plugins/narrative-design-guide.md).

# 叙事设计指南

叙事设计——基于叙事的 Web 端 Convai NPC。

叙事设计是一种构建互动故事的方法，尤其适用于 Web 环境中的 convai 非玩家角色 (NPC)。它采用基于图的系统，其中每个节点都代表故事推进中的一个步骤。

## Convai Playground

1. 选择要启用叙事设计的角色。
2. 在 convai playground 中打开“叙事设计”部分。\
   \ <img src="https://2402152281-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FEtUJA212Zc1S9ACc8T4l%2Fuploads%2Fdc9mGu8yVcQhXfpX1cCd%2Fimage.png?alt=media&amp;token=e2780e85-f3fa-4c49-b5b7-eda49b4831f8" alt="" data-size="original"><br>
3. 根据你的故事情节创建叙事地图/图。下方是一个示例。蓝色方框表示触发器（用于启动图中的一条线），黑色方框表示段落（角色要谈论的内容）。\
   ![](https://2402152281-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FEtUJA212Zc1S9ACc8T4l%2Fuploads%2FfaSJpTOp4xG3KGxuWTlV%2Fimage.png?alt=media\&token=6995e83d-c7f3-4be6-a1b3-fffdd396c7a7)<br>
4. 每个段落都有一个目标和一些决策。角色会根据“目标”中写的内容进行发言/回应。你可以使用以下标签为角色指定确切的对白： `<speak>{your dialogue}</speak>` 对于决策，可添加消息作为上下文，说明角色如何自行决定转到哪个目标。你想要控制的决策，可以通过下一部分中的 invokeTrigger 来实现。<br>

   <figure><img src="https://2402152281-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FEtUJA212Zc1S9ACc8T4l%2Fuploads%2FrGsRSTjcRc4VIsZdjrxJ%2FScreenshot%20(114).png?alt=media&amp;token=96ff7028-82ce-4989-870a-6629d68de757" alt=""><figcaption></figcaption></figure>


---

# 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/zh/cha-jian-yu-ji-cheng/web-plugins/narrative-design-guide.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.
