> 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/convai-unreal-engine-plugin/features/character-actions/writing-clear-action-names-and-descriptions.md).

# 编写清晰的动作名称和描述

用于命名、描述和测试角色动作的简单示例。

操作可让你的角色在项目中执行各种行为，例如移动到某处、检查物体、装备物品或更改设置。

你可以在 **Convai Chatbot Component**中的 **Actions**.

## 从清晰易懂的操作名称开始

把操作名称和示例值放在一起读，组合起来应该容易理解。

| 操作名称   | 参数        | 示例值     | 组合起来读        |
| ------ | --------- | ------- | ------------ |
| `移动到`  | `目的地`     | `装卸区`   | `移动到装卸区`     |
| `检查`   | `物体`      | `控制面板`  | `检查控制面板`     |
| `装备`   | `物品`      | `青铜盾牌`  | `装备青铜盾牌`     |
| `设置难度` | `难度`      | `困难`    | `设置难度：困难`    |
| `发送消息` | `Message` | `在桥边等我` | `发送消息：在桥边等我` |
| `放下桥`  | 无         | 无       | `放下桥`        |

参数本身就可以说明值的含义。例如， `检查` 可以有一个名为 `物体` 的参数。你不必把操作命名为 `检查物体` 除非这样对你的项目来说更清楚。

这两种写法都可行。选择你和团队读起来最容易理解的那一种。

## 使用对你来说有意义的参数名称

参数是操作所需的额外信息。例如：

* `目的地` 告诉 `移动到` 要去哪里。
* `物品` 告诉 `装备` 要装备什么。
* `消息` 告诉 `递送消息` 要递送的内容。

`值` 也是有效名称。使用更具体的名称可以让你的设置更易于理解，但这并非必需。

## 添加简短说明

有用的说明应回答与该操作相关的重要问题：

* 角色应在什么时候使用它？
* 运行时会发生什么？
* 角色应包含哪些信息？

在说明中加入完整示例也会有所帮助。

### 移动到某处

**名称：** `移动到`

**参数：** `目的地`

> 当用户要求角色前往某处时，使用此操作。它会将角色移动到该地点。请注明目的地。示例：移动到装货区。

{% hint style="info" %}
请注意，我们在说明中添加了“示例：移动到装货区”。
{% endhint %}

### 检查某物

**名称：** `检查`

**参数：** `对象`

> 当用户要求角色检查某物时，使用此操作。它会在游戏中开始检查。请注明对象。示例：检查控制面板。

### 递送一条消息

**名称：** `递送消息`

**参数：** `消息`

> 当用户要求角色递送消息时，使用此操作。它会通过游戏发送消息。即使角色也会大声回复，仍应使用此操作。请包含完整消息。示例：递送消息：桥边见。

### 从固定列表中选择

**名称：** `设置难度`

**参数：** `难度`

> 当用户要求更改难度时，使用此操作。请注明所需难度。示例：设置难度为 Hard。

这些示例展示了基本模式。请描述你自己的操作实际会做什么。

## 选择值的输入方式

当你想提供可选值列表时，使用 **选项** 。

当操作应接受不受固定列表限制的文本时，使用 **字符串** 。

例如，难度操作可以使用如下选项： `简单`, `普通`和 `困难`。消息操作可以使用字符串，因为每次的消息内容都可能不同。

请选择适合你项目的选项。两种选项都不是通用的准确度设置。

## 措辞要易于理解

操作可以使用西班牙语、英语或其他语言。尽可能让操作名称、参数和说明使用同一种语言，这样人们更容易阅读设置内容。

如果角色支持多种语言，请用你计划使用的每种语言测试操作。

## 测试不止一个句子

先试试说明中的示例，再试几种自然的说法。

对于 `Inspect` 操作，可以试试：

* 直接说法：“检查控制面板。”
* 自然说法：“你能仔细看看那个控制面板吗？”
* 不应触发操作：“控制面板通常有什么用？”

在新的会话中重复重要测试。一次成功说明设置可以生效；多次尝试则能说明它的运行是否稳定。

在启用多个相似操作之前，单独测试该操作也会有所帮助。

## 如果操作没有运行

请检查以下项目：

* 你正在测试的角色是否已启用该操作？
* 操作名称是否与 Blueprint 中使用的事件一致？
* 参数名称是否与 Blueprint 预期的一致？
* 说明是否清楚指出了何时使用该操作？
* 说明是否写明了需要包含哪些信息？
* 如果使用 Choices，该值是否在列表中？
* 仅启用该操作时，它是否能正常工作？

还要检查 Unreal 收到了什么：

* 没有收到操作。
* 收到了操作，但缺少一个值。
* 收到了操作和值，但游戏没有使用它们。

弄清楚发生了哪种情况，能让你更轻松地进行下一步检查。


---

# 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/convai-unreal-engine-plugin/features/character-actions/writing-clear-action-names-and-descriptions.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.
