Format reference
Links
OSF has no separate link resource. Connections are fields on the thing they start from:
| From | To | Field |
|---|---|---|
| Story | its first Dialogue | start: Dialogue.<id> |
| Dialogue | its first Node | start <node> in .osf, startNode in YAML and JSON |
| Node or Option | a Node in the same dialogue | next: <node> |
| Node or Option | another Dialogue, at its start node | next: Dialogue.<id> |
| Node or Option | the options of a node in the same dialogue, without its line or set | next: <node>.options |
| Node or Option | the first target whose conditions are met | next: <target> requires { ... }, repeated; next as a list of { to, requires } in YAML and JSON |
Schema
OSF.osf source
story.osf
Story demo {
name = "Demo"
start = Dialogue.intro // story -> first dialogue
}intro.osf
Dialogue intro {
start node_01 // dialogue -> first node (the first node is the default)
Node node_01 {
text: "Knock knock."
next: node_02 // node -> node
}
Node node_02 {
text: "Who's there?"
Option door {
text: "Open the door."
next: node_03 // option -> node
}
Option leave {
text: "Walk away."
next: Dialogue.outside // option -> another dialogue
}
}
Node node_03 {
text: "Nobody."
next: Dialogue.outside // node -> another dialogue
}
}written by
osf convertstory.yaml
apiVersion: story/v1
kind: Story
data:
id: demo
name: Demo
start: Dialogue.intro # story -> first dialogueintro.yaml
apiVersion: dialogue/v1
kind: Dialogue
data:
id: intro
startNode: node_01
nodes:
node_01:
next: node_02 # node -> node
content:
text: Knock knock.
node_02:
content:
text: Who's there?
options:
door:
next: node_03 # option -> node
content:
text: Open the door.
leave:
next: Dialogue.outside # option -> another dialogue
content:
text: Walk away.
node_03:
next: Dialogue.outside # node -> another dialogue
content:
text: Nobody.osf validate reports a next, start or startNode that points at something missing as an error (OSF111, OSF113, OSF114, OSF115), a branch without requires that is not the last one as OSF125, <node>.options on a node without options as OSF128, and a node that no link reaches as warning OSF900.