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>
Node or Optionthe options of a node in the same dialogue, without its line or setnext: <node>.options
Node or Optionthe first target whose conditions are metnext: <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
  }
}
story.yaml
apiVersion: story/v1
kind: Story
data:
  id: demo
  name: Demo
  start: Dialogue.intro # story -> first dialogue
intro.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.