Documentation menu

Format reference

Content

Content is what a node or option shows: text, and on nodes an optional speaker and title. In .osf they are fields on the node; in YAML and JSON they sit under content, which belongs to exactly one node or option.

Text

OSF.osf source
scene.osf
Dialogue scene {

  Node node_01 {
    text: "Hello!"
  }
}
scene.yaml
apiVersion: dialogue/v1
kind: Dialogue
data:
  id: scene
  startNode: node_01
  nodes:
    node_01:
      content:
        text: Hello!

Result should be

Hello!

Speaker and text

OSF.osf source
scene.osf
Dialogue scene {

  Node node_01 {
    speaker: kael
    text: "Hello!"
  }
}
scene.yaml
apiVersion: dialogue/v1
kind: Dialogue
data:
  id: scene
  startNode: node_01
  nodes:
    node_01:
      content:
        speaker: Character.kael
        text: Hello!

Result should be

Character kael is named "Kael":

Kael:
Hello!

Speaker with a custom title and text

OSF.osf source
scene.osf
Dialogue scene {

  Node node_01 {
    speaker: kael
    title: "Voice from behind"
    text: "Hello!"
  }
}
scene.yaml
apiVersion: dialogue/v1
kind: Dialogue
data:
  id: scene
  startNode: node_01
  nodes:
    node_01:
      content:
        speaker: Character.kael
        title: Voice from behind
        text: Hello!

Result should be

The title replaces the character’s name:

Voice from behind:
Hello!

Long text

""" text can span lines and be indented to match the code around it: the common indentation is removed, and a line starting with // is a writer’s note that is left out. Like a YAML | block, the text ends with a line break.

OSF.osf source
scene.osf
Dialogue scene {

  Node node_03 {
    speaker: protagonist
    text: """
      What is it all about?
      // writer's note: this line is removed from the text
      Am I dreaming?
    """
  }
}
scene.yaml
apiVersion: dialogue/v1
kind: Dialogue
data:
  id: scene
  startNode: node_03
  nodes:
    node_03:
      content:
        speaker: Character.protagonist
        text: |
          What is it all about?
          Am I dreaming?

Result should be

You:
What is it all about?
Am I dreaming?