RPTools.net

Discussion and Support

Skip to content

It is currently Fri Nov 24, 2017 4:17 am 






Reply to topic  [ 5 posts ] 

Previous topic | Next topic 

  Print view

Author Message
User avatar  Offline
RPTools Team
 
Joined: Tue Feb 07, 2006 1:07 am
Posts: 1766
Location: Austin, Tx
 Post subject: Adopters: MT Integration
PostPosted: Mon Aug 03, 2009 2:52 pm 
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:
<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:
<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:
// 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:
<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.


Top
 Profile  
 
 Offline
Kobold
 
Joined: Sun Jan 06, 2013 2:57 am
Posts: 5
 Post subject: Re: Adopters: MT Integration
PostPosted: Sun Jan 06, 2013 3:16 am 
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)?


Top
 Profile  
 
User avatar  Offline
RPTools Team
 
Joined: Tue Feb 07, 2006 1:07 am
Posts: 1766
Location: Austin, Tx
 Post subject: Re: Adopters: MT Integration
PostPosted: Mon Jan 07, 2013 3:49 pm 
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


Top
 Profile  
 
 Offline
Kobold
 
Joined: Sun Jan 06, 2013 2:57 am
Posts: 5
 Post subject: Re: Adopters: MT Integration
PostPosted: Thu Jan 10, 2013 3:42 pm 
Thanks. Do you know anyone working on CT integration?


Top
 Profile  
 
User avatar  Offline
RPTools Team
 
Joined: Tue Feb 07, 2006 1:07 am
Posts: 1766
Location: Austin, Tx
 Post subject: Re: Adopters: MT Integration
PostPosted: Thu Jan 10, 2013 5:21 pm 
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.


Top
 Profile  
 
Display posts from previous:  Sort by  
Reply to topic  [ 5 posts ] 

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:

Who is online

In total there is 1 user online :: 0 registered, 0 hidden and 1 guest (based on users active over the past 5 minutes)
Most users ever online was 243 on Sun Nov 04, 2012 6:14 am

Users browsing this forum: No registered users and 1 guest





Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group

Style based on Andreas08 by Andreas Viklund

Style by Elizabeth Shulman