ClaimEvent()
This command is used in a room script or script module's on_key_press or
on_mouse_click function, and it tells AGS not to run the global script afterwards.
For example, if your room script responds to the player pressing the space bar, and
you don't want the global script's on_key_press to handle it as well, then use this
command.
This is useful if you have for example a mini-game in the room, and you want to use
some keys for a different purpose to what they normally do.
The normal order in which scripts are called for on_key_press and on_mouse_click
is as follows:
- room script
- script modules, in order
- global script
If any of these scripts calls ClaimEvent, then the chain is aborted at that point.
Example:
if (keycode == ' ') {
Display("You pressed space in this room!");
ClaimEvent();
}
prevents the global script on_key_press from running if the player pressed the space bar.
SeeAlso: Script events
|