Adopters: CT/IT Events

Discussion of your thoughts & requests, help for users and game specific configuration files for Character Tool

Moderators: dorpond, Azhrei

Post Reply
User avatar
jay
RPTools Team
Posts: 1767
Joined: Tue Feb 07, 2006 1:07 am
Location: Austin, Tx

Adopters: CT/IT Events

Post by jay »

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.

User avatar
jfrazierjr
Deity
Posts: 5176
Joined: Tue Sep 11, 2007 7:31 pm

Re: Adopters: CT/IT Events

Post by jfrazierjr »

Thanks for the run down Jay. Are there any other possible events for CT? Thinking about stuff like might be used to start wizard on first show of a form as opposed to load of the sheet itself...
I save all my Campaign Files to DropBox. Not only can I access a campaign file from pretty much any OS that will run Maptool(Win,OSX, linux), but each file is versioned, so if something goes crazy wild, I can always roll back to a previous version of the same file.

Get your Dropbox 2GB via my referral link, and as a bonus, I get an extra 250 MB of space. Even if you don't don't use my link, I still enthusiastically recommend Dropbox..

User avatar
jay
RPTools Team
Posts: 1767
Joined: Tue Feb 07, 2006 1:07 am
Location: Austin, Tx

Re: Adopters: CT/IT Events

Post by jay »

There isn't an event, but I think you can set up for a listener. I'll have to check when I get home...

User avatar
jfrazierjr
Deity
Posts: 5176
Joined: Tue Sep 11, 2007 7:31 pm

Re: Adopters: CT/IT Events

Post by jfrazierjr »

jay wrote:There isn't an event, but I think you can set up for a listener. I'll have to check when I get home...

Cool.. along a similar line of thinking, you can set up the CharTool.xml with multiple forms:

Code: Select all

<game-settings>
  <character-sheet-file>forms/sw.jfrm</character-sheet-file>
  <forms>
    <form>
      <name>Default Character Sheet</name>
      <file>forms/sw.jfrm</file>
    </form>
        <form>
      <name>Default Character Sheet2</name>
      <file>forms/swImage.jfrm</file>
    </form>
  </forms>
</game-settings>
Is it currently possible to limit visibility to one form or another based upon some custom criteria. ie, form "2"(in this case swImage.jfrm) is not visible until some certain criteria is set(likely checked by the onLoad event)
I save all my Campaign Files to DropBox. Not only can I access a campaign file from pretty much any OS that will run Maptool(Win,OSX, linux), but each file is versioned, so if something goes crazy wild, I can always roll back to a previous version of the same file.

Get your Dropbox 2GB via my referral link, and as a bonus, I get an extra 250 MB of space. Even if you don't don't use my link, I still enthusiastically recommend Dropbox..

User avatar
jay
RPTools Team
Posts: 1767
Joined: Tue Feb 07, 2006 1:07 am
Location: Austin, Tx

Re: Adopters: CT/IT Events

Post by jay »

You can add multiple forms to that XML, but it only causes them to show up in the view menu. All other forms are hidden and have to be brought up manually using scripts (or embedded in each other).

Post Reply

Return to “CharacterTool”