Dungeon Runners Character Sheet Library
I took the past week off work for a final Spring Break, since I graduated early. When the friends visiting me left a day early I decided to use Friday to catch up on my programming. My goal was to finally create a library for people wishing to create character sheets for Dungeon Runners (that popular MMO I’ve been playing about once a month). The result is DRCSL, the Dungeon Runners Character Sheet Library, which gives web site owners an easy way to create character sheets or just pull random character data quickly. I used the DRCSL this morning to create a quick MediaWiki extension that spits out a pre-formatted character sheet. Lets discuss:
DRCSL
DRCSL is a php library written using PHP 5 and PHP objects. At its core it is currently just one file, Character.php, that upon its creation fetches the character XML from NCSoft’s servers, and stores all the data. Once the data is stored, the Character can spit out its information with just a few commands. What’s required to use this library is a web server with PHP 5 on it, along with wget to fetch the XML. A default Linux PHP install works just fine, though if your host blocks exec() callouts you’re out of luck. I’m on my first release, so the paths are hard coded for Linux delimiters which will be fixed in the future (of course, the Windows host will still need wget installed).
An example:
<?php
//Include this file to have it include everything ya need.
include "drcsl.php";
//Create a new Character
$billy = new Character("Segfault");
//Store the character's name
$name = $billy->get_char_info("Name");
//Store the character's title
$title = $billy->get_char_info("Title");
//Display some info
echo "$name is a $title\\n";
?>
This would print something to the effect of:
“Segfault is a Coordinated Practiced Poison Ranger”
MediaWiki Extension
The MWE became real easy after I created the DRCSL. Rather than include a ton of the code from my Character Viewer into the Extension, now all I had to do was include drcsl.php and come up with a default view. It looks something like this, by the way. In all it took about an hour from the time I woke up this morning and decided to finally create one to having a test version out for TheTownstons to test.
To use the MWE one just creates a page and includes the drcsl function.
{{ #drcsl: Segfault }}
Further Reading
More details on both of these projects can be found at the DRCSL website. I was going to write more but there’s something bugging in my Code Highlighter plugin (hence why the code looks like non-highlighted junk) and I’m fighting the urge to go fix it.