> 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 组件**中的 **动作**.

## 先从清晰的动作名称开始

将动作名称和示例值一起阅读。结果应该容易理解。

| 动作名称   | 参数            | 示例值    | 一起阅读        |
| ------ | ------------- | ------ | ----------- |
| `移动到`  | `Destination` | `装卸区`  | `移动到装卸区`    |
| `检查`   | `对象`          | `控制面板` | `检查控制面板`    |
| `装备`   | `物品`          | `青铜盾`  | `装备青铜盾`     |
| `设置难度` | `难度`          | `困难`   | `设置难度 困难`   |
| `传递消息` | `Message`     | `桥上见我` | `传递消息 桥上见我` |
| `放下桥`  | 无             | 无      | `放下桥`       |

参数本身就可以解释该值是什么。例如， `检查` 可以有一个 `对象` 参数。你不必把该动作命名为 `检查物体` ，除非这样对你的项目来说更清晰。

两种版本都可以。请选择你和你的团队最容易阅读的那一种。

## 使用你觉得有意义的参数名称

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

* `Destination` 告诉 `移动到` 要去哪里。
* `物品` 告诉 `装备` 要装备什么。
* `Message` 告诉 `传递消息` 要传递什么。

`值` 也是一个有效的名称。更具体的名称可以让你的设置更易读，但这不是必需的。

## 添加简短说明

有用的说明会回答该动作最重要的问题：

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

在说明中给出一个完整示例也会很有帮助。

### 前往某处

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

**参数：** `Destination`

> 当用户要求角色去某个地方时使用此动作。它会把角色移动到那个地点。包含目的地。示例：移动到装卸区。

{% hint style="info" %}
请注意，我们把“示例：移动到装卸区”作为一个示例加入了说明中。
{% endhint %}

### 检查某物

**名称：** `检查`

**参数：** `对象`

> 当用户要求角色检查某物时使用此动作。它会在游戏中开始检查。包含物体。示例：检查控制面板。

### 传递一条消息

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

**参数：** `Message`

> 当用户要求角色传递一条消息时使用此动作。它会在游戏中发送该消息。即使角色也会口头回应，也要使用它。包含完整消息。示例：传递消息 桥上见我。

### 从固定列表中选择

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

**参数：** `难度`

> 当用户要求更改难度时使用此动作。包含所请求的难度。示例：设置难度 困难。

这些示例展示了这种模式。请描述你自己的动作实际上做什么。

## 选择值的输入方式

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

使用 **字符串** 当动作应接受不带固定列表的文本时使用。

例如，难度动作可以使用 Choices，例如 `简单`, `普通`，以及 `困难`。消息动作可以使用 String，因为每次的消息都可能不同。

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

## 保持措辞易于理解

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

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

## 测试不止一句话

先试试说明中的示例，然后再试几个自然的变体。

对于一个 `检查` 动作，你可以尝试：

* 直接：“检查控制面板。”
* 自然：“你能更仔细地看看那个控制面板吗？”
* 不应运行：“控制面板通常是做什么的？”

在新的会话中重复重要测试。一次成功尝试表明该设置可以工作；多次尝试则能显示它运行得有多稳定。

在启用许多类似动作之前，先单独测试该动作也会有所帮助。

## 如果某个动作没有运行

请检查这些项：

* 你正在测试的角色上是否已启用该动作？
* 动作名称是否与你的 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.
