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

# 动态上下文

动态上下文让 Convai 角色知道你关卡中当前正在发生什么——受训者的健康状况、当前区域、装备状态、警报以及叙事节拍。你通过 Blueprint 从 `Convai|DynamicContext` 节点族中的 `Convai 聊天机器人` 组件（`UConvaiChatbotComponent`).

当某个事实在游戏过程中发生变化，并且角色应该能够在对话中引用它时，请使用动态上下文。使用 `Set Context State` 用于可替换的当前条件（例如， `健康值` 为 `50`）。使用 `Add Context Event` 用于一次性时刻（例如， `第 4 区触发警报`).

<table data-view="cards"><thead><tr><th></th><th data-hidden data-card-target data-type="content-ref"></th></tr></thead><tbody><tr><td><strong>动态上下文的工作方式</strong><br>了解状态属性、事件、防抖批处理，以及角色何时可能响应。</td><td><a href="/pages/8ef7dcd046dad07f4afcb544f96d3beda6feb0ad">/pages/8ef7dcd046dad07f4afcb544f96d3beda6feb0ad</a></td></tr><tr><td><strong>动态上下文快速入门</strong><br>在 Blueprint 中推送你的第一个状态和事件，然后验证角色是否可以使用更新后的上下文。</td><td><a href="/pages/602e67296ec3ed2b843879adb48efa844ab06ec3">/pages/602e67296ec3ed2b843879adb48efa844ab06ec3</a></td></tr><tr><td><strong>连接时的静态上下文</strong><br>了解哪些数据在会话开始时是固定的，以及它与实时动态上下文有何不同。</td><td><a href="/pages/0761980ed92c19c95c0b88fe44d1ee3c9c409818">/pages/0761980ed92c19c95c0b88fe44d1ee3c9c409818</a></td></tr><tr><td><strong>同步行为和时序</strong><br>了解更新何时刷新、离线队列如何工作，以及何时使用立即刷新。</td><td><a href="/pages/752c51862623321d86861772e63c55db752c58da">/pages/752c51862623321d86861772e63c55db752c58da</a></td></tr><tr><td><strong>动态上下文 Blueprint 参考</strong><br>适用于每个 `Convai|DynamicContext` 节点、属性、枚举和传输字段的参考。</td><td><a href="/pages/a80705d8480f2f63dc8b84ea2e437c9dac45b7c5">/pages/a80705d8480f2f63dc8b84ea2e437c9dac45b7c5</a></td></tr><tr><td><strong>动态上下文使用示例</strong><br>用于健康追踪、区域变化、叙事事件和会话重置的 Blueprint 示例。</td><td><a href="/pages/4c32f5b1e84d192a1af40b32548e3cf5f7f90478">/pages/4c32f5b1e84d192a1af40b32548e3cf5f7f90478</a></td></tr><tr><td><strong>动态上下文故障排查</strong><br>修复到达过晚、触发意外响应或在刷新后看似被忽略的更新。</td><td><a href="/pages/b420c88b0fe545f2bdf932b279270d9c5974103c">/pages/b420c88b0fe545f2bdf932b279270d9c5974103c</a></td></tr></tbody></table>

### 推荐阅读顺序

1. [动态上下文的工作方式](/api-docs/zh/cha-jian-yu-ji-cheng/convai-unreal-engine-plugin/features/dynamic-context/how-dynamic-context-works.md) — 了解状态和事件模型。
2. [动态上下文快速入门](/api-docs/zh/cha-jian-yu-ji-cheng/convai-unreal-engine-plugin/features/dynamic-context/dynamic-context-quick-start.md) — 推送并验证你的第一个更新。
3. [连接时的静态上下文](/api-docs/zh/cha-jian-yu-ji-cheng/convai-unreal-engine-plugin/features/dynamic-context/static-context-at-connection-time.md) — 将会话开始时的事实与实时更新区分开来。
4. [同步行为和时序](/api-docs/zh/cha-jian-yu-ji-cheng/convai-unreal-engine-plugin/features/dynamic-context/sync-behavior-and-timing.md) — 调整刷新、排队和立即同步行为。
5. 参考、示例和故障排除页面——当你需要精确的节点行为、应用模式或修复方案时使用。

{% content-ref url="/pages/8ef7dcd046dad07f4afcb544f96d3beda6feb0ad" %}
[动态上下文的工作方式](/api-docs/zh/cha-jian-yu-ji-cheng/convai-unreal-engine-plugin/features/dynamic-context/how-dynamic-context-works.md)
{% endcontent-ref %}

{% content-ref url="/pages/602e67296ec3ed2b843879adb48efa844ab06ec3" %}
[动态上下文快速入门](/api-docs/zh/cha-jian-yu-ji-cheng/convai-unreal-engine-plugin/features/dynamic-context/dynamic-context-quick-start.md)
{% endcontent-ref %}


---

# 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/convai-unreal-engine-plugin/features/dynamic-context.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.
