Go Back   EN World D&D / RPG News > D&D 4th Edition Discussion > 4e Fan Creations and House Rules

4e Fan Creations and House Rules Working on variant powers? Statting up a PC race or your version of a monster? Creating or converting an adventure? Put it here!

 
Share LinkBack Thread Tools Display Modes
Old 3rd June 2009, 02:10 PM   #21 (permalink)
Registered User
 
beverson's Avatar
 
Join Date: Oct 2002
Location: Buffalo, NY
Posts: 240
beverson Goblin Sharpshooter (Lvl 2)
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 am the soul of honor, kindness, mercy, and goodness. Trust me in all things." Corwin to Dara, The Guns of Avalon by Roger Zelazny
beverson is offline   Reply With Quote
Old 9th June 2009, 03:42 PM   #22 (permalink)
Registered User
 
Join Date: Jun 2009
Posts: 4
Luca Kobold Slinger (Lvl 1)
Quote:
Originally Posted by beverson View 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 Code:
<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 by Luca; 9th June 2009 at 03:47 PM..
Luca is offline   Reply With Quote
Old 23rd October 2009, 05:57 AM   #23 (permalink)
Registered User
 
Join Date: Oct 2009
Posts: 1
carathus Kobold Slinger (Lvl 1)
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.
carathus is offline   Reply With Quote
Old 23rd October 2009, 01:25 PM   #24 (permalink)
Registered User
 
Join Date: May 2009
Location: Geelong, Australia
Posts: 29
Jaysue Kobold Slinger (Lvl 1)
Quote:
Originally Posted by carathus View 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!
Jaysue is offline   Reply With Quote


Bookmarks

Tags
builder, character, sheet, templates?

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


And yet another word from our sponsors
Visit Our Sponsors
Visit Our Sponsors... Again
Powered by vBadvanced CMPS v3.0.1

All times are GMT +1. The time now is 04:21 AM.


Site Contents © 2008 ENWorld
PHP Ajax Multimedia Web Framework © 2008 Digital Media Graphix
Powered by vBulletin® Version 3.8.0 Beta 1
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0

"Vault Data" powered by VaultWiki v2.5.1.
Copyright © 2008 - 2009, Cracked Egg Studios.