> 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/dynamic-environment-info.md).

# 动态环境信息

## 概述

动态环境信息是一项强大的功能，允许用户在无需直接交互的情况下向角色传递额外的环境数据。通过增强角色对周围环境的感知，这使得游戏场景更加沉浸和富有创意。

例如：

* 角色可以理解 **一天中的时间** （例如，“一天中的时间是夜晚”）。
* 角色可以访问 **物品栏详情** （例如，“你当前有一把枪和一瓶治疗药水”）。
* 该功能支持结构化数据格式，以实现更丰富的信息交换。

***

按照以下步骤将动态环境信息集成到你的项目中。

1. 打开 **角色蓝图** 在你的项目中。
2. 在 **开始游戏** 事件中，找到 `ConvaiChatbot` 组件。

<figure><img src="/files/3335ebddefb7666cc8e9b17a4ca269ab5bbe129d" alt=""><figcaption></figcaption></figure>

3. 将 `动态环境信息` 变量，并为其赋予任意字符串值。

* 示例 1（简单）：

  ```
  一天中的时间是夜晚
  ```

<div align="left"><figure><img src="/files/9375214a9dcc0bc96a2dc8caadb0ed6b4399483f" alt=""><figcaption></figcaption></figure></div>

* 示例 2（结构化格式）：

  ```
  物品栏：{武器：枪，工具：[手电筒，绳索]}
  ```

<div align="left"><figure><img src="/files/02db6d8b35a68a6264082b75a7ca215d3c07a8ba" alt=""><figcaption></figcaption></figure></div>

**保存并运行**

1. 保存你的蓝图更改。
2. 点击 **播放** 进行测试以检验交互。
3. 观察角色如何根据传入的信息动态响应。

<figure><img src="/files/ff7e42352a980a0ebca68cbecc3210d1b72ca97a" 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 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/dynamic-environment-info.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.
