forked from eriksvedang/Grimm
-
Notifications
You must be signed in to change notification settings - Fork 0
/
README
89 lines (69 loc) · 2.28 KB
/
README
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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
A Game Story Scripting Language written by Erik Svedäng.
Requires the Relay database to work. Contains Textmate and Notepad++ bundles for syntax highlighting.
- LANGUAGE OVERVIEW -
# 0. Comments start with a '#'
# 1. Make someone say something
Charlie "What time is it?"
# 2. Player is presented with dialogue options
CHOICE {
"It's 5.30":
Charlie "Ok, gotta run!"
"I don't know":
Charlie "Oh, thanks anyway"
}
# Choices can also be written without the CHOICE-word (deprected but saved for compatibility)
{
"Yes":
Charlie "OK"
"No":
Charlie "OK"
}
# 3. Jump to places marked with [ ] in the same file
GOTO SKIP_HERE
Charlie "I will not say this"
[SKIP_HERE]
Charlie "We meet again" [MEET_AGAIN]
# 4. Control the flow by checking expressions in the dialogue runner
IF Charlie.IsSleepy() {
Charlie "Yawn"
}
ELIF Charlie.IsHungry() {
Charlie "I want pizza..."
}
ELSE {
Charlie "Let's go party!"
}
# 5. Start other dialogue files
START AnotherWorldCinematic
# 6. Wait here until an expression becomes true (accepts strings, numbers and plain tokens)
WAIT Charlie.IsInRoom(Corridor)
# 7a. Register a block of code that will execute when an event happens
LISTEN DisasterousEvent {
START EverybodyScreams
}
# An event listener can be given a name for later reference, like this:
LISTEN DisasterousEvent DisasterEventListener {
START EverybodyScreams
}
# 7b. Wait here until an event is sent out
LISTEN BetterTimes
# 8. Send out an event
BROADCAST TimeForWork
# 9. Call a function in the dialogue runner (accepts strings, numbers and plain tokens)
Monkey.Eat(Banana, "Munch munch", 5.0)
# 10. Stop the execution of the script and unregister all listeners it contains
STOP
# Stopping another conversation works too
STOP AnotherConversation
# 11. Unregister event listeners with a specific name in the same file
CANCEL DisasterEventListener
# 12. Check an expression and throw and exception if it's not true
ASSERT EveryoneIsSane()
# 13. Start script X and stop execution of the current script until script X has stopped
INTERRUPT X
# Notes on syntactical sugar:
# Expressions and functions can be written in two ways
Player.TeleportTo(StartPosition)
# is the same thing as
TeleportTo(Player, StartPosition)
# Both of these ways of writing will send the same two arguments to the 'TeleportTo' function