Difference between revisions of "Parallaction/Scripts"
Jump to navigation
Jump to search
(Added Zone and Animation.) |
m (behaviour -> behavior) |
||
(6 intermediate revisions by one other user not shown) | |||
Line 39: | Line 39: | ||
|} | |} | ||
<br>Zone block | <br> | ||
===Zone block=== | |||
{| border="1" cellpadding="2" width=100% | {| border="1" cellpadding="2" width=100% | ||
Line 46: | Line 48: | ||
|LABEL ||Text to be displayed when mouse enters the area defined by LIMITS. | |LABEL ||Text to be displayed when mouse enters the area defined by LIMITS. | ||
|- | |- | ||
|FLAGS ||One or more among | |FLAGS ||One or more among behavior [[Parallaction/Scripts/Zone flags|flags]], separated by pipe character. | ||
|- | |- | ||
|COMMANDS ||List of commands to be executed when zone is activated. | |COMMANDS ||List of commands to be executed when zone is activated. | ||
Line 52: | Line 54: | ||
|MOVETO ||Specifies position (x, y) character is set to walk to when action is triggered on this zone. | |MOVETO ||Specifies position (x, y) character is set to walk to when action is triggered on this zone. | ||
|- | |- | ||
|TYPE ||Block defining special features of the zone | |TYPE ||Block defining special features of the zone. See [[Parallaction/Scripts/Zone types|here]]. | ||
|- | |- | ||
|ENDZONE ||Marks the end of Zone definition. | |ENDZONE ||Marks the end of Zone definition. | ||
Line 58: | Line 60: | ||
|} | |} | ||
<br>Animation block | <br> | ||
===Animation block=== | |||
{| border="1" cellpadding="2" width=100% | {| border="1" cellpadding="2" width=100% | ||
Line 69: | Line 72: | ||
|LABEL ||Text to be displayed when mouse enters the area occupied by the animation. Since animations can move, the area is computed on the fly. | |LABEL ||Text to be displayed when mouse enters the area occupied by the animation. Since animations can move, the area is computed on the fly. | ||
|- | |- | ||
|FLAGS ||One or more among | |FLAGS ||One or more among behavior [[Parallaction/Scripts/Zone flags|flags]], separated by pipe character. | ||
|- | |- | ||
|COMMANDS ||List of commands to be performed when execution of animation script (SCR) is over. | |COMMANDS ||List of commands to be performed when execution of animation script (SCR) is over. | ||
Line 75: | Line 78: | ||
|MOVETO ||Specifies position (x, y) character is set to walk to when action is triggered on this animation (usually a non-playing character). | |MOVETO ||Specifies position (x, y) character is set to walk to when action is triggered on this animation (usually a non-playing character). | ||
|- | |- | ||
|TYPE ||Block defining special features of the animation | |TYPE ||Block defining special features of the animation. See [[Parallaction/Scripts/Zone types|here]]. | ||
|- | |- | ||
|ENDANIMATION ||Marks the end of Animation definition. | |ENDANIMATION ||Marks the end of Animation definition. | ||
|- | |||
|} | |||
<br> | |||
===Comment/Endcomment block=== | |||
These blocks are made of plain text, followed by an ENDTEXT statement on its own line. | |||
<br> | |||
===Nodes block=== | |||
This block only appear once in a location file, and holds a list of screen coordinates. | |||
{| border="1" cellpadding="2" width=100% | |||
|COORDS ||Declares one point (x, y) to be used in walk path calculation, whenever a direct path between two positions is not available. | |||
|- | |||
|ENDNODES ||Marks the end of Nodes block. | |||
|- | |||
|} | |||
<br> | |||
===Commands/Acommands block=== | |||
This block holds a list of commands with their own parameters. With regard to the order in which commands are encountered during parsing, the execution flow is '''backwards'''. | |||
{| border="1" cellpadding="2" width=100% | |||
|SET ||Sets a global (system) flag or a flag declared with LOCALFLAGS statement. | |||
|- | |||
|CLEAR ||Clears a global (system) flag or a flag declared with LOCALFLAGS statement. | |||
|- | |||
|START ||Sets kFlagsActing flag, starting animation script (SCR) execution. | |||
|- | |||
|STOP ||Clears kFlagsActing flag, stopping animation script (SCR) execution. | |||
|- | |||
|SPEAK ||Schedules a dialogue for execution at the beginning of the next game loop. | |||
|- | |||
|GET ||Adds an item to the inventory and removes corresponding Zone from screen, unless kFlagsFixed is set for the same Zone. | |||
|- | |||
|DROP ||Removes an item from inventory. | |||
|- | |||
|LOCATION ||Schedules a location switch. | |||
|- | |||
|OPEN ||Schedules a door for opening at the next frame. | |||
|- | |||
|CLOSE ||Schedules a door for closing at the next frame. | |||
|- | |||
|ON ||Sets kFlagActive, this displaying a previously hidden Zone or Animation. | |||
|- | |||
|OFF ||Sets kFlagRemove, this scheduling a visible Zone or Animation for hiding. | |||
|- | |||
|CALL ||Calls a built-in routine for special gfx. | |||
|- | |||
|TOGGLE ||Toggles a global (system) flag or a flag declared with LOCALFLAGS statement. | |||
|- | |||
|QUIT ||Sets system quit flag, thus telling the engine to exit the game. | |||
|- | |||
|MOVE ||Sets animation to be moved at the specified position. | |||
|- | |||
|ENDCOMMANDS ||Marks the end of Commands list. | |||
|- | |- | ||
|} | |} |
Latest revision as of 03:06, 23 January 2011
Location (LOC) scripts specification
Level-0 simple statements:
DISK | Selects data file containing resources for this location (it used to ask the user to switch floppy in the original games). This statement appears any other resource specification. |
LOCATION | Specifies location name and selects background bitmap and depth mask. It is not necessary for this statement to be the first one in the script. |
LOCAFLAGS | Declares custom flags for the current location: the default value is *clear*. The flags values are retained across savegames and location switches. |
FLAGS | Sets flags declared in LOCALFLAGS. |
SOUND | Specifies sound effect to be looped (as it was background music). |
MUSIC | Specifies background music. |
ENDLOCATION | Tells the parser there is nothing more to read in this location script. |
Level-0 block statements (with brief description):
ZONE | Declares interactive screen area. |
ANIMATION | Declares visible animation. |
COMMENT | Defines text to be displayed in a balloon when the location is accessed for the first time. |
ENDCOMMENT | Special text displayed on end game. There is only one instance in the last location for Nippon Safes. |
NODES | Defines points to be used as aid when computing walk paths. |
COMMANDS | Defines a list of commands to be executed before COMMENT text -if any- is displayed. |
ACOMMANDS | Defines a list of commands to be executed after COMMENT text -if any- is displayed. |
Zone block
LIMITS | Defines rectangular interactive area on screen. |
LABEL | Text to be displayed when mouse enters the area defined by LIMITS. |
FLAGS | One or more among behavior flags, separated by pipe character. |
COMMANDS | List of commands to be executed when zone is activated. |
MOVETO | Specifies position (x, y) character is set to walk to when action is triggered on this zone. |
TYPE | Block defining special features of the zone. See here. |
ENDZONE | Marks the end of Zone definition. |
Animation block
POSITION | Defines starting position (x, y, z) of the animation on the screen. |
FILE | Data file holding animation frames and respective sizes. |
SCRIPT | Name of script file (SCR) containing instructions to drive this animation (and possibly others). |
LABEL | Text to be displayed when mouse enters the area occupied by the animation. Since animations can move, the area is computed on the fly. |
FLAGS | One or more among behavior flags, separated by pipe character. |
COMMANDS | List of commands to be performed when execution of animation script (SCR) is over. |
MOVETO | Specifies position (x, y) character is set to walk to when action is triggered on this animation (usually a non-playing character). |
TYPE | Block defining special features of the animation. See here. |
ENDANIMATION | Marks the end of Animation definition. |
Comment/Endcomment block
These blocks are made of plain text, followed by an ENDTEXT statement on its own line.
Nodes block
This block only appear once in a location file, and holds a list of screen coordinates.
COORDS | Declares one point (x, y) to be used in walk path calculation, whenever a direct path between two positions is not available. |
ENDNODES | Marks the end of Nodes block. |
Commands/Acommands block
This block holds a list of commands with their own parameters. With regard to the order in which commands are encountered during parsing, the execution flow is backwards.
SET | Sets a global (system) flag or a flag declared with LOCALFLAGS statement. |
CLEAR | Clears a global (system) flag or a flag declared with LOCALFLAGS statement. |
START | Sets kFlagsActing flag, starting animation script (SCR) execution. |
STOP | Clears kFlagsActing flag, stopping animation script (SCR) execution. |
SPEAK | Schedules a dialogue for execution at the beginning of the next game loop. |
GET | Adds an item to the inventory and removes corresponding Zone from screen, unless kFlagsFixed is set for the same Zone. |
DROP | Removes an item from inventory. |
LOCATION | Schedules a location switch. |
OPEN | Schedules a door for opening at the next frame. |
CLOSE | Schedules a door for closing at the next frame. |
ON | Sets kFlagActive, this displaying a previously hidden Zone or Animation. |
OFF | Sets kFlagRemove, this scheduling a visible Zone or Animation for hiding. |
CALL | Calls a built-in routine for special gfx. |
TOGGLE | Toggles a global (system) flag or a flag declared with LOCALFLAGS statement. |
QUIT | Sets system quit flag, thus telling the engine to exit the game. |
MOVE | Sets animation to be moved at the specified position. |
ENDCOMMANDS | Marks the end of Commands list. |