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 {
next: node_02
title: "{{ Character.stranger }}"
text: "{{ Character.stranger }} steps out of the dark. Gold: {{ Variable.gold }}"
}
Node node_02 {
text: "Literal braces: \\{{ not a reference }}"
}
}compiled by
osf buildscene.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 the dark. Gold: {{ Variable.gold }}'
node_02:
content:
text: 'Literal braces: \{{ not a reference }}'- Character and Story references show that resource’s text in the same language, so a Russian build shows the Russian name.
- Variable references are kept for the game to fill in at runtime.
- A backslash before
{{writes literal braces. Inside an.osfstring the backslash itself is escaped, so it is written\\{{. - A translation must contain the same references as its source, in any order, so word order can change but no reference is lost.
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.