Adopters: MT Integration

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: MT Integration

Post by jay »

CT & IT can create RPToken files that can be loaded into MT. These tokens have their MT Name, Token, Portrait, and GM notes set by default. But a relationship between CT/IT properties & MT properties can be defined so that the token properties are saved. If there is a campaign framework in use then the macros for that framework can be added into the game settings file and then automatically added to your token. Support can also be provided for user defined macros specific to the token.

The mapping between CT/IT properties & MT properties is done by a single Java properties file called property/mtPropertyMap.properties. A Java properties file, as defined here, consists of name/value pairs separated by an equal sign. Each property name in the file is the name of an MT Property. Each property value can be the name of a CT property or a script used to convert any number of CT properties into a single MT property. If the mapping is done on a one MT property to one CT property basis, data changed in MT will be copied into CT when the token file is loaded. If a script is mapped to an MT property then CT will only add the value to the RPToken file and not read it back. As an example take a look at the file that maps CT's D&D 4e file to TK's old macro set here.

The other important part of integrating CT with MT is adding support for MT macros. These macros are stored in a property which is defined in the property/propertyDescriptorSet.xml file. The definition that I use is:

Code: Select all

<property name="rpSystemMacros" type="SCRIPT">
  <description>Generate the list of macros for this character.</description>
  <script>...</script>
</property>
This allows a script to add all of the macros to the data dynamically as they are needed instead of placing them into the data file for the combatant. Not storing them in the CT character file has a couple of benefits. First, the macros aren't copied twice, once for CT & once for MT. Second, changes to the macros in the game settings file are automatically added to the RPToken file the next time it is saved. This will add new macros as well. Third, the script can be intelligent about which scripts are added. For example, if there are class specific macros in a campaign framework the script can be written to only add the macros for the character's selected class. The script has to return a LIST type property value which is a PropertyList java class. The script used by the D&D 4e file to map TK's macros to a character's class, race, and powers as well as adding in default scripts is here.

This script assumes that the macros are stored in an RPData file. In general the properties defined for this file should look something like this:

Code: Select all

<rptools-data>
  <property-set>
    <type>macro</type>
    <name>Macros</name>
    <description>Macros that are attached to characters.</description>
    <game>...</game>
    <source>...</source>
    <properties>
      <property name="name" slot="modifiable"><description>Unique name for the macro.</description></property>
      <property name="macroText" slot="modifiable" display="Macro Command"><description>The actual token macro.</description></property>
      <property name="macroSetName"><description>The name of a macro set, if any.</description></property>
    </properties>
  </property-set>
</rptools-data>
It defines a property for the macro name, one for the macro itself and a third one used to group the macros together. This last field allows you to tie a set of macros together. All of the macros for a class would have the same <macroSetName> value, for instance. The script referenced above reads all of the macros from this file using this field and then places them in a LIST so that the code saving the token can access them and save them to the file. The JavaScript code that reads a set of records is this:

Code: Select all

// Get core macros
var macros = new PropertyList();
var table = new PropertyTable(AppUtil.getAppName(), 'macro');
var condition = new SimpleCondition('MACRO_SET_NAME', SimpleCondition.Operator.EQUALS, 'core');
var list = table.selectRows(null, condition);
if (!list.isEmpty()) macros.addAll(list);
The complete script defined for the 4e settings is the getMacros() function defined here.

There can also be token specific macros defined for a character. To do this add a new property to property/propertyDescriptorSet.xml file named rpUserMacros. The definition should look like this:

Code: Select all

<property name="rpUserMacros" type="LIST">
  <description>The list of user entered macros that are sent to MT.</description>
  <property name="macro" type="SLOT" data="macro"/>
</property>
A field on a form is required to allow the user to edit the macros. An example of one is the forms/mt.jfrm which lists all the user macros and uses the forms/editTokenMacroDialog.jfrm form to edit a single one of them. Both are in the 4e game settings file.

RasgonOfLodos
Kobold
Posts: 5
Joined: Sun Jan 06, 2013 2:57 am

Re: Adopters: MT Integration

Post by RasgonOfLodos »

Just curious if anybody has already done this work for the most recent version of the Pathfinder Macros (MT1.3.87.02_DnD35_Pathfinder.cmpgn)?

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

Re: Adopters: MT Integration

Post by jay »

I don't know of anybody that has done MT macros for IT other than me. And, I've not done any Pathfinder macros at all

RasgonOfLodos
Kobold
Posts: 5
Joined: Sun Jan 06, 2013 2:57 am

Re: Adopters: MT Integration

Post by RasgonOfLodos »

Thanks. Do you know anyone working on CT integration?

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

Re: Adopters: MT Integration

Post by jay »

I don't know that anybody is right now, other than me when I'm DMing. I'm on a break right now, so nothing is being done that I know about.

Post Reply

Return to “CharacterTool”