Documentation menu

Format reference

Node

A node is one line of a dialogue. Node ids are unique within their dialogue. A node has next or options, never both; a node with neither ends the dialogue.

Node that ends the dialogue

OSF.osf source
scene.osf
Dialogue scene {

  Node goodbye {
    speaker: stranger
    text: "Goodbye."      // no next and no options: the dialogue ends here
  }
}
scene.yaml
apiVersion: dialogue/v1
kind: Dialogue
data:
  id: scene
  startNode: goodbye
  nodes:
    goodbye:
      content:
        speaker: Character.stranger
        text: Goodbye.

Node that is linked to the next node

OSF.osf source
scene.osf
Dialogue scene {

  Node node_01 {
    next: node_02
    speaker: protagonist
    text: "Where am I?"
  }

  Node node_02 {
    text: "Total Darkness surrounds you."   // no speaker: narration
  }
}
scene.yaml
apiVersion: dialogue/v1
kind: Dialogue
data:
  id: scene
  startNode: node_01
  nodes:
    node_01:
      next: node_02
      content:
        speaker: Character.protagonist
        text: Where am I?
    node_02:
      content:
        text: Total Darkness surrounds you.

Node with options

OSF.osf source
scene.osf
Dialogue scene {

  Node node_01 {
    speaker: stranger
    text: "How are you?"

    Option fine {
      next: node_02
      text: "Fine, thanks."
    }

    Option bye {
      text: "Bye"
    }
  }

  Node node_02 {
    speaker: stranger
    text: "Good."
  }
}
scene.yaml
apiVersion: dialogue/v1
kind: Dialogue
data:
  id: scene
  startNode: node_01
  nodes:
    node_01:
      content:
        speaker: Character.stranger
        text: How are you?
      options:
        fine:
          next: node_02
          content:
            text: Fine, thanks.
        bye:
          content:
            text: Bye
    node_02:
      content:
        speaker: Character.stranger
        text: Good.

Node that sets variables on start

OSF.osf source
scene.osf
Dialogue scene {

  Node wake_up {
    set: { is_dreaming: false, gold: 23 }   // applied when the node starts
    text: "You wake up. Your purse feels lighter."
  }
}
scene.yaml
apiVersion: dialogue/v1
kind: Dialogue
data:
  id: scene
  startNode: wake_up
  nodes:
    wake_up:
      set:
        is_dreaming: false
        gold: 23
      content:
        text: You wake up. Your purse feels lighter.

Fields

.osfYAML / JSONValue
textcontent.textText. Required. See Content.
speakercontent.speakerCharacter id; Character.<id> in YAML and JSON. Omit for narration.
titlecontent.titleText: the shown speaker name, overriding the character’s.
nextnextA node id in this dialogue, or Dialogue.<id>. See Links.
setsetVariable values, applied when the node starts.
OptionoptionsA player choice, keyed by id. See Option.

set

A map of variable ids to values, applied when the node starts. Each value must match the variable’s type.