RPTools.net
http://forums.rptools.net/

Adopters: CT/IT Events
http://forums.rptools.net/viewtopic.php?f=15&t=10515
Page 1 of 1

Author:  jay [ Sun Jul 26, 2009 12:14 pm ]
Post subject:  Adopters: CT/IT Events

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.

Author:  jfrazierjr [ Tue May 08, 2012 10:21 am ]
Post subject:  Re: Adopters: CT/IT Events

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...

Author:  jay [ Tue May 08, 2012 11:57 am ]
Post subject:  Re: Adopters: CT/IT Events

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

Author:  jfrazierjr [ Tue May 08, 2012 12:51 pm ]
Post subject:  Re: Adopters: CT/IT Events

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:
<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)

Author:  jay [ Tue May 08, 2012 2:04 pm ]
Post subject:  Re: Adopters: CT/IT Events

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).

Page 1 of 1 All times are UTC - 6 hours [ DST ]
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/