forked from entropia/tip-toi-reveng
-
Notifications
You must be signed in to change notification settings - Fork 0
/
example.yaml
52 lines (44 loc) · 1.79 KB
/
example.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
# This is an example source file for a TipToi file
# The basic format is YAML
# You can compile this running
# ./tttool assemble example.yaml example.gme
# The product ID must match that of the book you want to use this with
product-id: 42
# The media path is optional
# The default is "%s", i.e. to look in the current directory
# If you use "example/Buch1_%s", here then P(test) will use
# the file "example/Buch1_test.ogg".
# Ogg files should be Mono, 22050 Hz.
# tttool will append .wav or .ogg and uses whatever it finds
media-path: "example/%s"
# The comment does not really matter
comment: An example GME file
# Register initalisation. This is simply list of set-commands.
# Every register not set is initialized to 0
init: $mode:=1
# The sounds to play on start-up
welcome: bing, hello
# This is the interesting part: Scripts.
# Technically, this is an assoiative list with the OID as an index,
# and a list of strings as the content
scripts:
# We begin to specify what to do when the area in the book with the OID code
# 8065 is touched. Here we just print something
8065: P(hello)
# The next one is more complicated, as we have conditional scripts
8066:
# The following line means: If register $mode is set to 1, then set it to 2, and
# increment register $1 by one, and play the sound example/hello.ogg.
- $mode==1? $mode:=2 $1+=1 P(hello)
# Here, the pen is going to play one of these three sounds randomly.
- $mode==2? $mode+=1 P(one,two,three)
- $mode==3? $mode:=1 P(back)
# You can either refer to a concrete register ($1), or a named register.
# tttool will map these to otherwise unused registers.
8067:
- $1==0?
- $1==1? P(one)
- $1==2? P(two)
- $1==3? P(three)
# Besides == and !=, there are also the comparisons < and >=
- $1!=1? $1 != 2? $1 != 3? $1:=0 P(back)