Documentation menu

Format reference

Links

OSF has no separate link resource. Connections are fields on the thing they start from:

FromToField
Storyits first Dialoguestart: Dialogue.<id>
Dialogueits first Nodestart <node> in .osf, startNode in YAML and JSON
Node or Optiona Node in the same dialoguenext: <node>
Node or Optionanother Dialogue, at its start nodenext: 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."
  }
}
story.yaml
apiVersion: story/v1
kind: Story
data:
  id: demo
  name: Demo
  start: Dialogue.intro
intro.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.