spacer graphic
spacer graphic
Montage of games AGS Logo
spacer graphic

 

spacer graphic
Menu
spacer graphic Home
About
News
Features
Download AGS
spacer graphic Games 
Games main page
Award Winners
Picks of the month
Short games
Medium length games
Full length games
In Production
Hints & Tips
Community
Forums
AGSers World Map
Member websites
Chat
Resources
Tutorials
FAQ
Knowledge Base
Downloads
Links
AGS-related links
* AGS Manual
  * Scripting
    * Game / Global functions

ClaimEvent

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


User comments and notes
There are currently no user comments on this page.
The user comment facility is currently disabled.