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> |
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
Node node_01 {
next: node_02 // node -> node
text: "Knock knock."
}
Node node_02 {
text: "Who's there?"
Option door {
next: node_03 // option -> node
text: "Open the door."
}
Option leave {
next: Dialogue.outside // option -> another dialogue
text: "Walk away."
}
}
Node node_03 {
next: Dialogue.outside // node -> another dialogue
text: "Nobody."
}
}compiled by
osf buildstory.yaml
apiVersion: story/v1
kind: Story
data:
id: demo
name: Demo
start: Dialogue.introintro.yaml
apiVersion: dialogue/v1
kind: Dialogue
data:
id: intro
startNode: node_01
nodes:
node_01:
next: node_02
content:
text: Knock knock.
node_02:
content:
text: Who's there?
options:
door:
next: node_03
content:
text: Open the door.
leave:
next: Dialogue.outside
content:
text: Walk away.
node_03:
next: Dialogue.outside
content:
text: Nobody.osf validate reports a next, start or startNode that points at something missing as an error, and a node that no link reaches as a warning.