forked from entropia/tip-toi-reveng
-
Notifications
You must be signed in to change notification settings - Fork 0
/
example.yaml
50 lines (42 loc) · 1.67 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
# 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
# 8066 is touched.
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)