Any other DDI Character Builder Sheet Templates?

beverson

First Post
I've been really hoping that some XML magician would figure out how to make the character sheet look like the ones WotC used for the pregens previously. I was disturbed and mildly annoyed that the latest batch of pregens they posted were in the less attractive Character Builder format.

I thought the "general consensus" was that the old pregen format was great and lots of people would love to have the Builder make sheets like that - was I wrong, or is it just not possible yet?
 

log in or register to remove this ad

Luca

First Post
I've been really hoping that some XML magician would figure out how to make the character sheet look like the ones WotC used for the pregens previously. I was disturbed and mildly annoyed that the latest batch of pregens they posted were in the less attractive Character Builder format.

I thought the "general consensus" was that the old pregen format was great and lots of people would love to have the Builder make sheets like that - was I wrong, or is it just not possible yet?

I suggest to parse the .dnd4e files with php DOM. You can fetch datas and then reassemble the information as you like... For example I reaggregate the characters stats like this:
HTML:
<character id="1" name="Icaro Nero" owner="Alessio" flags="0">
<level xp100="56">7</level>
<deathST>3</deathST>
<status>0</status>
<ability name="str">20</ability>
<ability name="con">13</ability>
<ability name="dex">11</ability>
<ability name="int">11</ability>
<ability name="wis">18</ability>
<ability name="cha">15</ability>
<hp tmp="0" hp100="100" color="0064C8">69</hp>
<hs tot="11" sw="0">3</hs>
<defense name="ac">23</defense>
<defense name="for">22</defense>
<defense name="rfx">17</defense>
<defense name="wll">21</defense>
<initiative>3</initiative>
<speed>5</speed>
<skill name="acr">1</skill>
<skill name="arc">3</skill>
<skill name="atl">6</skill>
<skill name="blu">5</skill>
<skill name="dip">10</skill>
<skill name="dun">7</skill>
<skill name="end">2</skill>
<skill name="hea">7</skill>
<skill name="his">8</skill>
<skill name="ins">12</skill>
<skill name="int">10</skill>
<skill name="nat">7</skill>
<skill name="per">7</skill>
<skill name="rel">8</skill>
<skill name="ste">1</skill>
<skill name="str">5</skill>
<skill name="thi">1</skill>
<ap used="0">1</ap>
<power id="MELEE_BASIC_ATTACK" used="0" usage="at-will" action="Standard Action">Melee basic attack</power>
<power id="RANGED_BASIC_ATTACK" used="0" usage="at-will" action="Standard Action">Ranged basic attack</power>
<power id="833" used="0" usage="at-will" action="Standard Action">Bolstering strike</power>
<power id="805" used="0" usage="at-will" action="Minor Action">Divine challenge</power>
<power id="1566" used="0" usage="at-will" action="Minor Action">Lay on hands</power>
<power id="836" used="0" usage="at-will" action="Standard Action">Enfeebling strike</power>
<power id="1567" used="0" usage="at-will" action="Standard Action">Holy strike</power>
<power id="1746" used="0" usage="encounter" action="Minor Action">Divine mettle</power>
<power id="1747" used="0" usage="encounter" action="Minor Action">Divine strength</power>
<power id="3069" used="0" usage="encounter" action="Minor Action">Oath of enmity</power>
<power id="684" used="0" usage="encounter" action="Standard Action">Fearsome smite</power>
<power id="1568" used="0" usage="encounter" action="Standard Action">Invigorating smite</power>
<power id="3609" used="0" usage="encounter" action="Minor Action">Righteous rage of tempus</power>
<power id="1445" used="0" usage="encounter" action="Standard Action">Divine reverence</power>
<power id="2258" used="0" usage="daily" action="Standard Action">Paladin's judgment</power>
<power id="1255" used="0" usage="daily" action="Standard Action">Sacred circle</power>
<power id="1267" used="1" usage="daily" action="Standard Action">Martyr's retribution</power>
<power id="1279" used="1" usage="daily" action="Minor Action">Wrath of the gods</power>
<powers wll="7" enc="7" day="2" itm="1" />
<cash rs="0" ad="0" pp="0" gp="2391" sp="0" cp="0" />
<stored rs="" ad="" pp="" gp="" sp="" cp="" />
</character>
Then just save the new .xml file with the right .xslt to transform.
I found everything i needed on the php documentation. Anyway i'll post the function i use to access the .dnd4e file (hope this might help):
NB: looks like the forum is eating the variables... So I'll post the script replacing $ con £. REVERT IT TO MAKE THE SCRIPT RUN...!!!
Code:
// XPATH FUNCTION
   function getNodes(£myDoc,£myStr) {
      £myPath=new DOMXPath(£myDoc);
      £myPath->registerNamespace('dnd4e','http://www.wizards.com/default.asp?x=dnd/');
      £myResult=array();
      £myNodes=£myPath->query(£myStr);
      foreach(£myNodes as £node){
         array_push(£myResult,£node);
      }
      return £myResult;
   }

// MAIN SCRIPT
   £iOS="<?xml version="1.0" encoding="UTF-8"?>"; // The output XML
   £iOS.="<?xml-stylesheet type="text/xsl" href="style.xslt"?>"; // Link the XSLT file
   £iOS.="<party>";
   £iXML=new DOMDocument();
   £iCharacter=array(/* SUPPOSE TO HAVE A LIST OF YOUR CHARACTERS' IDs HERE... */)
   foreach(£iCharacter as £cid){
      £iXML->load("path/to/character{£cid}.dnd4e"); // Suppose you saved the character builder's file like character0.dnd4e, character1.dnd4e, and so on...
      // Now you just need to target the right tag on the .dnd4e file...
      // For example choose the Stat tag
      £iNodes=getNodes(,"/D20Character/CharacterSheet/StatBlock/Stat");
      foreach(£iNodes as £node){
         switch(strtolower(£node->getAttribute('name'))){
            case 'strength':
               £iOS.="<ability name="str">".£node->getAttribute('value')."</ability>";
               break;
            case 'constitution':
               £iOS.="<ability name="con">".£node->getAttribute('value')."</ability>;
               break;
            case 'dexterity':
               £iOS.="<ability name="dex">".£node->getAttribute('value')."</ability>;
               break;
            case 'intelligence':
               £iOS.="<ability name="int">".£node->getAttribute('value')."</ability>;
               break;
            case 'wisdom':
               £iOS.="<ability name="wis">".£node->getAttribute('value')."</ability>;
               break;
            case 'charisma':
               £iOS.="<ability name="cha">".£node->getAttribute('value')."</ability>;
               break;
            //and so on for every Stat tag you would like to read...
         }
         // Redo for other nodes to fetch informations from other tags (like powers)
      }
   }
   £iOS.="</party>";
   header('content-type: text/xml');
   print £iOS;
 
Last edited:

carathus

First Post
mobile browser friendly characters sheet

I am in the process of trying to come up with a mobile friendly browse version of the dnd4e character data.

you can see an example of where I am at so far here:

www.jazeffect.com.au/dnd/Wrath.xml

I will be posting updates to this page as I get closer to being happy with how it works but for now I am having fun learning XSL and struggling with the structure of the dnd4e file format.
 

Jaysue

First Post
I am in the process of trying to come up with a mobile friendly browse version of the dnd4e character data.

you can see an example of where I am at so far here:

www.jazeffect.com.au/dnd/Wrath.xml

I will be posting updates to this page as I get closer to being happy with how it works but for now I am having fun learning XSL and struggling with the structure of the dnd4e file format.

Cool stuff! just finishing reading this thread, some interesting things going on.

I've done some work (at work) on both web services dealing with XML and also creating XML documents for automated online ordering from our financial systems.

Very eager to watch you guys working on this stuff and wish I had the ...patience.. to do anything like this outside of work!
 

Arlough

Explorer
What we need vs. what we have; 1d20+5 vs. 2

To start with, I am just barely starting in on xml and not sure if I really want to bother. Listening to you wizards discuss the theoretical need for this bat guano, I am not sure I want to enroll in the academy.

That said, I think I perceive a common problem, but I can think of no solution from the user side.

Wizards doesn't seem to realize that what they have are databases. Each item, monster, power, etc. is just a stack of data with flags attached telling the location, effect, and source. They have all these aspects, but they are simulating a database in what looks and sounds to be an inelegant manner.

So, my question to you magicians of code. Can this data be consistently extracted into a database style format, with a standardized set of flags attached to the data?
I know I could do it manually, but I don't play games for their ability to make me miserable.
-Arlo
 

surfarcher

First Post
As a database professional I can tell you "yes, but".

Yes it can be extracted and loaded into a database.

However, if Wizards changes the basic structure of the file this will break the ability to import said files. And this will happen from time to time (it's one of the banes of my professional life).

Some smarts can usually built into the import software to handle this. The effictiveness of it varies a fair bit tho.
 

Remove ads

Top