Skip to content

Commit d071eb7

Browse files
Better timeline syntax docs (#62)
1 parent b991d1c commit d071eb7

File tree

2 files changed

+101
-64
lines changed

2 files changed

+101
-64
lines changed

documentation/timeline-text-syntax.md

Lines changed: 81 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,12 @@
22
     <div class="header-label dawn">Timeline Text Syntax</div>
33
</div>
44

5-
Timelines are saved in a text format, which means that you can use any text-editing software to edit and create them. The built-in text editor provides useful autocompletion and syntax highlighting.
5+
*Timelines are saved in a text format, which means that you can use any text-editing software to edit and create them. The built-in text editor provides useful autocompletion and syntax highlighting.*
66

7-
```admonish info
8-
For Dialogic to register your timeline file, it has to use the `.dtl` extension!
9-
```
7+
*For Dialogic to register your timeline file, it has to use the `.dtl` extension!*
108

119
## 📜 Content
10+
1211
[toc]
1312

1413
## About short code events
@@ -27,52 +26,98 @@ To find all the parameters you can use on each event, check out their documentat
2726

2827
Some events have a custom syntax to make writing them easier. This includes:
2928

30-
- Character event:
29+
### Text Event
3130

32-
  - `join Emilio (happy) 3 [animation="Bounce In"]`
33-
  - `leave Emilio [animation="Bounce Out" length="0.3"]`
34-
  - `update Emilio (excited) 4 [animation="Tada" wait="true" repeat="3" move_time="0.3"]`
31+
```dtl
32+
A wonderful text event, said by noone in particular.
3533
36-
- Text event: 
34+
Emilio: Hello and welcome!
3735
38-
  - `A wonderful text event, said by noone in particular.`
39-
  - `Emilio (excited): Hello and welcome!`
40-
  - Ending a text event with `\` will make it include the next line as well.
36+
Emilio (excited): I'm excited cann you tell?
37+
38+
Emilio: This is a text event with \
39+
multiple lines. Isn't that great? It is!
40+
```
41+
42+
Ending a text event with `\` will make it include the next line as well.
43+
44+
### Character event
45+
46+
```dtl
47+
join Emilio (happy) center [animation="Bounce In"]
4148
42-
- Choice event:
49+
leave Emilio [animation="Bounce Out" length="0.3"]
4350
44-
  - `- I don't know about that`
45-
  - `- Yes [if {John.Relationship} > 23]`
46-
  - `- Sure, I'm the great wizard [if {Stats.Charisma} > 10] [else="disable" alt_text="I'm the great wizard [to insecure]"]`
51+
update Emilio (excited) left [animation="Tada" wait="true" repeat="3" move_time="0.3"]
52+
```
4753

48-
- Condition event:
54+
*Check the [Character Event](./event-character.md) documentation for more information and examples.*
4955

50-
  - `if {Player.Wisdom} > 3:`
51-
  - `elif {Player.Health} <= 10:`
52-
  - `else:`
56+
### Choice event
5357

54-
- Set Variable Event:
58+
```dtl
59+
- Yes
60+
- No | [if {John.Relationship} > 23]
61+
- Maybe | [if {Stats.Charisma} > 10] [else="disable" alt_text="Maybe [to insecure]"]
62+
```
5563

56-
  - `set {MyVariable} += 10`
57-
  - Supported Operators are =, += , -= , *=, /=
64+
### Condition event
5865

59-
- Comment event:
66+
```dtl
67+
if {Player.Wisdom} > 3:
68+
    # dialogics syntax is indentation based!
69+
elif {Player.Health} <= 10:
70+
    # some events
71+
else:
72+
    #...
73+
```
6074

61-
  - `# Todo: Finnish this!!!!`
75+
### Set Variable event
6276

63-
- Label event:
77+
```dtl
78+
set {MyVariable} += 10
79+
```
6480

65-
  - `label MyLabelName`
81+
Supported Operators are =, += , -= , *=, /=
6682

67-
- Jump event:
83+
### Comment event
6884

69-
  - `jump MyLabelName`
70-
  - `jump TimelineName/` # The slash is mandatory to clarify that this is a timeline, not a label.
71-
  - `jump TimelineName/LabelName`
85+
```dtl
86+
# Some comment
87+
```
7288

73-
- Return event:
89+
### Label event
7490

75-
  - `return`
91+
```dtl
92+
label LabelIdentifier
93+
94+
# a label with a display name
95+
label LabelIdentifier (Display Name)
96+
```
97+
98+
### Jump event
99+
100+
```dtl
101+
jump LabelIdentifier
102+
103+
# Jump to a label in another timeline
104+
jump TimelineName/LabelIdentifier
105+
106+
# Jump to the beginning of another timeline
107+
jump TimelineName/
108+
```
109+
110+
### Return event
111+
112+
```dtl
113+
return
114+
```
115+
116+
### Do/Call event
117+
118+
```dtl
119+
do Autoload.method("argument")
120+
```
76121

77122
## About indentation
78123

@@ -83,10 +128,10 @@ Timelines use TAB indentation to know what events belong to a choice or conditio
83128
```dtl
84129
[background path="res://assets/backgroudns/dialogic_factory.png"]
85130
86-
join Jowan 4
131+
join Jowan left
87132
jowan (exited): Hello and welcome to[portrait=confused]...[pause=0.5] Wait? What is this?
88133
89-
join Emilio (happy) 1
134+
join Emilio (happy) right
90135
Emilio: Well, this is is the example timeline.
91136
92137
Jowan: I thought this was a cool new feature?
@@ -103,7 +148,7 @@ Jowan (default): So what should this example be about?
103148
    Emilio (confused): Wait that hasn't to do with dialogic?!
104149
    jump WhatAbout
105150
106-
- How to reach the moon [if {Player.Name} == "NASA"]
151+
- How to reach the moon | [if {Player.Name} == "NASA"]
107152
    Jowan (angry): NASA! It's you again. This is for making dialogs!\
108153
    Please ask someone else about the moon!.
109154
    

theme/highlight.js

Lines changed: 20 additions & 28 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)