Documentation menu

Introduction

Concept

Dialogue node structure

A dialogue is a set of nodes. One node is one line of the story, and it contains:

  • Content: what is shown. The text, the speaker who says it, and an optional title that replaces the speaker’s name.
  • Options: the choices the player can pick from, if any.
  • Flow: where the story goes next. next on the node, or next on each option.
  • State: variables the node or option sets, and the values an option requires before it is shown.
OSF.osf source
scene.osf
Dialogue scene {

  Node ask {
    speaker: stranger                 // content: who speaks
    text: "Are you dreaming?"         // content: what is said
    set: { is_dreaming: true }        // state: set when the node starts

    Option say_yes {                      // option: a player choice
      next: answer                    // flow: where the choice leads
      text: "Yes."
    }

    Option say_no {
      requires: { is_dreaming: false }  // state: shown only when this matches
      text: "No."                       // no next: the dialogue ends
    }
  }

  Node answer {
    speaker: stranger
    text: "Then wake up."
  }
}
scene.yaml
apiVersion: dialogue/v1
kind: Dialogue
data:
  id: scene
  startNode: ask
  nodes:
    ask:
      set:
        is_dreaming: true
      content:
        speaker: Character.stranger
        text: Are you dreaming?
      options:
        say_yes:
          next: answer
          content:
            text: Yes.
        say_no:
          requires:
            is_dreaming: false
          content:
            text: No.
    answer:
      content:
        speaker: Character.stranger
        text: Then wake up.

In OSF terms these are the Node, Option, Content, Links and Variable pages of the format reference.

Scene context

Context such as the background, camera angle, music or animation is not part of OSF draft v1. See Metadata for where this stands.