Documentation menu

Format reference

Text references

Any text can show another resource’s text with {{ Kind.id.field }}. The field defaults to name.

OSF.osf source
scene.osf
Dialogue scene {
  Node node_01 {
    title: "{{ Character.stranger }}"
    text: "{{ Character.stranger }} steps out of {{ Document.old_lighthouse }}. Gold: {{ Variable.gold }}"
    next: node_02
  }

  Node node_02 {
    text: "Literal braces: \{{ not a reference }}"
  }
}
scene.yaml
apiVersion: dialogue/v1
kind: Dialogue
data:
  id: scene
  startNode: node_01
  nodes:
    node_01:
      next: node_02
      content:
        title: '{{ Character.stranger }}'
        text: '{{ Character.stranger }} steps out of {{ Document.old_lighthouse }}. Gold: {{ Variable.gold }}'
    node_02:
      content:
        text: 'Literal braces: \{{ not a reference }}'
KindFields
Storyname, description
Charactername, description
Documentname
Dialoguename (a dialogue without a name shows its id)
Variablenone: {{ Variable.<id> }} shows the variable’s current value
  • References stay as written in the resources. They are replaced when the text is shown, by osf play, the editor’s Play panel or your game.
  • Story, Character, Document and Dialogue references show that resource’s text in the same locale, so a Russian build shows the Russian name. Variable references show the current value. Inserted text is used as it is: references inside it are not replaced again.
  • A reference to something that does not exist is OSF120; a field the kind does not have, or any field on a Variable, is OSF121.
  • \{{ writes literal braces; it is shown as {{.
  • A translation must contain the same references as its source, fields included, in any order, so word order can change but no reference is lost (OSF306).

The dialogue player shows one way to fill them in. {{ }} is used because translation tools such as Crowdin, Lokalise and Weblate already protect it from being edited.