> 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).

# 动态上下文

查找通过 Blueprint 节点向 Convai 角色推送实时状态和事件，并验证关卡中具备上下文感知响应的指南。

动态上下文让 Convai 角色了解关卡中此刻发生的事情——学员生命值、当前区域、装备状态、警报和剧情节点。你可以通过以下 Blueprint 节点推送更新： `Convai|DynamicContext` 节点系列，该系列位于 `Convai Chatbot` 组件（`UConvaiChatbotComponent`).

当某项事实在游戏过程中发生变化，而且角色应该能够在对话中提及它时，请使用动态上下文。对于可以被替换的当前状态（例如， `Set Context State` ），请使用此节点。例如， `Health` 为 `50`）。对于一次性事件（例如， `Add Context Event` ），请使用此节点。例如， `Alarm triggered in sector 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="https://docs.convai.com/api-docs/zh/cha-jian-yu-ji-cheng/convai-unreal-engine-plugin/features/dynamic-context/how-dynamic-context-works.md">动态上下文的工作原理</a></td></tr><tr><td><strong>动态上下文快速入门</strong><br>在 Blueprint 中推送首个状态和事件，然后验证角色能否使用更新后的上下文。</td><td><a href="https://docs.convai.com/api-docs/zh/cha-jian-yu-ji-cheng/convai-unreal-engine-plugin/features/dynamic-context/dynamic-context-quick-start.md">动态上下文快速开始</a></td></tr><tr><td><strong>连接时的静态上下文</strong><br>了解会话开始时固定的数据，以及它与实时动态上下文的区别。</td><td><a href="https://docs.convai.com/api-docs/zh/cha-jian-yu-ji-cheng/convai-unreal-engine-plugin/features/dynamic-context/static-context-at-connection-time.md">连接时的静态上下文</a></td></tr><tr><td><strong>同步行为与时序</strong><br>了解更新何时发送、离线排队如何运作，以及何时应立即发送。</td><td><a href="https://docs.convai.com/api-docs/zh/cha-jian-yu-ji-cheng/convai-unreal-engine-plugin/features/dynamic-context/sync-behavior-and-timing.md">同步行为与时序</a></td></tr><tr><td><strong>动态上下文 Blueprint 参考</strong><br>`Convai|DynamicContext` 中每个节点、属性、枚举和传输字段的参考。</td><td><a href="https://docs.convai.com/api-docs/zh/cha-jian-yu-ji-cheng/convai-unreal-engine-plugin/features/dynamic-context/dynamic-context-blueprint-reference.md">动态上下文 Blueprint 参考</a></td></tr><tr><td><strong>动态上下文用法示例</strong><br>用于跟踪生命值、区域变更、剧情事件和会话重置的 Blueprint 配方。</td><td><a href="https://docs.convai.com/api-docs/zh/cha-jian-yu-ji-cheng/convai-unreal-engine-plugin/features/dynamic-context/dynamic-context-usage-examples.md">动态上下文使用示例</a></td></tr><tr><td><strong>动态上下文故障排除</strong><br>修复更新到达过晚、意外触发响应，或刷新后似乎被忽略的问题。</td><td><a href="https://docs.convai.com/api-docs/zh/cha-jian-yu-ji-cheng/convai-unreal-engine-plugin/features/dynamic-context/troubleshoot-dynamic-context.md">排查动态上下文问题</a></td></tr></tbody></table>

### 推荐阅读顺序

1. [动态上下文的工作原理](https://docs.convai.com/api-docs/zh/cha-jian-yu-ji-cheng/convai-unreal-engine-plugin/features/dynamic-context/how-dynamic-context-works.md) ——了解状态和事件模型。
2. [动态上下文快速入门](https://docs.convai.com/api-docs/zh/cha-jian-yu-ji-cheng/convai-unreal-engine-plugin/features/dynamic-context/dynamic-context-quick-start.md) ——推送并验证首个更新。
3. [连接时的静态上下文](https://docs.convai.com/api-docs/zh/cha-jian-yu-ji-cheng/convai-unreal-engine-plugin/features/dynamic-context/static-context-at-connection-time.md) ——区分会话开始时的事实与实时更新。
4. [同步行为与时序](https://docs.convai.com/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" %}
[动态上下文的工作原理](https://docs.convai.com/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" %}
[动态上下文快速开始](https://docs.convai.com/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 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/dynamic-context.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.
