- name
SKILL.md
技能文件保留在发布者的仓库中。
在终端中粘贴复制的命令。它会把这个 SKILL.md 安装到对应的智能体中。
npx skills add gamedev-skills/awesome-gamedev-agent-skills --skill dialogue-systems -a cursor -y在终端中粘贴复制的命令。它会把这个 SKILL.md 安装到对应的智能体中。
npx skills add gamedev-skills/awesome-gamedev-agent-skills --skill dialogue-systems -a claude-code -y在终端中粘贴复制的命令。它会把这个 SKILL.md 安装到对应的智能体中。
npx skills add gamedev-skills/awesome-gamedev-agent-skills --skill dialogue-systems -a codex -y在终端中粘贴复制的命令。它会把这个 SKILL.md 安装到对应的智能体中。
npx skills add gamedev-skills/awesome-gamedev-agent-skills --skill dialogue-systems -a grok -y在 Grok Bot 聊天中发送复制的消息。Bot 会从 GitHub 获取这个 SKILL.md,并添加到你所有 Bot 共享的技能中。
Install this skill: https://github.com/gamedev-skills/awesome-gamedev-agent-skills/tree/HEAD/skills/disciplines/dialogue-systems来自发布者
Model conversations as a graph: nodes hold lines, choices branch, conditions gate options and a variable store remembers what the player did. The first decision is build or adopt: Ink or Yarn Spinner when writers need real flow control, a small data-driven runner when lines, choices and flags are enough. Never build a new scripting language.
Not this skill: VN presentation and flow (visual-novel), quest logic (rpg), widget
code (godot-ui-control, roblox-ui) and UI layout rules (game-ui-ux), persisting variables
across sessions (save-systems).
.ink/.yarn/.yarnproject files, an installed
integration (ink-unity-integration, inkjs, Yarn Spinner for Unity or Godot), or a JSON graph.
Keep what exists.<<commands>> dispatched to game code, built-in
line IDs for localization; best for game-driven dialogue with many engine hooks.inklecate -o story.json story.ink exits 1 on compile errors.ysc compile story.yarn reports errors; ysc run --auto-advance story.yarn plays it
in the terminal.validate_graph() from references/runner.md; it must return no
problems (missing targets, nodes without an exit, undeclared variables, unreachable nodes).{
"start": "guard_intro",
"vars": { "gold": 0, "gate_open": false },
"nodes": {
"guard_intro": {
"speaker": "Guard", "line": "DLG_GUARD_001",
"choices": [
{ "text": "DLG_OPT_BRIBE", "to": "bribe", "if": "gold >= 50",
"set": { "gold": "gold - 50" } },
{ "text": "DLG_OPT_LEAVE", "to": "end" }
]
},
"bribe": {
"speaker": "Guard", "line": "DLG_GUARD_BRIBED",
"set": { "gate_open": true },
"next": "end"
},
"end": { "end": true }
}
}
line/text are string-table IDs (localization), not literal text. if
gates a choice; set mutates the variable store. The gold cost sits on the
choice, so it is paid once per pick even if the bribe node is revisited; the
idempotent gate_open write can live on the node. A string set value is an
expression, so a literal string needs inner quotes: "mood": "'angry'". The full
interpreter that walks this graph is in references/runner.md. Its variable store
starts from vars; replace those defaults with the player's saved narrative state
when starting a real conversation. Declare every referenced variable so unknown
names still expose authoring mistakes.
# Godot 4.7. The runner holds the current node and a variable store. Every line
# waits for the player: the UI calls choose() or the continue callback.
func goto(id: String) -> void:
current = graph.nodes[id]
apply_set(current.get("set", {}))
if current.get("end", false):
ui.close()
return
if current.has("line"):
ui.show_line(current.get("speaker", ""), localize(current.line))
if current.has("choices"):
var shown = current.choices.filter(func(c): return eval_cond(c.get("if", "")))
ui.show_choices(shown) # only choices whose condition passes
elif current.has("next"):
var next_id: String = current.next
ui.show_continue(func(): goto(next_id)) # advance when the player continues
func choose(choice: Dictionary) -> void: # called when the player picks a choice
apply_set(choice.get("set", {})) # write on the transition (revisit-safe)
goto(choice.to)
// Ink: '*' = once-only choice, '+' = sticky. [bracketed] text shows only in the
// choice, not the printed result. '->' diverts; '-> END' stops the flow.
VAR gold = 60
-> guard_intro // the story starts at the top: divert into a knot
=== guard_intro ===
The guard blocks the gate.
* {gold >= 50} [Offer 50 gold] "Here, take it."
~ gold = gold - 50
The guard pockets it and steps aside. -> END
* [Leave] You turn back. -> END
Ink tracks how often each knot was seen, so {visited_knot} is a built-in
condition. Variables are global (VAR) or temporary (~ temp).
title: GuardIntro
---
<<declare $gold = 60>>
<<declare $gate_open = false>>
Guard: You can't pass.
-> Offer 50 gold <<if $gold >= 50>>
<<set $gold = $gold - 50>>
Guard: ...fine. Go on through.
<<set $gate_open to true>>
-> Leave
Guard: Good choice.
===
Yarn lines may start with Speaker:; options use ->; <<set>>/<<declare>>
manage $variables; <<if>> gates an option; <<jump NodeName>> moves between
nodes. Interpolate values in text with {$gold}. Declare every variable before first
use: an undeclared one still compiles (Yarn infers its type and a zero/false/empty
start value) with only a warning, which hides typos. These constructs are unchanged from
Yarn Spinner 2.x.
#line: IDs (ysc tag adds them); Ink has no line IDs, so tag lines
yourself (#id:guard_01) or translate whole files.gold - 50 on bribe) is paid again on every visit. Put it
on the choice, or guard it with a seen-flag.* versus +. * choices vanish after one use, so a looping hub menu built from *
empties itself. Hub menus use sticky +.[brackets] shows only in the
choice; text before them shows in both; text after only in the output.ChooseChoiceIndex(i) call Continue() (or
ContinueMaximally()) again; the chosen branch prints nothing until you do.<<declare>> everything.<<once>>, <<detour>>, when: node groups) fails
with "requires version 3 or later". Check the .yarnproject language version..ink as an InkFile asset; code that loaded the old
generated .json TextAsset must switch to new Story(inkFile.storyJson).eval() on dialogue expressions runs arbitrary code from data files and mods. Use a
whitelisting evaluator (the runner's evaluate).references/ink-and-yarn.md: read when writing or reviewing .ink or .yarn (side-by-side
syntax, Ink weave features, Yarn 3 additions, runtime integration and localization).references/runner.md: read when building or fixing a custom runner (schema, sandboxed
evaluate, DialogueRunner, localization lookup, validate_graph).save-systems: persist narrative variables and seen-flags.godot-resources, unity-scriptableobjects: store dialogue as engine data.godot-ui-control, game-ui-ux: text boxes, portraits and choice buttons.visual-novel, rpg: genres that compose this skill.Last verified: 2026-11-11.
inklecate exits with code
1 on compile errors and defaults its output to <name>.ink.json
(https://github.com/inkle/ink/releases, inklecate CommandLineTool.cs).ysc
3.2.2 with compile, run, tag and extract
(https://github.com/YarnSpinnerTool/YarnSpinner-Console).>
---name: dialogue-systemsdescription: >---# skills/disciplines/dialogue-systems/SKILL.md常见问题
从发布者处下载 skills/disciplines/dialogue-systems/SKILL.md,或复制路径后打开仓库。PlugMCP 只收录该技能,不托管文件。
发布者将它存放在 https://github.com/gamedev-skills/awesome-gamedev-agent-skills。
Claude、Cursor、Codex 和 Grok Build 可以读取你从发布者仓库添加的 SKILL.md。在聊天中发送技能的 GitHub 文件夹链接,Grok Bot 就会安装它。