> 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/actions-guide/stage-2-custom-actions/simple-actions.md).

# 简单动作

本文档解释了如何向你的 Convai 角色添加简单动作。

向您的 Convai 角色添加简单动作的步骤：-

* 选择您的 Convai 角色并进入 Details 面板。在此界面中，找到 `Convai 信息` 部分。

<figure><img src="https://2402152281-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FEtUJA212Zc1S9ACc8T4l%2Fuploads%2Fu6K8ZvPJeIvYtPVi9ILB%2FConvaiInfo.jpg?alt=media&amp;token=6a02fc7a-5b8c-4642-a4d3-00ebce4fc24b" alt="" width="296"><figcaption><p>Outliner 中的 Convai Info 部分。</p></figcaption></figure>

* 选中 `添加元素` 图标 `(+)` 并输入您希望执行的所需动作。例如， `Print。`

<figure><img src="https://2402152281-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FEtUJA212Zc1S9ACc8T4l%2Fuploads%2F5G5Nx4aNzmgcuUZWAQPm%2Fimage.png?alt=media&amp;token=a32d4c8a-9be9-4a09-a41a-7be60608cd4f" alt="" width="291"><figcaption><p>自定义动作</p></figcaption></figure>

* 打开您刚刚添加该动作的角色蓝图。
* 添加一个同名的新事件。 `Print` 在这种情况下，并定义您刚刚命名的函数逻辑，然后运行该函数 `处理动作完成` 使用 `是否成功` 设为 true。<br>

  <figure><img src="https://2402152281-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FEtUJA212Zc1S9ACc8T4l%2Fuploads%2FMDf3l7pKZotUlQ5cEzJ0%2Fimage.png?alt=media&amp;token=64fa82bb-c9c4-41de-9b70-0f655c5aab47" alt=""><figcaption><p>Print 动作实现</p></figcaption></figure>
* 点击编译，并让您的 Convai 角色执行该动作。

<figure><img src="https://2402152281-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FEtUJA212Zc1S9ACc8T4l%2Fuploads%2FkaBDHaO1gdpE8Lo33pYq%2Fimage.png?alt=media&amp;token=462a4831-39b9-433e-a84a-d66387af1bb9" alt=""><figcaption><p>当被要求执行时，Convai 角色会打印。</p></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/unreal-engine/guides/actions-guide/stage-2-custom-actions/simple-actions.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.
