1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
  2. While the majority of active discourse on D20PRO has moved to our Discord Channels, this forum is still active and checked-in on regularly by our staff. However, for the very latest information, conversation and/or immediate support, please join us on Discord here: http://discord.gg/Ph38ckM
    Dismiss Notice

d20Pro file formats?

Discussion in 'Bug Reports & Installation Support' started by Goncyn, Sep 24, 2012.

  1. Goncyn

    Goncyn New Member

    Joined:
    Sep 24, 2012
    Messages:
    16
    Likes Received:
    0
    Is there any public documentation on the d20Pro file formats? I have been working on a program to parse Pathfinder monster statblocks, and I would like to use it to generate files I can import directly into my d20Pro campaign. To do that, I need to know how the d20Pro creature files are formatted, and my initial searches have come up blank. Any help would be greatly appreciated!
     
  2. Caraldur

    Caraldur Member

    Joined:
    Aug 18, 2011
    Messages:
    62
    Likes Received:
    0
    Below is the contents of a file exported from Herolabs to be imported into d20Pro. So you would have to import it as a herolab file but it should work for what you want to do.... I think.

    Code:
    <?xml version="1.0" encoding="ISO-8859-1"?>
    <document signature="d20Pro Import File"><importer version="2" game="pathfinder"/><hero active="yes" heroname="Frumkin Dittlewurts"><keyvalue id="Size" value="Small"/><keyvalue id="Space" value="5"/><keyvalue id="Reach" value="5"/><keyvalue id="Speed" value="20"/><keyvalue id="NumHands" name="Number of Hands" value="2"/><keyvalue id="Experience" name="Total Experience" value="0"/><keyvalue id="Class" value="Expert 4"/><keyvalue id="Race" value="Gnome"/><keyvalue id="Alignment" value="Lawful Neutral"/><keyvalue id="CurrentHP" name="Current Hit Points" value="23"/><keyvalue id="MaxHP" name="Maximum Hit Points" value="23"/><keyvalue id="ACTotal" name="Total Armor Class" value="12"/><keyvalue id="ACArmor" name="AC from Armor"/><keyvalue id="ACShield" name="AC from Shield"/><keyvalue id="ACDexMod" name="AC from Dexterity Modifier" value="+1"/><keyvalue id="ACNatural" name="AC from Natural"/><keyvalue id="ACDeflect" name="AC from Deflection"/><keyvalue id="ACDodge" name="AC from Dodge"/><keyvalue id="ACMisc" name="AC from Miscellaneous"/><keyvalue id="CMBTotal" name="Total CMB" value="+1"/><keyvalue id="CMDTotal" name="Total CMD" value="12"/><keyvalue id="CMDFlat" name="Flat-Footed CMD" value="11"/><keyvalue id="PP" name="Total PP" value="0"/><keyvalue id="GP" name="Total GP" value="0"/><keyvalue id="SP" name="Total SP" value="0"/><keyvalue id="CP" name="Total CP" value="0"/><background gender="male" age="54" height="3' 5&quot;" weight="40lb." hair="grey" eyes="blue" skin="blotchy white"></background><types><type name="Humanoid"/><subtype name="Gnome"/></types><attributes><keyvalue id="aSTR" name="Strength" value="8"/><keyvalue id="aDEX" name="Dexterity" value="13"/><keyvalue id="aCON" name="Constitution" value="10"/><keyvalue id="aINT" name="Intelligence" value="16"/><keyvalue id="aWIS" name="Wisdom" value="12"/><keyvalue id="aCHA" name="Charisma" value="16"/></attributes><saves><keyvalue id="svFort" name="Fortitude Save" value="1"/><keyvalue id="svRef" name="Reflex Save" value="2"/><keyvalue id="svWill" name="Will Save" value="5"/></saves><attacks><attack id="wUnarmed" name="Unarmed Strike" attack="0" damage="1d2" critical="20/x2" multiattacks="no" class="light" equipped="" melee="true" ranged="false" thrown="false" finesse="false" damagetype="B"/></attacks><feats><keyvalue id="fArcTalent" name="Arcane Talent: Message (3/day)"/><keyvalue id="fArmLight" name="Armor Proficiency (Light)"/><keyvalue id="fSimple" name="Simple Weapon Proficiency - All"/><keyvalue id="fSkillFoc" name="Skill Focus: Knowledge (Nobility)"/></feats><skills><skill id="skAcrobat" name="Acrobatics" ranks="0" misc="0" classskill="no"/><skill id="skAppraise" name="Appraise" ranks="3" misc="0" classskill="no"/><skill id="skBluff" name="Bluff" ranks="2" misc="0" classskill="no"/><skill id="skClimb" name="Climb" ranks="0" misc="0" classskill="no"/><skill id="skCrafCall" name="Craft: Calligraphy" ranks="4" misc="0" classskill="no"/><skill id="skDiplo" name="Diplomacy" ranks="4" misc="0" classskill="no"/><skill id="skDisable" name="Disable Device" ranks="0" misc="-2" classskill="no"/><skill id="skDisguise" name="Disguise" ranks="0" misc="0" classskill="no"/><skill id="skEscape" name="Escape Artist" ranks="0" misc="0" classskill="no"/><skill id="skFly" name="Fly" ranks="0" misc="2" classskill="no"/><skill id="skHandleAn" name="Handle Animal" ranks="0" misc="0" classskill="no"/><skill id="skHeal" name="Heal" ranks="0" misc="0" classskill="no"/><skill id="skIntim" name="Intimidate" ranks="0" misc="0" classskill="no"/><skill id="skKnowEng" name="Knowledge: Engineering" ranks="0" misc="0" classskill="no"/><skill id="skKnowGeog" name="Knowledge: Geography" ranks="4" misc="0" classskill="no"/><skill id="skKnowHist" name="Knowledge: History" ranks="4" misc="0" classskill="no"/><skill id="skKnowLoc" name="Knowledge: Local" ranks="4" misc="0" classskill="no"/><skill id="skKnowNobl" name="Knowledge: Nobility" ranks="4" misc="3" classskill="no"/><skill id="skLinguist" name="Linguistics" ranks="2" misc="0" classskill="no"/><skill id="skPercep" name="Perception" ranks="0" misc="2" classskill="no"/><skill id="skRide" name="Ride" ranks="1" misc="0" classskill="no"/><skill id="skSenseMot" name="Sense Motive" ranks="4" misc="0" classskill="no"/><skill id="skSleight" name="Sleight of Hand" ranks="0" misc="0" classskill="no"/><skill id="skSpellcr" name="Spellcraft" ranks="0" misc="0" classskill="no"/><skill id="skStealth" name="Stealth" ranks="1" misc="4" classskill="no"/><skill id="skSurvival" name="Survival" ranks="3" misc="0" classskill="no"/><skill id="skSwim" name="Swim" ranks="0" misc="0" classskill="no"/><skill id="skUseMagic" name="Use Magic Device" ranks="0" misc="0" classskill="no"/><skill id="lCommon" name="Speak Common" ranks="1" misc="0" classskill="no"/><skill id="lDwarven" name="Speak Dwarven" ranks="1" misc="0" classskill="no"/><skill id="lElven" name="Speak Elven" ranks="1" misc="0" classskill="no"/><skill id="lGiant" name="Speak Giant" ranks="1" misc="0" classskill="no"/><skill id="lGnome" name="Speak Gnome" ranks="1" misc="0" classskill="no"/><skill id="lGoblin" name="Speak Goblin" ranks="1" misc="0" classskill="no"/><skill id="lOrc" name="Speak Orc" ranks="1" misc="0" classskill="no"/><skill id="lSylvan" name="Speak Sylvan" ranks="1" misc="0" classskill="no"/></skills><gear><item id="gGround" name="Dropped to Ground (empty)" quantity="1"/></gear><spellsknown/><spellsmemorized/><specialabilities><special name="Arcane Talent: Message (3/day)" uses="3">You gain a chosen spell as a spell-like ability, 3/day.</special><special name="Dancing Lights (1/day) (Sp)" uses="1">With Charisma 11+, cast Dancing Lights once per day.</special><special name="Defensive Training +4">Gain a dodge bonus to AC vs monsters of the Giant subtype.</special><special name="Ghost Sound (1/day) (Sp)" uses="1">With Charisma 11+, cast Ghost Sound once per day.</special><special name="Hatred +1">Gain a bonus to attack vs goblinoid/reptilian humanoids.</special><special name="Illusion Resistance">+2 racial bonus to saves against illusions.</special><special name="Low-Light Vision">See twice as far as a human in low light, distinguishing color and detail.</special><special name="Prestidigitation (1/day) (Sp)" uses="1">With Charisma 11+, cast Prestidigitation once per day.</special><special name="Speak with Animals (1/day) (Sp)" uses="1">Speak with Animals 1/day.</special></specialabilities><userimages/></hero></document>
    
     
  3. edwardcd

    edwardcd Administrator
    Staff Member

    Joined:
    Oct 13, 2010
    Messages:
    1,374
    Likes Received:
    9
    This is a native d20Pro creature

    .d20_ctr extension

    Code:
    ~oGBo~   m     a¡ creature/Pezzack.d20_ctr     RES/manifests/CTR.manifest     RES/manifests/ITEM.manifest<com.mindgene.d20.common.creature.CreatureTemplate>
      <AC class="byte-array">AAIAAAAA</AC>
      <ER class="com.mindgene.d20.common.creature.CreatureElementalResistance">
        <resistances class="linked-hash-map">
          <entry>
            <string>Fire</string>
            <com.mindgene.d20.common.creature.ResistanceModel>
              <immunity class="boolean">false</immunity>
              <resistance class="int">0</resistance>
              <vulnerability class="boolean">false</vulnerability>
            </com.mindgene.d20.common.creature.ResistanceModel>
          </entry>
          <entry>
            <string>Cold</string>
            <com.mindgene.d20.common.creature.ResistanceModel>
              <immunity class="boolean">false</immunity>
              <resistance class="int">0</resistance>
              <vulnerability class="boolean">false</vulnerability>
            </com.mindgene.d20.common.creature.ResistanceModel>
          </entry>
          <entry>
            <string>Acid</string>
            <com.mindgene.d20.common.creature.ResistanceModel>
              <immunity class="boolean">false</immunity>
              <resistance class="int">0</resistance>
              <vulnerability class="boolean">false</vulnerability>
            </com.mindgene.d20.common.creature.ResistanceModel>
          </entry>
          <entry>
            <string>Electricity</string>
            <com.mindgene.d20.common.creature.ResistanceModel>
              <immunity class="boolean">false</immunity>
              <resistance class="int">0</resistance>
              <vulnerability class="boolean">false</vulnerability>
            </com.mindgene.d20.common.creature.ResistanceModel>
          </entry>
          <entry>
            <string>Sonic</string>
            <com.mindgene.d20.common.creature.ResistanceModel>
              <immunity class="boolean">false</immunity>
              <resistance class="int">0</resistance>
              <vulnerability class="boolean">false</vulnerability>
            </com.mindgene.d20.common.creature.ResistanceModel>
          </entry>
          <entry>
            <string>Arcane</string>
            <com.mindgene.d20.common.creature.ResistanceModel>
              <immunity class="boolean">false</immunity>
              <resistance class="int">0</resistance>
              <vulnerability class="boolean">false</vulnerability>
            </com.mindgene.d20.common.creature.ResistanceModel>
          </entry>
          <entry>
            <string>Necrotic</string>
            <com.mindgene.d20.common.creature.ResistanceModel>
              <immunity class="boolean">false</immunity>
              <resistance class="int">0</resistance>
              <vulnerability class="boolean">false</vulnerability>
            </com.mindgene.d20.common.creature.ResistanceModel>
          </entry>
          <entry>
            <string>Poison</string>
            <com.mindgene.d20.common.creature.ResistanceModel>
              <immunity class="boolean">false</immunity>
              <resistance class="int">0</resistance>
              <vulnerability class="boolean">false</vulnerability>
            </com.mindgene.d20.common.creature.ResistanceModel>
          </entry>
          <entry>
            <string>Psychic</string>
            <com.mindgene.d20.common.creature.ResistanceModel>
              <immunity class="boolean">false</immunity>
              <resistance class="int">0</resistance>
              <vulnerability class="boolean">false</vulnerability>
            </com.mindgene.d20.common.creature.ResistanceModel>
          </entry>
          <entry>
            <string>Radiant</string>
            <com.mindgene.d20.common.creature.ResistanceModel>
              <immunity class="boolean">false</immunity>
              <resistance class="int">0</resistance>
              <vulnerability class="boolean">false</vulnerability>
            </com.mindgene.d20.common.creature.ResistanceModel>
          </entry>
          <entry>
            <string>Thunder</string>
            <com.mindgene.d20.common.creature.ResistanceModel>
              <immunity class="boolean">false</immunity>
              <resistance class="int">0</resistance>
              <vulnerability class="boolean">false</vulnerability>
            </com.mindgene.d20.common.creature.ResistanceModel>
          </entry>
        </resistances>
      </ER>
      <HP class="short">14</HP>
      <HPMax class="short">14</HPMax>
      <HPTemp class="short">0</HPTemp>
      <abilities class="byte-array">DA0LDxAR</abilities>
      <abilitiesMods class="byte-array">AAAAAAAA</abilitiesMods>
      <alignment class="string">True Neutral</alignment>
      <attacks class="list">
        <com.mindgene.d20.common.creature.attack.CreatureAttack>
          <abilityToDamage class="byte">0</abilityToDamage>
          <abilityToHit class="byte">0</abilityToHit>
          <attackCascading class="boolean">true</attackCascading>
          <critMinThreat class="byte">18</critMinThreat>
          <critMultiplier class="byte">2</critMultiplier>
          <damages class="list">
            <com.mindgene.d20.common.creature.attack.CreatureAttackDamage>
              <dice class="com.mindgene.d20.common.dice.Dice">
                <mod class="int">0</mod>
                <num class="int">1</num>
                <sides class="int">8</sides>
              </dice>
              <qualities class="linked-hash-set">
                <com.mindgene.d20.common.creature.attack.CreatureAttackQuality_Slash/>
              </qualities>
            </com.mindgene.d20.common.creature.attack.CreatureAttackDamage>
          </damages>
          <defense class="byte">0</defense>
          <groups class="boolean-array">
            <boolean>false</boolean>
            <boolean>false</boolean>
            <boolean>false</boolean>
            <boolean>false</boolean>
            <boolean>false</boolean>
          </groups>
          <name class="string">Katana</name>
          <style class="com.mindgene.d20.common.creature.attack.CreatureAttackStyle_2Hand"/>
          <toHit class="short">0</toHit>
        </com.mindgene.d20.common.creature.attack.CreatureAttack>
        <com.mindgene.d20.common.creature.attack.CreatureAttack>
          <abilityToDamage class="byte">0</abilityToDamage>
          <abilityToHit class="byte">0</abilityToHit>
          <attackCascading class="boolean">false</attackCascading>
          <critMinThreat class="byte">20</critMinThreat>
          <critMultiplier class="byte">2</critMultiplier>
          <damages class="list">
            <com.mindgene.d20.common.creature.attack.CreatureAttackDamage>
              <dice class="com.mindgene.d20.common.dice.Dice">
                <mod class="int">0</mod>
                <num class="int">1</num>
                <sides class="int">3</sides>
              </dice>
              <qualities class="linked-hash-set">
                <com.mindgene.d20.common.creature.attack.CreatureAttackQuality_Pierce/>
                <com.mindgene.d20.common.creature.attack.CreatureAttackQuality_Bash/>
                <com.mindgene.d20.common.creature.attack.CreatureAttackQuality_Slash/>
              </qualities>
            </com.mindgene.d20.common.creature.attack.CreatureAttackDamage>
          </damages>
          <defense class="byte">0</defense>
          <groups class="boolean-array">
            <boolean>false</boolean>
            <boolean>false</boolean>
            <boolean>false</boolean>
            <boolean>false</boolean>
            <boolean>false</boolean>
          </groups>
          <name class="string">Bite</name>
          <style class="com.mindgene.d20.common.creature.attack.CreatureAttackStyle_2Hand" reference="../../com.mindgene.d20.common.creature.attack.CreatureAttack/style"/>
          <toHit class="short">0</toHit>
        </com.mindgene.d20.common.creature.attack.CreatureAttack>
      </attacks>
      <classes class="com.mindgene.d20.common.creature.CreatureTemplate_Classes">
        <classes class="linked-hash-map">
          <entry>
            <string>Oracle</string>
            <com.mindgene.d20.common.game.creatureclass.GenericCreatureClass>
              <creature class="com.mindgene.d20.common.creature.CreatureTemplate" reference="../../../../.."/>
              <level class="byte">2</level>
              <name class="string">Oracle</name>
              <spellcasting class="com.mindgene.d20.plugin.dnd.creature.SpellCaster_Sorceror">
                <creatureClass class="com.mindgene.d20.common.game.creatureclass.GenericCreatureClass" reference="../.."/>
                <spellsCast class="byte-array">AAAAAAAAAAAAAA==</spellsCast>
                <spellsKnown class="string-array">
                  <string>Cure Light Wounds</string>
                  <string>Cause Fear</string>
                  <string>Bless</string>
                  <string>Detect Magic</string>
                  <string>Create Water</string>
                  <string>Guidance</string>
                  <string>Light</string>
                  <string>Purify Food and Drink</string>
                </spellsKnown>
              </spellcasting>
            </com.mindgene.d20.common.game.creatureclass.GenericCreatureClass>
          </entry>
        </classes>
      </classes>
      <coins class="int-array">
        <int>0</int>
        <int>113</int>
        <int>0</int>
        <int>0</int>
      </coins>
      <customDefense class="short-array">
        <short>0</short>
        <short>0</short>
        <short>0</short>
      </customDefense>
      <description class="string"></description>
      <encrypted class="boolean">false</encrypted>
      <experiencePoints class="string">4185</experiencePoints>
      <face class="java.awt.Dimension">
        <width>1</width>
        <height>1</height>
      </face>
      <facing class="int">0</facing>
      <fastHeal class="int">0</fastHeal>
      <feats class="com.mindgene.d20.common.creature.CreatureTemplate_Feats">
        <feats class="com.mindgene.d20.common.game.feat.GenericFeat-array">
          <com.mindgene.d20.common.game.feat.GenericFeat>
            <name class="string">Skill Focus: Bluff</name>
          </com.mindgene.d20.common.game.feat.GenericFeat>
        </feats>
      </feats>
      <freeformCasting class="com.mindgene.d20.common.creature.capability.CreatureCapability_FreeformCaster">
        <spellsKnown class="map">
          <entry>
            <byte>0</byte>
            <null/>
          </entry>
          <entry>
            <byte>1</byte>
            <list>
              <string>Color Spray</string>
            </list>
          </entry>
          <entry>
            <byte>2</byte>
            <null/>
          </entry>
          <entry>
            <byte>3</byte>
            <null/>
          </entry>
          <entry>
            <byte>4</byte>
            <null/>
          </entry>
          <entry>
            <byte>5</byte>
            <null/>
          </entry>
          <entry>
            <byte>6</byte>
            <null/>
          </entry>
          <entry>
            <byte>7</byte>
            <null/>
          </entry>
          <entry>
            <byte>8</byte>
            <null/>
          </entry>
          <entry>
            <byte>9</byte>
            <null/>
          </entry>
        </spellsKnown>
        <spellsMemorized class="map">
          <entry>
            <byte>0</byte>
            <null/>
          </entry>
          <entry>
            <byte>1</byte>
            <list>
              <string>Color Spray</string>
            </list>
          </entry>
          <entry>
            <byte>2</byte>
            <null/>
          </entry>
          <entry>
            <byte>3</byte>
            <null/>
          </entry>
          <entry>
            <byte>4</byte>
            <null/>
          </entry>
          <entry>
            <byte>5</byte>
            <null/>
          </entry>
          <entry>
            <byte>6</byte>
            <null/>
          </entry>
          <entry>
            <byte>7</byte>
            <null/>
          </entry>
          <entry>
            <byte>8</byte>
            <null/>
          </entry>
          <entry>
            <byte>9</byte>
            <null/>
          </entry>
        </spellsMemorized>
      </freeformCasting>
      <gameSystem class="string"></gameSystem>
      <hitDice class="string">2</hitDice>
      <imageID class="short">0</imageID>
      <initOverride class="short">-127</initOverride>
      <items class="com.mindgene.d20.common.creature.CreatureTemplate_Items">
        <items class="list">
          <com.mindgene.d20.common.item.ItemTemplate>
            <properties class="linked-hash-map">
              <entry>
                <string>name</string>
                <string>Katana</string>
              </entry>
              <entry>
                <string>weight</string>
                <float>6.0</float>
              </entry>
            </properties>
          </com.mindgene.d20.common.item.ItemTemplate>
          <com.mindgene.d20.common.item.ItemTemplate>
            <properties class="linked-hash-map">
              <entry>
                <string>name</string>
                <string>Lamellar Cuirass</string>
              </entry>
              <entry>
                <string>weight</string>
                <float>8.0</float>
              </entry>
            </properties>
          </com.mindgene.d20.common.item.ItemTemplate>
        </items>
      </items>
      <maxDexBonus class="short">4</maxDexBonus>
      <moduleName class="string">Yota</moduleName>
      <name class="string">Pezzack</name>
      <notes class="string"></notes>
      <quickNotes class="string"></quickNotes>
      <reach class="byte">1</reach>
      <regenerates class="boolean">false</regenerates>
      <saves class="byte-array">AAEG</saves>
      <size class="byte">4</size>
      <skills class="com.mindgene.d20.common.creature.CreatureTemplate_Skills">
        <skills class="com.mindgene.d20.common.game.skill.GenericSkill-array">
          <com.mindgene.d20.common.game.skill.GenericSkill>
            <ability class="byte">4</ability>
            <group class="string">General</group>
            <misc class="short">5</misc>
            <name class="string">Perception</name>
            <ranks class="short">2</ranks>
          </com.mindgene.d20.common.game.skill.GenericSkill>
          <com.mindgene.d20.common.game.skill.GenericSkill>
            <ability class="byte">1</ability>
            <group class="string">General</group>
            <misc class="short">2</misc>
            <name class="string">Stealth</name>
            <ranks class="short">0</ranks>
          </com.mindgene.d20.common.game.skill.GenericSkill>
          <com.mindgene.d20.common.game.skill.GenericSkill>
            <ability class="byte">3</ability>
            <group class="string">General</group>
            <misc class="short">4</misc>
            <name class="string">Linguistics</name>
            <ranks class="short">0</ranks>
          </com.mindgene.d20.common.game.skill.GenericSkill>
          <com.mindgene.d20.common.game.skill.GenericSkill>
            <ability class="byte">5</ability>
            <group class="string">General</group>
            <misc class="short">3</misc>
            <name class="string">Bluff</name>
            <ranks class="short">2</ranks>
          </com.mindgene.d20.common.game.skill.GenericSkill>
          <com.mindgene.d20.common.game.skill.GenericSkill>
            <ability class="byte">5</ability>
            <group class="string">General</group>
            <misc class="short">3</misc>
            <name class="string">Diplomacy</name>
            <ranks class="short">1</ranks>
          </com.mindgene.d20.common.game.skill.GenericSkill>
          <com.mindgene.d20.common.game.skill.GenericSkill>
            <ability class="byte">4</ability>
            <group class="string">General</group>
            <misc class="short">3</misc>
            <name class="string">Heal</name>
            <ranks class="short">2</ranks>
          </com.mindgene.d20.common.game.skill.GenericSkill>
          <com.mindgene.d20.common.game.skill.GenericSkill>
            <ability class="byte">3</ability>
            <group class="string">Knowledge</group>
            <misc class="short">3</misc>
            <name class="string">Knowledge (History)</name>
            <ranks class="short">1</ranks>
          </com.mindgene.d20.common.game.skill.GenericSkill>
          <com.mindgene.d20.common.game.skill.GenericSkill>
            <ability class="byte">4</ability>
            <group class="string">Craft/Perform/Profession</group>
            <misc class="short">3</misc>
            <name class="string">Profession: Gardener</name>
            <ranks class="short">1</ranks>
          </com.mindgene.d20.common.game.skill.GenericSkill>
          <com.mindgene.d20.common.game.skill.GenericSkill>
            <ability class="byte">4</ability>
            <group class="string">General</group>
            <misc class="short">3</misc>
            <name class="string">Sense Motive</name>
            <ranks class="short">2</ranks>
          </com.mindgene.d20.common.game.skill.GenericSkill>
          <com.mindgene.d20.common.game.skill.GenericSkill>
            <ability class="byte">3</ability>
            <group class="string">General</group>
            <misc class="short">3</misc>
            <name class="string">Spellcraft</name>
            <ranks class="short">2</ranks>
          </com.mindgene.d20.common.game.skill.GenericSkill>
          <com.mindgene.d20.common.game.skill.GenericSkill>
            <ability class="byte">4</ability>
            <group class="string">General</group>
            <misc class="short">3</misc>
            <name class="string">Survival</name>
            <ranks class="short">1</ranks>
          </com.mindgene.d20.common.game.skill.GenericSkill>
        </skills>
      </skills>
      <specialAbilities class="com.mindgene.d20.common.creature.CreatureTemplate_Abilities">
        <abilities class="list">
          <com.mindgene.d20.common.creature.SpecialAbility>
            <effect class="com.mindgene.d20.common.game.spell.SpellEffectTemplate">
              <duration class="int">-1</duration>
              <durationMode class="string">instant</durationMode>
              <effectModifiers class="com.mindgene.d20.common.game.effect.EffectModifiers">
                <ACModifiers class="com.mindgene.d20.common.game.effect.EffectModifierAC">
                  <armorModifier class="com.mindgene.d20.common.game.effect.EffectScoreModifier">
                    <modifier class="int">0</modifier>
                    <type class="int">2</type>
                  </armorModifier>
                  <customModifier class="com.mindgene.d20.common.game.effect.EffectScoreModifier-array">
                    <com.mindgene.d20.common.game.effect.EffectScoreModifier>
                      <modifier class="int">0</modifier>
                      <type class="int">19</type>
                    </com.mindgene.d20.common.game.effect.EffectScoreModifier>
                    <com.mindgene.d20.common.game.effect.EffectScoreModifier>
                      <modifier class="int">0</modifier>
                      <type class="int">20</type>
                    </com.mindgene.d20.common.game.effect.EffectScoreModifier>
                    <com.mindgene.d20.common.game.effect.EffectScoreModifier>
                      <modifier class="int">0</modifier>
                      <type class="int">21</type>
                    </com.mindgene.d20.common.game.effect.EffectScoreModifier>
                  </customModifier>
                  <deflectionModifier class="com.mindgene.d20.common.game.effect.EffectScoreModifier">
                    <modifier class="int">0</modifier>
                    <type class="int">5</type>
                  </deflectionModifier>
                  <dodgeModifier class="com.mindgene.d20.common.game.effect.EffectScoreModifier">
                    <modifier class="int">0</modifier>
                    <type class="int">6</type>
                  </dodgeModifier>
                  <luckModifier class="com.mindgene.d20.common.game.effect.EffectScoreModifier">
                    <modifier class="int">0</modifier>
                    <type class="int">10</type>
                  </luckModifier>
                  <naturalModifier class="com.mindgene.d20.common.game.effect.EffectScoreModifier">
                    <modifier class="int">0</modifier>
                    <type class="int">12</type>
                  </naturalModifier>
                  <shieldModifier class="com.mindgene.d20.common.game.effect.EffectScoreModifier">
                    <modifier class="int">0</modifier>
                    <type class="int">17</type>
                  </shieldModifier>
                  <unnamedModifier class="com.mindgene.d20.common.game.effect.EffectScoreModifier">
                    <modifier class="int">0</modifier>
                    <type class="int">0</type>
                  </unnamedModifier>
                </ACModifiers>
                <HPModifiers class="com.mindgene.d20.common.game.effect.EffectModifierHitPoints">
                  <bonusHP class="com.mindgene.d20.common.game.effect.EffectScoreModifier">
                    <modifier class="int">0</modifier>
                    <type class="int">0</type>
                  </bonusHP>
                  <fastHeal class="com.mindgene.d20.common.game.effect.EffectScoreModifier">
                    <modifier class="int">0</modifier>
                    <type class="int">0</type>
                  </fastHeal>
                  <tempHP class="com.mindgene.d20.common.game.effect.EffectScoreModifier">
                    <modifier class="int">0</modifier>
                    <type class="int">0</type>
                  </tempHP>
                </HPModifiers>
                <abilityScoresModifiers class="com.mindgene.d20.common.game.effect.EffectModifierAbilityScores">
                  <mods class="com.mindgene.d20.common.game.effect.EffectScoreModifier-array">
                    <com.mindgene.d20.common.game.effect.EffectScoreModifier>
                      <modifier class="int">0</modifier>
                      <type class="int">0</type>
                    </com.mindgene.d20.common.game.effect.EffectScoreModifier>
                    <com.mindgene.d20.common.game.effect.EffectScoreModifier>
                      <modifier class="int">0</modifier>
                      <type class="int">0</type>
                    </com.mindgene.d20.common.game.effect.EffectScoreModifier>
                    <com.mindgene.d20.common.game.effect.EffectScoreModifier>
                      <modifier class="int">0</modifier>
                      <type class="int">0</type>
                    </com.mindgene.d20.common.game.effect.EffectScoreModifier>
                    <com.mindgene.d20.common.game.effect.EffectScoreModifier>
                      <modifier class="int">0</modifier>
                      <type class="int">0</type>
                    </com.mindgene.d20.common.game.effect.EffectScoreModifier>
                    <com.mindgene.d20.common.game.effect.EffectScoreModifier>
                      <modifier class="int">0</modifier>
                      <type class="int">0</type>
                    </com.mindgene.d20.common.game.effect.EffectScoreModifier>
                    <com.mindgene.d20.common.game.effect.EffectScoreModifier>
                      <modifier class="int">0</modifier>
                      <type class="int">0</type>
                    </com.mindgene.d20.common.game.effect.EffectScoreModifier>
                  </mods>
                </abilityScoresModifiers>
                <attackModifiers class="com.mindgene.d20.common.game.effect.EffectModifierAttack">
                  <damageModifier class="com.mindgene.d20.common.game.effect.EffectScoreModifier">
                    <modifier class="int">0</modifier>
                    <type class="int">0</type>
                  </damageModifier>
                  <grappleModifier class="com.mindgene.d20.common.game.effect.EffectScoreModifier">
                    <modifier class="int">0</modifier>
                    <type class="int">0</type>
                  </grappleModifier>
                  <toHitModifier class="com.mindgene.d20.common.game.effect.EffectScoreModifier">
                    <modifier class="int">0</modifier>
                    <type class="int">0</type>
                  </toHitModifier>
                </attackModifiers>
                <description class="string">No description.</description>
                <notes class="string">No notes.</notes>
                <savingThrowModifiers class="com.mindgene.d20.common.game.effect.EffectModifierSaves">
                  <saves class="com.mindgene.d20.common.game.effect.EffectScoreModifier-array">
                    <com.mindgene.d20.common.game.effect.EffectScoreModifier>
                      <modifier class="int">0</modifier>
                      <type class="int">0</type>
                    </com.mindgene.d20.common.game.effect.EffectScoreModifier>
                    <com.mindgene.d20.common.game.effect.EffectScoreModifier>
                      <modifier class="int">0</modifier>
                      <type class="int">0</type>
                    </com.mindgene.d20.common.game.effect.EffectScoreModifier>
                    <com.mindgene.d20.common.game.effect.EffectScoreModifier>
                      <modifier class="int">0</modifier>
                      <type class="int">0</type>
                    </com.mindgene.d20.common.game.effect.EffectScoreModifier>
                  </saves>
                </savingThrowModifiers>
                <skillModifiers class="com.mindgene.d20.common.game.effect.EffectModifiersSkills">
                  <map class="map"/>
                </skillModifiers>
              </effectModifiers>
              <name class="string">?</name>
              <saveDC class="int">-1</saveDC>
              <saveResult class="string">?</saveResult>
              <saveType class="byte">0</saveType>
              <spellResistanceRoll class="short">0</spellResistanceRoll>
            </effect>
            <name class="string">spontaneous ability</name>
            <targetMode class="short">0</targetMode>
            <useMode class="short">0</useMode>
            <usesRemain class="short">1</usesRemain>
            <usesTotal class="short">1</usesTotal>
          </com.mindgene.d20.common.creature.SpecialAbility>
        </abilities>
      </specialAbilities>
      <speed class="byte">30</speed>
      <speeds class="com.mindgene.d20.common.creature.CreatureSpeeds">
        <mapSpeed class="linked-hash-map">
          <entry>
            <string>Normal</string>
            <int>6</int>
          </entry>
        </mapSpeed>
      </speeds>
      <spellResistance class="short">0</spellResistance>
      <status class="list"/>
      <team class="byte">1</team>
      <type class="string">Humanoid</type>
      <version class="string">3.2.901</version>
    </com.mindgene.d20.common.creature.CreatureTemplate>
     
  4. Goncyn

    Goncyn New Member

    Joined:
    Sep 24, 2012
    Messages:
    16
    Likes Received:
    0
    Thanks, guys. Looks possible but annoying ;) I will have to judge whether it's worth the effort to finish the program -- creating creatures in d20Pro is actually kinda easy so far.
     
  5. mercury00

    mercury00 New Member

    Joined:
    Aug 9, 2010
    Messages:
    55
    Likes Received:
    0
    What are you writing the program in? I was considering Java since d20pro already requires running java. But... it would be better if I could just integrate my parser into the d20pro program, but I don't know how to do that. Standalone program seems kind of silly...
     
  6. DimFuture

    DimFuture New Member

    Joined:
    Nov 17, 2015
    Messages:
    2
    Likes Received:
    0
    Has anyone worked on this? I looked at the XML and I was wondering if anyone knows how to decode the byteArray string for Abilities, Armor Class, etc...
     
  7. Wesley Gorby

    Wesley Gorby Production/Community Manager
    Staff Member

    Joined:
    Aug 1, 2011
    Messages:
    2,443
    Likes Received:
    140
    I'll try and get Mat to comment on this,, hang tight..
     
  8. thraxxis

    thraxxis Member

    Joined:
    Jul 8, 2008
    Messages:
    507
    Likes Received:
    1
    Hail and well met,

    As D20PRO is written in Java, I'll be focusing on that. Let me know if you have additional questions; I'd be happy to dive into the detail as needed. You could take the approach of synthesizing the XML format, an example of which is listed above. Then D20PRO would import it as a native file.

    The other approach is to write a Creature Import Add-on. There is a simple API to implement and it provides a way to send instantiate, populate, and pass CreatureTemplate back to the D20PRO Library. This is how Hero Lab, PCGen, and HeroSheets characters are currently imported.

    Code:
    com.mindgene.d20.common.creature.CreatureTemplate
    D20PRO uses the XStream library to encode/decode the CreatureTeaplate POJO to/from XML. Another way of saying this is the XML format is generated dynamically based off the object structure of CreatureTemplate and the various other objects and primitives it contains.

    This class is described to some degree in the API:
    http://d20pro.com/public/api/index.html


    And here is the full source for D20Rules, where most of the constants live for ability, saves, etc:

    Code:
    package com.mindgene.d20.common;
    
    import javax.swing.KeyStroke;
    
    import com.mindgene.d20.common.game.GenericEffectModel;
    import com.mindgene.d20.common.rules.Constants_ArmorClass;
    
    /**
     * D20 rules specific lookup methods and other routines that define the game.
     * 
     * @author saethi
     */
    public class D20Rules
    {
      private D20Rules()
      {
      }
    
      public static class AC implements Constants_ArmorClass
      {
        public static String getName( byte idStat )
        {
          return NAMES[idStat];
        }
    
        public static byte getID( String name )
        {
          for( byte i = 0; i < NAMES.length; i++ )
    
            if( NAMES[i].equals( name ) )
              return i;
    
          throw new IllegalArgumentException( name + " not a valid AC Mod" );
        }
      }
    
      public static class Size
      {
        public static final byte FINE = 0;
        public static final byte DIMINUTIVE = 1;
        public static final byte TINY = 2;
        public static final byte SMALL = 3;
        public static final byte MEDIUM = 4;
        public static final byte LARGE = 5;
        public static final byte HUGE = 6;
        public static final byte GARGANTUAN = 7;
        public static final byte COLOSSAL = 8;
        public static final byte COLOSSAL_PLUS = 9;
    
        public static final String[] NAMES = { "Fine", "Diminutive", "Tiny", "Small", "Medium", "Large", "Huge", "Gargantuan", "Colossal", "Colossal+" };
    
        private static byte[] MODS = { 8, 4, 2, 1, 0, -1, -2, -4, -8, -12 };
    
        public static byte getID( String name )
        {
          for( byte i = 0; i < NAMES.length; i++ )
    
            if( NAMES[i].equals( name ) )
              return i;
    
          throw new IllegalArgumentException( name + " not a valid Size" );
        }
    
        public static String getName( byte idSize )
        {
          return NAMES[idSize];
        }
    
        public static byte getMod( byte idSize )
        {
          return MODS[idSize];
        }
    
        public static int resolveSpace( byte idSize )
        {
          final int idMedium = 4;
          if( idSize <= idMedium )
            return 1;
          return idSize - idMedium + 1;
        }
    
        public static int accessGrappleMod( byte idSize )
        {
          int mod = idSize - MEDIUM;
          return mod * 4;
        }
      }
    
      public static class Ability
      {
        public static final byte STR = 0;
        public static final byte DEX = 1;
        public static final byte CON = 2;
        public static final byte INT = 3;
        public static final byte WIS = 4;
        public static final byte CHA = 5;
        public static final byte NONE = 127;
    
        public static final byte[] IDS = { STR, DEX, CON, INT, WIS, CHA };
    
        public static final String[] NAMES = { "STR", "DEX", "CON", "INT", "WIS", "CHA" };
    
        public static final String[] FULL_NAMES = { "Strength", "Dexterity", "Constitution", "Intelligence", "Wisdom", "Charisma" };
    
        public static String getName( byte idStat )
        {
          if( idStat == NONE )
            return "None";
          return NAMES[idStat];
        }
    
        public static String getFullName( byte idStat )
        {
          if( idStat == NONE )
            return "None";
          return FULL_NAMES[idStat];
        }
    
        /**
         * Gets the name of the ability by it's ID (or index, see above, e.g. STR).
         * 
         * @param name
         * @return
         */
        public static byte getID( String name )
        {
          for( byte i = 0; i < NAMES.length; i++ )
    
            if( NAMES[i].equalsIgnoreCase( name ) )
              return i;
    
          throw new IllegalArgumentException( name + " not a valid Ability" );
        }
    
        public static int getMod( int score )
        {
          if( score >= 10 )
            return (score - 10) / 2;
          return (11 - score) / -2;
        }
    
        public static int getPoints( int score )
        {
          if( score <= 8 )
            return 0;
          if( score <= 14 )
            return score - 8;
          if( score == 15 )
            return 8;
          if( score == 16 )
            return 10;
          if( score == 17 )
            return 13;
          if( score == 18 )
            return 16;
          return 16 + (score - 18) * 4;
        }
      }
    
      public static class Save
      {
        public static final byte FORT = 0;
        public static final byte REF = 1;
        public static final byte WILL = 2;
    
        public static final byte[] IDS = { FORT, REF, WILL };
    
        public static final String[] NAMES = { "Fort", "Ref", "Will" };
    
        public static final String[] FULL_NAMES = { "Fortitude", "Reflex", "Will" };
    
        public static final String NEGATES = "negates";
        public static final String HALF = "half";
        public static final String PARTIAL = "partial";
    
        public static final String[] IF_SAVED = { NEGATES, HALF };
    
        public static final String FAIL = "fail";
        public static final String SAVE = "save";
        public static final String IMMUNE = "immune";
    
        public static final String[] STATUS_CODES = { FAIL, SAVE, IMMUNE };
    
        public static String getName( byte idSave )
        {
          return NAMES[idSave];
        }
    
        public static String getFullName( byte idSave )
        {
          return FULL_NAMES[idSave];
        }
    
        public static KeyStroke getHotKey( byte idSave )
        {
          switch( idSave )
          {
          case FORT: return CommonHotKeys.Creature.SAVE_FORT;
          case REF: return CommonHotKeys.Creature.SAVE_REF;
          case WILL: return CommonHotKeys.Creature.SAVE_WILL;
          }
          throw new UnsupportedOperationException( "Unknown save: " + idSave );
        }
    
        public static byte getID( String name )
        {
          for( byte i = 0; i < NAMES.length; i++ )
    
            if( NAMES[i].equalsIgnoreCase( name ) )
              return i;
    
          throw new IllegalArgumentException( name + " not a valid Save ID" );
        }
    
        public static boolean isNegates( Object o )
        {
          return NEGATES.equals( o );
        }
      }
    
      public static class Money
      {
        public static final byte PP = 0;
        public static final byte GP = 1;
        public static final byte SP = 2;
        public static final byte CP = 3;
    
        public static final String[] NAMES = { "PP", "GP", "SP", "CP" };
    
        public static final String[] FULL_NAMES = { "Platinum", "Gold", "Silver", "Copper" };
    
        public static String getName( byte idSave )
        {
          return NAMES[idSave];
        }
    
        public static String getFullName( byte idSave )
        {
          return FULL_NAMES[idSave];
        }
      }
    
      public static class Type
      {
        public static final String[] NAMES = { "Unknown", "Aberration", "Animal", "Construct", "Dragon", "Elemental", "Fey", "Giant", "Humanoid", "Magical Beast",
            "M. Humanoid", "Ooze", "Outsider", "Plant", "Undead", "Vermin" };
      }
    
      public static class CreatureClass
      {
        public static final byte MAX_CLASS_LEVEL = 20;
      }
    
      public static class Spell
      {
        public static final byte MAX_SPELL_LEVEL = 9;
    
        /**
         * Calculates the number of bonus spells applicable for the given level for
         * the given ability score.
         */
        public static final int getBonusSpells( int spellLevel, int abilityScore )
        {
          if( spellLevel < 1 || spellLevel > MAX_SPELL_LEVEL )
            return 0;
    
          int adjustedScore = abilityScore - (spellLevel - 1) * 2 - 12;
    
          if( adjustedScore < 0 )
            return 0;
          return adjustedScore / 8 + 1;
        }
      }
    
      public static class Duration
      {
        public static final String INSTANT = "instant";
        public static final String ROUND = "round(s)";
        public static final String MINUTE = "minute(s)";
        public static final String HOUR = "hour(s)";
        public static final String DAY = "day(s)";
        public static final String INFINITE = "infinite";
    
        public static final String[] ALL = { INSTANT, ROUND, MINUTE, HOUR, DAY, INFINITE };
    
        public static int convertToRounds( int rawDuration, String mode )
        {
          if( ROUND.equals( mode ) )
            return rawDuration;
          else if( MINUTE.equals( mode ) )
            return rawDuration * 10;
          else if( HOUR.equals( mode ) )
            return rawDuration * 10 * 60;
          else if( DAY.equals( mode ) )
            return rawDuration * 10 * 60 * 24;
          else if( INFINITE.equals( mode ) )
            return GenericEffectModel.UNLIMITED;
          else
            throw new IllegalArgumentException( "unsupported mode: " + mode );
        }
    
        private static final int _MINUTE = 10;
        private static final int _HOUR = _MINUTE * 60;
        private static final int _DAY = _HOUR * 24;
    
        public static String formatRounds( int rounds )
        {
          if( rounds < 1 )
            return "instant";
    
          if( rounds == GenericEffectModel.UNLIMITED )
            return "infinite";
    
          StringBuffer msg = new StringBuffer();
          boolean needsSpace = false;
    
          int days = rounds / _DAY;
          if( days > 0 )
          {
            msg.append( days ).append( " day" );
            if( days > 1 )
              msg.append( 's' );
    
            rounds -= days * _DAY;
            needsSpace = true;
          }
    
          int hours = rounds / _HOUR;
          if( hours > 0 )
          {
            if( needsSpace )
              msg.append( ' ' );
            msg.append( hours ).append( " hour" );
            if( hours > 1 )
              msg.append( 's' );
    
            rounds -= hours * _HOUR;
            needsSpace = true;
          }
    
          int minutes = rounds / _MINUTE;
          if( minutes > 0 )
          {
            if( needsSpace )
              msg.append( ' ' );
            msg.append( minutes ).append( " minute" );
            if( minutes > 1 )
              msg.append( 's' );
    
            rounds -= minutes * _MINUTE;
            needsSpace = true;
          }
    
          if( rounds > 0 )
          {
            if( needsSpace )
              msg.append( ' ' );
            msg.append( rounds ).append( " round" );
            if( rounds > 1 )
              msg.append( 's' );
          }
    
          return new String( msg );
        }
      }
      
      public enum PowerAttack
      {
        ThreeFive( "3.5" ),
        Pathfinder( "Pathfinder" );
        
        public final String name;
        
        private PowerAttack( String name )
        {
          this.name = name;
        }
        
        @Override
        public String toString()
        {
          return name;
        }
      }
    }
    
    Code:
    /**
     * Constants for Armor Class.
     *
     * @author saethi
     */
    public interface Constants_ArmorClass
    {
      short NO_MAX_DEX = -1;
      
      byte NATURAL        = 0;
      byte ARMOR          = 1;
      byte SHIELD         = 2;
      byte DEFLECT        = 3;
      byte UNNAMED        = 4;
      byte DODGE          = 5;
    
      String[] NAMES = { "Natural", "Armor", "Shield", "Deflect", "Enhancement", "Dodge" };
    }
     
  9. DimFuture

    DimFuture New Member

    Joined:
    Nov 17, 2015
    Messages:
    2
    Likes Received:
    0
    this is great, thanks.
     
  10. TheSuperGuido

    TheSuperGuido New Member

    Joined:
    Jun 16, 2017
    Messages:
    4
    Likes Received:
    0
    Anyone have a working flat text file format (XML, or whatever) for importing creatures that is currently working? I just want to see what it looks like so I can build my own translator?
     
  11. Wesley Gorby

    Wesley Gorby Production/Community Manager
    Staff Member

    Joined:
    Aug 1, 2011
    Messages:
    2,443
    Likes Received:
    140
    as in you wish to build your own importer?
     
  12. TheSuperGuido

    TheSuperGuido New Member

    Joined:
    Jun 16, 2017
    Messages:
    4
    Likes Received:
    0
    Yeah, pretty much.
     
  13. Wesley Gorby

    Wesley Gorby Production/Community Manager
    Staff Member

    Joined:
    Aug 1, 2011
    Messages:
    2,443
    Likes Received:
    140
    I don't believe we have the Token values mapped out for that for public consumption, but I'll ask @owlbear to poke in here and see if he can offer some suggestions or more solid information.
     
  14. Wesley Gorby

    Wesley Gorby Production/Community Manager
    Staff Member

    Joined:
    Aug 1, 2011
    Messages:
    2,443
    Likes Received:
    140
  15. owlbear

    owlbear Administrator
    Staff Member

    Joined:
    Sep 5, 2011
    Messages:
    636
    Likes Received:
    160
    Hi All! Thraxxis has been working on an open source repo for the hero-lab importer which is effectively an XML parser plugin.

    Let me check in with him to see if he's ready to make that repo public.

    EDIT: HeroLab's .por files are zipped xml
     
    #15 owlbear, Dec 1, 2018
    Last edited: Dec 1, 2018

Share This Page