This post gives a short description of each of the events available to CT & IT. CT only has one event, but IT has many of them. Events for the applications are placed in the eventScripts.xml file located in the chartool/ & inittool/ directories within the game settings files. The eventScripts.xml file contains a single <event-scripts> element that hold all of the application specific events. Each event script is defined by a single <script> element with its @event attribute set to the name of the event.
CT's only event:
- CHARACTER_LOAD: Called when a combatant is loaded into CT
These are IT's global events.
- START_ENCOUNTER: Called at the start of an encounter.
- START_ROUND: Called at the start of each round before a combatant is given initiative.
- INITIALIZE_INITIATIVE_DATA: Called before IT starts determining initiative
- INITIATIVE_DETERMINED: Called after IT finishes determining initiative.
- DETERMINE_INITIATIVE: Called when IT want's to generate the initiative of a combatant.
- RESOLVE_TIES: Called when a group of combatants have the same initiative value and IT needs to know which one goes first.
- ADD_COMBATANT: Called when a new combatant is added to the encounter.
- ADD_GROUP_COMBATANT: Called when a new combatant is added to an IT group.
- ADD_TIMER: Called when a new timer is added to the encounter.
IT also supports events on its combatants, timers, and phases. All of these scripts are defined in the inittool/initTool.xml file.
The combatant specific events are defined in an <event-scripts> element contained within the <combatant-type> element. This allows each category of combatant to have its own specific event script. The combatant category events generated are:
- RECEIVE_INITIATIVE: Called when a combatant receives initiative.
- LOSE_INITIATIVE: Called when a combatant loses initiative.
- CREATE_COMBATANT: Called when a combatant is created.
- DELETE_COMBATANT: Called when a combatant is deleted.
The timer specific events are defined in an <event-scripts> element contained within the <timer-type> element. This allows each different type of timer to have its own specific event script. The timer type events generated are:
- RECEIVE_INITIATIVE: Called when a timer receives initiative.
- LOSE_INITIATIVE: Called when a timer loses initiative.
- CREATE_TIMER: Called when a timer is created.
- DELETE_TIMER: Called when a timer is deleted.
- TIMER_EXPIRES: Called when a timer expires.
- CHANGE_TIMER: Called when the timer data changes.
The last set of events are specific to phases. The phase specific events are defined in an <event-scripts> element contained within the <phase-type> element. There is only one <phase-type> element defined withing the initTool.xml file so the same script is executed for each phase. The phase events generated are:
- RECEIVE_INITIATIVE: Called when a phase receives initiative.
- LOSE_INITIATIVE: Called when a phase loses initiative.
- ADD_TO_PHASE: Called when a combatant is added to a phase.
- REMOVE_FROM_PHASE: Called when a combatant is removed from a phase.
- PHASE_SORT_VALUE: Called on each combatant in a phase when determining the sort order within the phase.
- LEAVE_PHASE: Called after the last combatant in the phase has finished with its turn.