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, thespeakerwho says it, and an optionaltitlethat replaces the speaker’s name. - Options: the choices the player can pick from, if any.
- Flow: where the story goes next.
nexton the node, ornexton each option. - State: variables the node or option
sets, and the values an optionrequiresbefore 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."
}
}compiled by
osf buildscene.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.