GRAAL script structure
A GRAAL adventures is based on a number of script
files, related to each other in the following way:
+-------------+
| graal.main |
+------+------+
|
+------------------+----------------+
| |
+----+-----+ +----+-----+
|n.section | . . . |n.section |
+----+-----+ +----+-----+
| |
+--------+--------+ +---------------+
| | | | |
+---+---++---+---++---+---+ +---+---+ +---+---+
|n.room ||n.room ||n.room | |n.room | |n.room |
+-------++-------++-------+ +-------+ +-------+
There is always a graal.main file, describing the
main characteristics of the game and of the main character (which is the
one the player controls and commands).
The entire adventure is divided into locations or
"rooms" as they are called in GRAAL. The specifics of each room is
defined in a n.room file
The rooms may be grouped into sections, as shown above. Each section has
a n.section file.
The general idea is that if a player can issue a
certain command or do a certain thing in just one specific room, the
GRAAL code to handle that action should be placed in the corresponding
.room script file. If the action can occur anywhere in the section ,
the code is placed in the .section file; and if the action is something
that can occur anywhere in the adventure, it is taken care of in the
graal.main file.
Whenever the player inputs a command, first the current
room file is scanned for appropriate action, then the section file,
and lastly the graal.main file. This is why the graal.main file should
always contain general "safety nets" to handle most of the totally
off-the-wall and generally stupid things a player may try during the
game!
Apart from the three script file types above, there are two other
types with specific purposes:
files, containing the commands making up an
animated, non-interactive "cut-scene".
files, containing animation patterns too big and complex to
fit into the code of a script file.