Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit c766440

Browse files
committed
Enhance narrative editor functionality with improved error handling and validation mechanisms. Streamlined state management processes to ensure better runtime integrity and user experience.
1 parent 5052a05 commit c766440

1 file changed

Lines changed: 34 additions & 0 deletions

File tree

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# 叙事状态图策划使用规范
2+
3+
## 心智模型
4+
5+
- **Graph** 只描述单个叙事对象自己的状态机(NPC wrapper、任务 wrapper、主流程 flow 等)。
6+
- **Transition** 只在同一 Graph 内迁移:`from` / `to` 均为本图 `stateId`
7+
- 图与图之间通过 **external signal** 联动;某图进入状态时会自动广播 `external:state:<graphId>:<stateId>`(可用 `emitNarrativeSignal` 补发)。
8+
- 实体要拥有叙事状态,必须在叙事编辑器中绑定 **wrapperGraph**`ownerType` + `ownerId`)。
9+
10+
## 对话图节点
11+
12+
| 节点 | 用途 |
13+
|------|------|
14+
| **OwnerStateNode** | 按当前对话所属实体(NPC/Hotspot 等)的 wrapper `activeState` 分支;节点内不写 `graphId`|
15+
| **ContextStateNode** | 显式读取上层 **flow / scenario** 图状态;必须选择允许的 `graphId`,不能选 npc wrapper。 |
16+
| **switch + narrative 条件** | 仍可用于复杂条件;简单「读某图状态」优先用上述专用节点。 |
17+
18+
## 禁止事项
19+
20+
- 不要用 **setNarrativeState** 做普通剧情推进(仅调试/修复)。
21+
- 不要新建 **projectFlags**(已废弃)。
22+
- 不要在 Transition 上使用跨图 `{ graphId, stateId }` endpoint。
23+
24+
## 工作流建议
25+
26+
1. 在叙事 Composition 画布绑定 wrapper → 配置 states / transitions / signal。
27+
2. 在对话图入口或分支处放 OwnerStateNode,按 wrapper 状态接不同对白。
28+
3. 需要读主流程阶段时用 ContextStateNode 指向 `flow_*` 或 scenario 图。
29+
4. 剧情事件用 **emitNarrativeSignal**;响应方在 wrapper/flow 内用 Transition 监听。
30+
31+
## 编辑器
32+
33+
- **叙事状态 Web 编辑器**:真实迁移边 vs Projection 触发/读取/危险命令边。
34+
- **对话图 Qt 编辑器**:可创建 ownerState / contextState,Owner 状态列表可从 narrative 反查刷新。

0 commit comments

Comments
 (0)