An archive of boards.dungeonrunners.com (2006–2010), recovered from the Wayback Machine.

Player Questions » Character XML sheets View all threads
20 of 28 known posts were recovered with their text; the rest are shown as placeholders.
 
Dadaca
Rabbit Puncher
Posts: 59
Character XML sheets
#41339 - 12/14/07 03:40 PM

Ok, maybe someone can help me here. I want to make it so that I can view a character with the item icons when I open up the character XML sheets, just so I can see what some of the items look like. Can anyone help me how to do this? I allready DL'd the .zip of the icons.

In this post http://boards.dungeonrunners.com/showflat.php?Cat=0&Number=41223&an=0&page=0#Post41223
it's stated that it's possible to "poll the data to create their own web character sheets." Can anyone tell me what that means and/or how to do it?

--------------------
A.K.A.
ThisNameTaken
Dadaca



Anson
All-Knowing Arch White Ninja
Posts: 82
Re: Character XML sheets
#41345 - 12/14/07 05:01 PM

Quote:

In this post http://boards.dungeonrunners.com/showflat.php?Cat=0&Number=41223&an=0&page=0#Post41223
it's stated that it's possible to "poll the data to create their own web character sheets." Can anyone tell me what that means and/or how to do it?




If you have your own web site, it is possible to write a web page that makes its own request to our website for character data, and then builds up the rest of the page around that information. This is usually done with web scripting languages like PHP or ASP, but could also be done in e.g. JavaScript.

At some point after the holidays, we'll have an example available (to use straight out, or to use as a starting point). Another player may have something like that out sooner, it's hard to say.



Dadaca
Rabbit Puncher
Posts: 59
Re: Character XML sheets [Re: #41345]
#41355 - 12/14/07 06:58 PM

Very nice. I look forward to it and thanks again for all the hard work and cool new features you are giving us to use.

--------------------
A.K.A.
ThisNameTaken
Dadaca



RusKrieger
Rabbit Puncher
Posts: 76
Re: Character XML sheets [Re: #41355]
#41392 - 12/14/07 11:12 PM

The quickest way to set something up would probably be to create a generic XLST [XML Style Sheet] - of course then the data would have to be cached locally and refer to the style sheet; but XLST takes less time to set up than using PHP/CGI to program a dynamic page.

There are alot of good tutorials out there though for interacting with XML data like the character 'feed' though, and you can do some amazing things if you apply yourself


Demosthenez
Rabbit Puncher
Posts: 54
Re: Character XML sheets [Re: #41392]
#41913 - 12/19/07 11:07 PM

K, I got it working clientside javascript with internet explorer. You'll need to save it locally and enable the scripting via the yellow bar on the top of your browser. Firefox is still having problem loading the external XML on the server but I'm sure there's a fix for it. Save the following files on your desktop with the filenames provided. Load searchchar.html and type the charcter name you want to look up.

On a side note, until we have an xml feed that provides all the characters this is only marginally useful. You'd also probably want to include title and level on the feed so you could do searching based on level.

Better solution would be server-side PHP, but this shows the general idea. The html on it is pretty plain, not a lot of formatting and using tables instead of css, but this shows the basic functionality.

Edited by Demosthenez (12/19/07 11:19 PM)


Demosthenez
Rabbit Puncher
Posts: 54
Re: Character XML sheets [Re: #41913]
#41914 - 12/19/07 11:09 PM

save the following as searchchar.html

<html>
<head>

<body>
<div>
<form name="charform" action="drcharacter.html" method="get">
Dungeon Runner Character Name
<input type="text" name="charname">
<input type="submit" value="See stats">
</div>
</form>
</body>
</html>

Edited by Demosthenez (12/19/07 11:12 PM)


Demosthenez
Rabbit Puncher
Posts: 54
Re: Character XML sheets [Re: #41914]
#41916 - 12/19/07 11:13 PM

save the following as drcharacter.xsl

<?xml version="1.0" encoding="ISO-8859-1"?>
<!-- Edited with XML Spy v2007 (http://www.altova.com) -->
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method='html' version='1.0' encoding='UTF-8' indent='yes'/>


<xsl:template match="/">
<html>
<body>

<h1><xsl:value-of select="/DRCharacter/Name"/></h1>
<h2>Level &#160;<xsl:value-of select="/DRCharacter/Level"/>,&#160;
<xsl:value-of select="/DRCharacter/Gender"/>&#160;
<xsl:value-of select="/DRCharacter/Title"/></h2>
<h3><xsl:value-of select="/DRCharacter/PVPWins"/>&#160;PvP Wins</h3>

<table>
<tr style="vertical-align:top;text-align:center;">
<td>
<h2>Attributes</h2>
<table border="1">
<tr>
<td>&#160;</td>
<td>Innate</td>
<td>Effective</td>
</tr>
<tr>
<td>Strength:</td>
<td><xsl:value-of select="/DRCharacter/Attributes/Strength/Innate"/></td>
<td><xsl:value-of select="/DRCharacter/Attributes/Strength/Effective"/></td>
</tr>
<tr>
<td>Agility:</td>
<td><xsl:value-of select="/DRCharacter/Attributes/Agility/Innate"/></td>
<td><xsl:value-of select="/DRCharacter/Attributes/Agility/Effective"/></td>
</tr>
<tr>
<td>Endurance:</td>
<td><xsl:value-of select="/DRCharacter/Attributes/Endurance/Innate"/></td>
<td><xsl:value-of select="/DRCharacter/Attributes/Endurance/Effective"/></td>
</tr>
<tr>
<td>Intelligence:</td>
<td><xsl:value-of select="/DRCharacter/Attributes/Intellect/Innate"/></td>
<td><xsl:value-of select="/DRCharacter/Attributes/Intellect/Effective"/></td>
</tr>
</table>
</td>
&#160;
<td>
<h2>Appearance</h2>
<table border="1">
<tr>
<td>Face</td>
<td><xsl:value-of select="/DRCharacter/Appearance/Face"/></td>
</tr>
<tr>
<td>Hair Style:</td>
<td><xsl:value-of select="/DRCharacter/Appearance/Hair"/></td>
</tr>
<tr>
<td>Hair Color:</td>
<td><xsl:value-of select="/DRCharacter/Appearance/HairColor"/></td>
</tr>
<tr>
<td>Hair:</td>
<td><xsl:value-of select="/DRCharacter/Appearance/Hair"/></td>
</tr>
</table>
</td>
</tr>
</table>
<br/>
<h2>Combat</h2>
<table>
<tr style="vertical-align:top;text-align:center;">
<td>
<!-- http://www.dungeonrunners.com/images/icons/scroll_battlePlan.png -->
<h3>Skills</h3>
<table border="1">
<tr>
<td>&#160;</td>
<td>Skill</td>
<td>Level</td>
</tr>
<xsl:for-each select="DRCharacter/Skills/Skill">
<tr>
<td><img
src="{concat('http://www.dungeonrunners.com/images/icons/', Icon, '.png')}"
width="32"
height="32"
/></td>
<td><xsl:value-of select="Name"/></td>
<td><xsl:value-of select="Level"/></td>

</tr>
</xsl:for-each>
</table>
</td>
&#160;
<td>
<h3>Weapon</h3>
<table border="1">
<tr>
<td>&#160;</td>
<td>Primary</td>
<td>Secondary</td>
</tr>
<tr>
<td>Attack Rating:</td>
<td><xsl:value-of select="/DRCharacter/Combat/Weapon[1]/AttackRating"/></td>
<td><xsl:value-of select="/DRCharacter/Combat/Weapon[2]/AttackRating"/></td>
</tr>
<tr>
<td>Minimum Damage:</td>
<td><xsl:value-of select="/DRCharacter/Combat/Weapon[1]/MinDamage"/></td>
<td><xsl:value-of select="/DRCharacter/Combat/Weapon[2]/MinDamage"/></td>
</tr>
<tr>
<td>Maximum Damage:</td>
<td><xsl:value-of select="/DRCharacter/Combat/Weapon[1]/DamageMax"/></td>
<td><xsl:value-of select="/DRCharacter/Combat/Weapon[2]/DamageMax"/></td>
</tr>
<tr>
<td>Average Damage:</td>
<td><xsl:value-of select=".5 * (/DRCharacter/Combat/Weapon[1]/DamageMax +
/DRCharacter/Combat/Weapon[1]/MinDamage)"/></td>
<td><xsl:value-of select=".5 * (/DRCharacter/Combat/Weapon[2]/DamageMax +
/DRCharacter/Combat/Weapon[2]/MinDamage)"/></td>
</tr>
</table>
</td>
&#160;
<td>
<h3>Elemental</h3>
<table border="1">
<tr>
<td>&#160;</td>
<td>Bonus</td>
<td>Resist</td>
</tr>
<tr>
<td>Fire:</td>
<td><xsl:value-of select="/DRCharacter/Combat/ElementBonuses/Fire"/></td>
<td><xsl:value-of select="/DRCharacter/Combat/ElementResistances/Fire"/></td>
</tr>
<tr>
<td>Ice:</td>
<td><xsl:value-of select="/DRCharacter/Combat/ElementBonuses/Ice"/></td>
<td><xsl:value-of select="/DRCharacter/Combat/ElementResistances/Ice"/></td>
</tr>
<tr>
<td>Poison:</td>
<td><xsl:value-of select="/DRCharacter/Combat/ElementBonuses/Poison"/></td>
<td><xsl:value-of select="/DRCharacter/Combat/ElementResistances/Poison"/></td>
</tr>
<tr>
<td>Shadow:</td>
<td><xsl:value-of select="/DRCharacter/Combat/ElementBonuses/Shadow"/></td>
<td><xsl:value-of select="/DRCharacter/Combat/ElementResistances/Shadow"/></td>
</tr>
<tr>
<td>Divine:</td>
<td><xsl:value-of select="/DRCharacter/Combat/ElementBonuses/Divine"/></td>
<td><xsl:value-of select="/DRCharacter/Combat/ElementResistances/Divine"/></td>
</tr>
</table>
</td>
</tr>
</table>



<h2>Equipment</h2>
<table border="1">
<tr>
<td>&#160;</td>
<td>Skill</td>
<td>Level</td>
<td>Quality</td>
<td>Soulbound</td>
<td>Modifiers</td>
</tr>
<xsl:for-each select="DRCharacter/Equipment/Item">
<tr>
<td><img
src="{concat('http://www.dungeonrunners.com/images/icons/', Icon, '.png')}"
/></td>
<td><xsl:value-of select="Name"/></td>
<td><xsl:value-of select="Level"/></td>
<td><xsl:value-of select="Quality"/></td>
<td><xsl:value-of select="SoulBound"/></td>

<td><xsl:for-each select="Mod">
<xsl:value-of select="."/><br/>
</xsl:for-each>
</td>


</tr>
</xsl:for-each>
</table>


</body>
</html>
</xsl:template>
</xsl:stylesheet>


Demosthenez
Rabbit Puncher
Posts: 54
Re: Character XML sheets [Re: #41916]
#41917 - 12/19/07 11:16 PM

this file won't post on just 1 post I guess a character limit, save the rest of this post and the next one as drcharacter.html

<html>
<head>
<script>
function loadXMLDoc(fname)
{
var xmlDoc;
// code for IE
if (window.ActiveXObject)
{
xmlDoc=new ActiveXObject("Microsoft.XMLDOM");
}
// code for Mozilla, Firefox, Opera, etc.
else if (document.implementation
&& document.implementation.createDocument)
{
xmlDoc=document.implementation.createDocument("","",null);
}
else
{
alert('Your browser cannot handle this script');
}
xmlDoc.async=false;
xmlDoc.load(fname);
return(xmlDoc);
}

function gup( name )
{
name = name.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]");
var regexS = "[\\?&]"+name+"=([^&#]*)";
var regex = new RegExp( regexS );
var results = regex.exec( window.location.href );
//document.write(results);
if( results == null )
return "";
else
return results[1];
}


function displayResult()
{

var charpath = "http://dungeonrunners.com/characters/";
//var charpath = "";
var character = gup('charname');
//document.write(character);
//document.write(charpath + character);
xml=loadXMLDoc(charpath + character);
// if (character == null) {
// }
// else {
// xml=loadXMLDoc("lol");
// }

//xml=loadXMLDoc("lol");
xsl=loadXMLDoc("drcharacter.xsl");


Demosthenez
Rabbit Puncher
Posts: 54
Re: Character XML sheets [Re: #41917]
#41918 - 12/19/07 11:17 PM


// code for IE
if (window.ActiveXObject)
{
ex=xml.transformNode(xsl);
document.getElementById("example").innerHTML=ex;
}
// code for Mozilla, Firefox, Opera, etc.
else if (document.implementation
&& document.implementation.createDocument)
{
xsltProcessor=new XSLTProcessor();
xsltProcessor.importStylesheet(xsl);
resultDocument = xsltProcessor.transformToFragment(xml,document);
document.getElementById("example").appendChild(resultDocument);
}
document.append("foo");
}
</script>
</head>
<body id="example" onLoad="displayResult()">
<!-- this isn't appearing in ie since nothing is being processed after the xml load -->
<div>
<form name="charform" action="drcharacter.html" method="get">
Dungeon Runner Character Name
<input type="text" name="charname">
<input type="submit" value="See stats">
</div>
</form>
</body>
</html>


Legendrunner
Veteran
Posts: 702
Re: Character XML sheets [Re: #41918]
#41922 - 12/20/07 02:04 AM

Intresting, will try it when Im home after school. It looks good so far

--------------------
LegendRunner - level 100 Ace something

The Townstons Wiki Archive! - Boss of TT
Dont Feed The Trolls! (Avatar)
"I've become stoned by the pots, dont mind me." - Famous Quote



Anson
All-Knowing Arch White Ninja
Posts: 82
Re: Character XML sheets [Re: #41913]
#41923 - 12/20/07 02:16 AM

Quote:

On a side note, until we have an xml feed that provides all the characters this is only marginally useful.




I'm not sure what uses you have in mind when you say that. Do you mean a single XML document with everyone? That's not planned, at least partially because a single XML document with all of the characters would be enormous.

Quote:

You'd also probably want to include title and level on the feed so you could do searching based on level.




We're not currently planning on providing that kind of searching. Again, the size of such an XML document would be prohibitive: just the list of level 100s would be between 10 and 50 MB.

Quote:

Better solution would be server-side PHP, but this shows the general idea. The html on it is pretty plain, not a lot of formatting and using tables instead of css, but this shows the basic functionality.




For anyone that wants to try it, using PHP with curl and SimpleXML will do pretty much all of the work - e.g.:
Code:
<?
$char_name = $_GET['name'];
$ch = curl_init("http://www.dungeonrunners.com/characters/$char_name");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$char_xml = curl_exec($ch);
curl_close($ch);
$character = new SimpleXMLElement($char_xml);
print "Hello " . $character->{'Name'};
?>

I hope that helps to jumpstart someone



Demosthenez
Rabbit Puncher
Posts: 54
Re: Character XML sheets [Re: #41923]
#41925 - 12/20/07 02:48 AM

Quote:


by demosthenez
On a side note, until we have an xml feed that provides all the characters this is only marginally useful.

You'd also probably want to include title and level on the feed so you could do searching based on level.




Quote:


by Anson
I'm not sure what uses you have in mind when you say that. Do you mean a single XML document with everyone? That's not planned, at least partially because a single XML document with all of the characters would be enormous.

We're not currently planning on providing that kind of searching. Again, the size of such an XML document would be prohibitive: just the list of level 100s would be between 10 and 50 MB.





An xml list of all character would only be big if you included all the character information. I'm just thinking of a list with the Name, Level and possibly Title/PVPWins (see below). This would require only around 150 bytes per character. To get a 10mb file, there would have to be over 700,000 dr characters. If you only included name and level, it would only use about half the space.

The xml query-able version of the list wouldn't have to be hosted on the dungeonrunners.com server, it could just be generated on a semi-regular basis and posted in a .zip so other sites could use this as a DB to query chracters. I don't know if NCSoft wants to do this but xml character data is a lot more fun when it can be browsed at the top level.

Sample excertps of xml character list:

<DRCharacterList>

<DRCharacter Version="1">
<Name>Anson</Name>
<Level>39</Level>
<Title>Dexterous Practiced Poison Ranger</Title>
<PVPWins>13</PVPWins>
</DRCharacter>

<DRCharacter Version="1">
<Name>demosthenez</Name>
<Level>100</Level>
<Title>Gifted Arch Shadow Wizard</Title>
<PVPWins>0</PVPWins>
</DRCharacter>

<DRCharacter Version="1">
<Name>LolMageLol</Name>
<Level>60</Level>
<Title>Genius Distinguished Shadow Wizard</Title>
<PVPWins>0</PVPWins>
</DRCharacter>

</DRCharacterList>


Edited by Demosthenez (12/20/07 03:05 AM)


Demosthenez
Rabbit Puncher
Posts: 54
Re: Character XML sheets [Re: #41925]
#41926 - 12/20/07 02:50 AM

Sample snapshot of Anson using scripts posted previously:
http://demosthenez.110mb.com/anson.html

Download-able scripts to view characters from your desktop
Just double click on searchar.html and type the name of the character you want to view. Requires IE6 and you'll need to click the yellow bar to enable scripting.
http://demosthenez.110mb.com/searchchar.html

http://demosthenez.110mb.com/drcharacter.xsl

http://demosthenez.110mb.com/drcharacter.html

Edited by Demosthenez (12/20/07 03:50 AM)


Anson
All-Knowing Arch White Ninja
Posts: 82
Re: Character XML sheets [Re: #41925]
#41927 - 12/20/07 03:31 AM

Quote:

I'm just thinking of a list with the Name, Level and possibly Title/PVPWins (see below). This would require only around 150 bytes per character. To get a 10mb file, there would have to be over 700,000 dr characters.



You're off by an order of magnitude: 70,000 characters at 150 bytes apiece would come out to almost precisely 10MB.

It's a too far past my bedtime for me to adequately respond to the rest of your post, except to say that we're still exploring all the possibilities.



Demosthenez
Rabbit Puncher
Posts: 54
Re: Character XML sheets [Re: #41927]
#41928 - 12/20/07 03:51 AM

Quote:

Quote:

I'm just thinking of a list with the Name, Level and possibly Title/PVPWins (see below). This would require only around 150 bytes per character. To get a 10mb file, there would have to be over 700,000 dr characters.



You're off by an order of magnitude: 70,000 characters at 150 bytes apiece would come out to almost precisely 10MB.




Um. Yes, I am off by a factor of 10.
Yeah, 70k characters for 10mb can get big really fast, especially when its being re-loaded a lot. Characters online would be a much more manageable list, or 1 list per lvl. The more features, esp. querying really points towards a database-centered approach and that adds a whole new level of complexity and security.


Edited by Demosthenez (12/20/07 03:59 AM)


Legendrunner
Veteran
Posts: 702
Re: Character XML sheets [Re: #41928]
#41930 - 12/20/07 07:30 AM

Owh I am doing something wrong, when typing in the name it refreshes and shows nothing then the search option again.

--------------------
LegendRunner - level 100 Ace something

The Townstons Wiki Archive! - Boss of TT
Dont Feed The Trolls! (Avatar)
"I've become stoned by the pots, dont mind me." - Famous Quote



Dadaca
Rabbit Puncher
Posts: 59
Re: Character XML sheets [Re: #41930]
#41937 - 12/20/07 08:14 AM

I am having the same problem as you Legendrunner.

--------------------
A.K.A.
ThisNameTaken
Dadaca



Demosthenez
Rabbit Puncher
Posts: 54
Re: Character XML sheets [Re: #41937]
#41947 - 12/20/07 09:17 AM

Are you using internet explorer 6 and are you clicking the yellow bar at the top to allow blocked content?


Legendrunner
Veteran
Posts: 702
Re: Character XML sheets [Re: #41947]
#41952 - 12/20/07 09:29 AM

1. I get no warning for ActiveX (As thats it if Im correct) or anything else.
2. My internet explorer version is 7.0.5730.11, to be exact.

--------------------
LegendRunner - level 100 Ace something

The Townstons Wiki Archive! - Boss of TT
Dont Feed The Trolls! (Avatar)
"I've become stoned by the pots, dont mind me." - Famous Quote



Demosthenez
Rabbit Puncher
Posts: 54
Re: Character XML sheets [Re: #41952]
#41956 - 12/20/07 09:54 AM

You have all 3 files in the same directory?


Rainger
Chicken Hawk
Re: Character XML sheets
#41958 - 12/20/07 10:25 AM

[content not captured by the Wayback Machine — post known from thread listings only]


Legendrunner
Dungeon Walker
Re: Character XML sheets [Re: #41956]
#41965 - 12/20/07 11:57 AM

[content not captured by the Wayback Machine — post known from thread listings only]


Demosthenez
Rabbit Puncher
Re: Character XML sheets [Re: #41965]
#41985 - 12/20/07 05:36 PM

[content not captured by the Wayback Machine — post known from thread listings only]


Demosthenez
Rabbit Puncher
Re: Character XML sheets [Re: #41985]
#42016 - 12/21/07 02:23 AM

[content not captured by the Wayback Machine — post known from thread listings only]


Snarky
Chicken Hawk
Re: Character XML sheets
#42157 - 12/22/07 11:59 PM

[content not captured by the Wayback Machine — post known from thread listings only]


Demosthenez
Rabbit Puncher
Re: Character XML sheets
#42777 - 01/01/08 06:01 AM

[content not captured by the Wayback Machine — post known from thread listings only]


Auguste Re: Character XML sheets [Re: #42016]
#43641 - 01/10/08 05:30 AM

[content not captured by the Wayback Machine — post known from thread listings only]


Demosthenez
Rabbit Puncher
Re: Character XML sheets [Re: #43641]
#43654 - 01/10/08 11:18 AM

[content not captured by the Wayback Machine — post known from thread listings only]


 
All times are US Eastern, the board's original clock (vBulletin-era times converted from GMT).
Jump to