Adopters: Game Settings File

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

Moderators: Azhrei, dorpond

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

Post by jay »

I assume I can do that, I just don't know how. Or how long that might take.
/me no make movies :)

Are you wanting one for something in particular?

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

RPData Files

Post by jay »

The RPData file contains any static data you might need for a game. I've used it to hold races, modifiers, monsters and more. If there is a large amount of data that needs to be referenced by a character sheet then RPData files are the way to do it.

RPData files are loaded into an internal database w/in CT. Each property defined in the file ends up as a column in the table. There isn't anything that the game settings file editors have to know about the database as it is completely hidden. But you can access the database directly outside of CT see what is going on. I've found that this is a useful way to debug things. The code provides a numeric key for each of the records, but this isn't very useful in a character sheet since it just numbers the records as they are loaded. So there should always be a unique property that is stored in the table. By convention I use a property called name. I make the value if it displayable to the user so that it is easy to show in tables and combo boxes, but that isn't required it just makes other things easier. If you have a unique property defined for the data file then it is possible to refer to the data in the file using a SLOT type of property in the propertyDescriptorSet.xml file.

The actual file format consists of two sections. The first is a limited version of the property descriptor set xml file described in an earlier post. The second section is the definition of each item in the table. These are wrapped in a document element called <rptools-data>. It looks like this:

Code: Select all

<rptools-data>
  <property-set>
     <!-- Limited form of the property descriptor set defined earlier -->
     <type>stuff</type>
     ...
  </property-set>
  <stuff>
     <!-- A single record in the database. The element name is the same as the type defined in the property-set above. -->
  </stuff>
  ...
  <stuff>
     <!-- Last record in the table -->
  </stuff>
</rptools-data>

The limitations placed on the <property-set> element are that there can be no MAP or LIST data types defined within it. This is because the the database tables are not hierarchical. Since there aren't any MAP properties there isn't a need for the <property-sets> element in this file either. The only data types can be stored in a table are BOOLEAN, NUMBER, STRING, IMAGE, SCRIPT & SLOT. The MAP & LIST types and the <property-sets> element are ignored by the database code and will not generate exceptions.

There are two attributes defined that are only used in RPData files. These are @slot and @game-prop. When the @slot attribute is defined on any property and it contains the value 'modifiable' CT will allow that value to be modified by scripts and forms that display that value from a SLOT. Trying to modify any other child property values in a SLOT type of property will generate an error. These property values are also saved with the rest of the character data for use later. It is possible to add new properties to a SLOT value, but they would have to contain string values. The @slot attribute lets you define a data type for them as well.

The other special attribute is @game-prop. It is used to link a property in the table with a property from the propertyDescriptorSet.xml. Normally they would be linked by name, but the propertyDescriptorSet has a hierarchical structure and the table does not. So there is a need to map the property names for those values that are not stored at the root of the propertyDescriptorSet. Right now this is only used for IT's combatant look up table. It contains a bunch of monsters that can be loaded from the database and placed into the hierarchical structure of a combatant.

The <property-set> element contains a <type> element (See propertyDescriptorSet.xml in an earlier post). This element describes the type of data and is used in the @data attribute for SLOT type values. It is also the element name for each record in the table. The above example shows this. The value for <type> is stuff, each record in the second section is stored in a <stuff> element. The child elements for each record are the names of the properties defined in the <property-set> element. The order you define the children is not important, and it is not required that you have an element for each property defined. If no element is in the record then the default value for the property type is used. Here is an example of a RPData file with all of the pieces:

Code: Select all

<rptools-data>
  <property-set>
    <type>class</type>
    <name>Character Classes</name>
    <description>Classes available to characters.</description>
    <game>D &amp; D 4e</game>
    <source>PHB</source>
    <properties>
      <property name="name"><description>Unique name of the class.</description></property>
      <property name="role"><description>Text describing the roles of this class.</description></property>
      <property name="powerSource"><description>Text describing the source of your powers.</description></property>
      <property name="keyAbilities"><description>Text describing the key abilities for this class.</description></property>
      <property name="armorProficiencies"><description>Text describing the armor proficiencies for this class.</description></property>
      <property name="weaponProficiencies"><description>Text describing the weapon proficiencies for this class.</description></property>
      <property name="bonusToDefense"><description>Text describing the defense bonus for this class.</description></property>
      <property name="firstLevelHitPoints"><description>The number of hit points received at first level.</description></property>
      <property name="firstLevelHitPointScript" type="SCRIPT"><description>The number of hit points received at first level.</description></property>
      <property name="hitPointsPerLevel" type="NUMBER"><description>The modifier applied to the AC defense.</description></property>
      <property name="healingSurges" type="SCRIPT"><description>The number of healing surges for this class.</description></property>
      <property name="trainedSkills"><description>Text describing the skills available and the number trained for this class.</description></property>
      <property name="buildOptions"><description>Text describing the build options for this class.</description></property>
      <property name="classFeatures"><description>Text listing the class features for this class.</description></property>
      <property name="modifierSetName"><description>Name of modifier set that provides defense.</description></property>
    </properties>
  </property-set>
  <class>
    <name>Fighter</name>
    <role>Defender. You are very tough and have the exceptional ability to contain enemies in melee.</role>
    <powerSource>Martial. You have become a master of combat through endless hours of practice, determination, and your own sheer physical toughness.</powerSource>
    <keyAbilities>Strength, Dexterity, Wisdom, Constitution</keyAbilities>
    <armorProficiencies>Cloth, leather, hide, chainmail, scale; light shield, heavy shield</armorProficiencies>
    <weaponProficiencies>Simple melee, military melee, simple ranged, military ranged</weaponProficiencies>
    <bonusToDefense>+2 Fortitude</bonusToDefense>
    <firstLevelHitPoints>15 + Constitution Score</firstLevelHitPoints>
    <firstLevelHitPointScript>15 + root.con.current</firstLevelHitPointScript>
    <hitPointsPerLevel>6</hitPointsPerLevel>
    <healingSurges>9 + root.con.currentMod</healingSurges>
    <trainedSkills><![CDATA[
      From the class skills list below, choose three trained skills at 1st level.<br/><i>Class Skills:</i> Athletics (Str),
      Endurance (Con), Heal (Wis), Intimidate (Cha), Streetwise (Cha)
    ]]></trainedSkills> 
    <buildOptions>Great weapon fighter, guardian fighter</buildOptions>
    <classFeatures>Combat Challenge, Combat Superiority, Fighter Weapon Talent</classFeatures>
    <modifierSetName>class.fighter</modifierSetName>
  </class>
</rptools-data>
Some notes:
  • type The type of data is class. Therefore each record in the file is kept in an element named <class>.
  • name This is the unique class name. I use it in combo boxes on my Abeille form so that the user can easily pick their class. It's value has to be unique within the table or the SLOT property won't know which of the 2 records to load.
  • firstLevelHitPoints is a SCRIPT property type. In this example it has it's script defined in the <firstLevelHitPoints> of the <class> data element. But it is also possible to define the script with the property. It will become the default script for those <class> elements that do not have a <firstLevelHitPoints> element. This is also a useful way to define default values for other columns.
  • trainedSkills is a regular STRING type of data that contains html. CT does not use html directly, but some of the components that you would place on an Abeille form do recognize it. The two main ones are Labels and Editor Panes. If you try to show this value in a component that doesn't recognize html, you will see all of the markup in the component.

User avatar
jstgtpaid
Giant
Posts: 142
Joined: Sun Jun 22, 2008 1:23 am
Location: Tampa, FL

Post by jstgtpaid »

Great all I need to know now is how to post a patch.

Would it be okay if I started added classes and races to the databases in the 4e game file?

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

Post by jay »

I'll start working on that tonight. You need to coordinate any 4e changes with the file owners; Fobbo, kasrith and UntoldGlory.

knuckledragger
Kobold
Posts: 18
Joined: Sun Apr 12, 2009 8:22 pm
Location: Versailles, Ky

Re: Adoptors: Game Settings File

Post by knuckledragger »

Will character sheets for warhammer, and warhammer40k dark heresy ever be made as a patch? This would be wonderful!

Knuckledragger

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

Re: Adoptors: Game Settings File

Post by jay »

I don't know anything about warhammer, so I can't do it. If you can get some people together to create one, I would be happy to add it in with the rest of the CT/IT settings files.

User avatar
Jagged
Great Wyrm
Posts: 1306
Joined: Mon Sep 15, 2008 9:27 am
Location: Bristol, UK

Re:

Post by Jagged »

jay wrote:6 Select the 3 jars in the lib directory and hit OK. They are bsf-2.3.0rc1.jar, js-1.5R3.jar and Pack200Task.jar.


I also had to locate a jar file for "net.sourceforge.jarbundler.JarBundler" so I added jarbundler-2.2.0.jar to the classpath which I downloaded separately.

User avatar
Azhrei
Site Admin
Posts: 12050
Joined: Mon Jun 12, 2006 1:20 pm
Location: Tampa, FL

Re: Re:

Post by Azhrei »

Jagged wrote:I also had to locate a jar file for "net.sourceforge.jarbundler.JarBundler" so I added jarbundler-2.2.0.jar to the classpath which I downloaded separately.

That's an Apple-specific tool, right? I don't see why that requirement would've been in CharTool.

Unless... Maybe I accidentally added it?! Let me check.

Yep, looks like that's my fault. I must've checked in some version of the code that wasn't supposed to be checked in. (I've been working on and off to get the build process for OSX more automated, but Ant is not my forté.)

Okay, I've moved the JarBundler definition to the OSX-specific "app" target where it won't be used unless you specific try to build that target (that target is never part of a default build). That should remove the requirement. This is in SVN revision 5757.

User avatar
Jagged
Great Wyrm
Posts: 1306
Joined: Mon Sep 15, 2008 9:27 am
Location: Bristol, UK

Re: Adopters: Game Settings File

Post by Jagged »

So I am up and running with Chartool running in Eclipse but I have a few questions that the instructions in this thread don't seem to answer.
  • To run from within Eclipse I had to build the game settings files in the web\arc\tool\inittool\gamessettings (from memory so maybe not accurate) directory but when it starts it doesn't actually use those files, it downloads them from rptools.net. Is that correct?
  • Is there a way to force the application to copy my local files instead?

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

Re: Adopters: Game Settings File

Post by jay »

Jagged wrote:
  • To run from within Eclipse I had to build the game settings files in the web\arc\tool\inittool\gamessettings (from memory so maybe not accurate) directory but when it starts it doesn't actually use those files, it downloads them from rptools.net. Is that correct?
By default, yes.

Jagged wrote:
  • Is there a way to force the application to copy my local files instead?
You add this to the VM arguments of the debug/run configuration in eclipse:

Code: Select all

-DgameFileUrl="file://localhost/C:/Documents and Settings/Jay/workspace/web/src/tools/inittool/gameSettings/"
Replace the url with the location of your build files.

User avatar
Jagged
Great Wyrm
Posts: 1306
Joined: Mon Sep 15, 2008 9:27 am
Location: Bristol, UK

Re: Adopters: Game Settings File

Post by Jagged »

Cool. I have another question though ;)

Adding -DgameFileUrl="file://localhost/.. etc etc" to my vre parameters works as you describe. And when I run Chartool from Eclipse it recognises the fact that I have modified the DnD4e file and it uses my local version (updated to v34). But how do I get it to detect that I have added a new source file to the DnD4e game?

I can, of course, browse the file structure and manually select my new source, but I want a clean install to detect it.

My local version.properties file contains the following additional lines:

Code: Select all

dnd4e-hotfl.version=100
dnd4e-hotfl.parent=dnd4e
dnd4e-hotfl.name=Heroes of the Fallen Lands


What am I missing?

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

Re: Adopters: Game Settings File

Post by jay »

I'll have to take a look at the code when I get home from work. What you have looks right. There was some stuff included in the .rpgame file as well. There is a properties file in the root directory that had some more data in it IIRC.

User avatar
Steel Rat
Great Wyrm
Posts: 1758
Joined: Tue Jun 13, 2006 5:55 pm
Location: Oak Harbor, WA
Contact:

Re: Adopters: Game Settings File

Post by Steel Rat »

I sure hope you guys can manage to make an editor for us folks who can't figure this out, lol.
Steel Rat
-----------
Helm's Deep RPG Network
Infinite Realities - RPG Supplements.
RPGMapShare.com - RPG Maps and Mapping objects.

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

Re: Adopters: Game Settings File

Post by jay »

Yeah, it needs one. I've started modifying the old one, but I've only got far enough to break everything :P

User avatar
Steel Rat
Great Wyrm
Posts: 1758
Joined: Tue Jun 13, 2006 5:55 pm
Location: Oak Harbor, WA
Contact:

Re: Adopters: Game Settings File

Post by Steel Rat »

Well, that's, er, progress? :mrgreen:
Steel Rat
-----------
Helm's Deep RPG Network
Infinite Realities - RPG Supplements.
RPGMapShare.com - RPG Maps and Mapping objects.

Post Reply

Return to “CharacterTool”