|
Modification
This is a complete listing of events. Some of these are not safe to
use from SLIC. A few are just plain obsolete and don't do anything
useful. Events with arguments prefaced by GEA_ cannot be generated
from SLIC, but can be triggered on.
How to use events from SLIC:
To add a handler for a named event:
HandlEvent(EventName) 'HandlerName' [pre | post] {
// Your code here
}
Example:
location_t location_of_death;
// ...
// set location_of_death to some square first
// ...
// This handler will kill every unit that enters a preset location of death
HandleEvent(MoveUnits) 'MyMoveHandler' post {
if(army[0].location == location_of_death) {
int_t u;
for(u = 0; u < army[0].size; u++) {
unit_t unit;
GetUnitFromArmy(army[0], u, unit);
Event:KillUnit(unit, 0, -1);
}
}
}
The priority of the handler can be either pre or post. A "pre"
handler runs before the in-game code, a "post" handler runs
afterwards. Note that for some events, some arguments may contain
invalid data by the time a post handler is called. (For example, in a
KillUnit post handler, the unit will already be dead).
To generate an event from SLIC:
Event:EventName(arguments)
Example (also see above):
Event:KillUnit(unit, 0, -1);
Generates a KillUnit event for the specified unit. Note that events
always execute ASYNCHRONOUSLY. The event is added to a queue, and is
executed only after all events added before it have finished
executing. So in the above example, the units do not actually die
until after the handler has finished executing.
The complete listing of all events
int_t<player> denotes an integer argument that corresponds to a player. Ints and players are mostly interchangeable in SLIC, they are listed specially here for clarity.
int_t<direction> is a direction argument. The range is from 0-7.
BACK TO MODIFICATION INDEX PAGE
|