GRAAL Syntax
Script Syntax
Scripts can normally contain empty lines, comment lines, and statement
lines. (Exceptions are the .scene files, which only contain commands,
and .ptrn files, which only contain animation patterns.)
Comment lines always begin with the characters /*.
Statement lines always begin with the statement followed by a colon and
one blank space. After that comes the parameters separated by
semicolons, but without spaces in between, like this:
STATEMENT: parameter;parameter;parameter;...;parameter
In the following statements, each parameter is a condition or command:
ACTION - Actions taken for player input
DACT - Actions executed when entering a new room
LACT - Actions taken when player chooses a dialogue line
Each condition and command then has its own "internal" syntax. Usually,
parameters within a command are separated by colons (,).
Some statements and command allow you to leave parameter positions
"blank" to retain a previous value or set a default value. "blank" does
not mean "empty": You MUST enter a blank space in the position! For
example, if you wish to leave the two middle parameters of the SHOW
command empty, this is the way to do it:
SHOW 2, , ,4
(This example tells GRAAL to use image number 4 to display object 2, but
let the image remain in its old place, since we left the x and y
parameters blank.)
Command and Statement Notation
UPPERCASE
Type as written.
lowercase
Replace with value of specified type.
list
A list of values separated with | characters may be used. In conditions,
any value in the list will make the condition TRUE. In commands, one of
the alternatives in the list will be chosen at random each time the
command is encountered during gameplay.
option1|option2
One of the options can be chosen.
[parameter,]
This parameter is optional.
Referring to the Contents of the Input Sentence
When the scripts are searched for commands to execute, what happens is
based entirely on how the current input sentence from the player looks.
IN this reference, the first object in the current command sentence
input by the player is referred to as OBJ1, and the second - if any - as
OBJ2. The "command" itself is referred to as the VERB.
Referring to Objects and Images
An object number can be an ordinary number (n), a room object number
(ROBJn) or a section object number (SOBJn).
An image number can be an ordinary global image (n), a room image
(RIMGn) or a section image (SIMGn).