FelixBluestone
Member
So has anyone attempted to make custom 5e character sheets either for Hero Lab or xsl for custom output ??
Thanks in advance,
Felix
Thanks in advance,
Felix
Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
<?xml version="1.0" encoding="windows-1252"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns="http://www.w3.org/1999/xhtml" version="1.0">
<xsl:output encoding="utf-8" method="html" />
<xsl:template match="/">
<!-- Add a proper DOCTYPE declaration here, to make sure the page is rendered
properly. Firefox doesn't need this, so we make sure it doesn't get
output when we're using "Transformiix", the Firefox XSLT processor.
NOTE: This weird behaviour is only an issue if you have this stylesheet
directly linked from an XML document, i.e. if you're trying to test
it without having to tell HL to regenerate the XML file every time.
-->
<xsl:if test="system-property('xsl:vendor') != 'Transformiix'">
<xsl:text disable-output-escaping="yes">
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
</xsl:text>
</xsl:if>
<html>
<head>
<!-- XHTML requires that you specify a meta-tag to dictate the content type.
-->
<xsl:text disable-output-escaping="yes">
<meta http-equiv="Content-Type" content="text/html;charset=ISO-8859-1"/>
</xsl:text>
<style type="text/css">
/* Sans-serif fonts look nicer, so let's use one if we can find it
*/
div {
font-family: "Calibri", "Segoe UI", "Arial", Helvetica, sans-serif;
/* Show us at a fixed size to make things look good
*/
width: 325px;
padding: 2px;
/* Put a rounded border around the whole thing
*/
border: 3px solid #000000;
moz-border-radius: 8pt;
border-radius: 8pt;
background: #e9dbba;
backgroun-clip: border;
}
/* Center the title in the middle of the page in big text
*/
h1 {
text-align: center;
font-size: 10pt;
/* Margin not needed to look good
*/
margin: 0px 0px;
}
/* Hero details (gender, class, etc) can be pretty small
*/
t.herodetails {
font-size: 9pt;
}
/* Text in the attributes list should be pretty large
*/
ul.abilityscores {
font-size: 9pt;
/* Hiding the list bullets looks better
*/
list-style-type: none;
/* We're the leftmost list in the table, so remove our left padding,
otherwise the centering looks wrong
*/
padding-left: 0px;
/* Our original margin is overkill, so shrink it
*/
margin-top: 0px;
margin-bottom: 0px;
}
/* Text in the skills list should be smaller
*/
ul.skills {
font-size: 9pt;
align: left;
padding-left: 0px;
/* Hiding the list bullets looks better
*/
list-style-type: none;
}
ul.saves {
font-size: 9pt;
align: left;
padding-left: 0px;
/* Hiding the list bullets looks better
*/
list-style-type: none;
}
/* Traits in secondary lists can be smaller still
*/
t.secondary {
font-size: 10pt;
}
/* Same with gear and abilities, but the text needs decent margins set to look good
*/
p.gear, p.abilities, p.spells {
font-size: 9pt;
margin-left: 0pt;
margin-bottom: 2pt;
}
ul.attacks {
font-size: 8pt;
margin-left: 0pt;
margin-bottom: 2pt;
/* Hiding the list bullets looks better
*/
list-style-type: none;
}
/* Legal text
*/
p.legal {
text-align: center;
font-size: 8pt;
}
/* Ensure our image doesn't get too big
*/
img.portrait {
max-width: 200px;
max-height: 300px;
border: 1px solid #808080;
margin-left: 25px;
}
</style>
<!-- Page title - just find the first character and use its name -->
<title><xsl:value-of select="/document/public/character/@name"/></title>
</head>
<body>
<div>
<!-- Output all our character nodes in turn
NOTE: We use //character to ensure that we pick up minions as well, since
they're children of characters
-->
<xsl:apply-templates select="/document/public//character"/>
<!-- Standard legal text -->
<p class="legal">Hero Lab(R) and the Hero Lab logo are Registered Trademarks of LWD Technology, Inc. Free download at <a href="http://www.wolflair.com/">http://www.wolflair.com/</a>.<br/>
</p>
</div>
</body>
</html>
</xsl:template>
<!-- Quick template to insert a space somewhere, even if XSL would normally
collapse it -->
<xsl:template name="space">
<xsl:text> </xsl:text>
</xsl:template>
<!-- How to output each character in the document -->
<xsl:template match="character">
<!-- Start with a prominent header with the hero and player name in it -->
<h1>
<xsl:value-of select="@name"/>
<xsl:if test="@playername != ''">
(<xsl:value-of select="@playername"/>)
</xsl:if>
</h1>
<!-- Output various important traits in a 4-wide table - start with hero
details and ability scores -->
<t class="herodetails">
<xsl:value-of select="race/@name"/>
<xsl:call-template name="space"/>
<xsl:value-of select="personal/@gender"/>
<xsl:call-template name="space"/>
<xsl:value-of select="alignment/@name"/>
<xsl:call-template name="space"/>
<xsl:if test="classes/@summary != ''">
<xsl:call-template name="space"/>
<xsl:value-of select="classes/@summary"/>
</xsl:if>
</t>
<br/>
<!-- HP,HD,Initiative,Attack bonuses & Armor Class-->
<t class="secondary">
<strong>HP:</strong> <xsl:value-of select="health/@hitpoints"/> HP
<xsl:call-template name="space"/>
<strong> HD:</strong> <xsl:value-of select="health/@hitdice"/>
<xsl:call-template name="space"/>
<strong>Initiative:</strong> <xsl:value-of select="initiative/@total"/>
<xsl:call-template name="space"/>
<strong>Attack Bonus:</strong> <xsl:value-of select="attack/@attackbonus"/>
<xsl:call-template name="space"/>
<strong>AC:</strong> <xsl:value-of select="armorclass/@ac"/>
</t>
<hr/>
<table>
<tr>
<td>
<ul class="abilityscores">
<xsl:apply-templates select="abilityscores/abilityscore[position() <= 2]"/>
</ul>
</td>
<td>
<ul class="abilityscores">
<xsl:apply-templates select="abilityscores/abilityscore[position() >= 3 and (position() < 5)]"/>
</ul>
</td>
<td>
<ul class="abilityscores">
<xsl:apply-templates select="abilityscores/abilityscore[position() >= 5]"/>
</ul>
</td>
</tr>
</table>
<hr/>
<table>
<tr>
<!-- We put the first third of the skills in one cell, and second in the middle cell the other
third in another, because that looks good -->
<td><ul class="skills">
<xsl:apply-templates select="skills/skill[position() <= (6)]"/>
</ul></td>
<td><ul class="skills">
<xsl:apply-templates select="skills/skill[position() >= (7) and (position() < 13)]"/>
</ul></td>
<td><ul class="skills">
<xsl:apply-templates select="skills/skill[position() > (12)]"/>
</ul></td>
</tr>
</table>
<hr/>
<table>
<tr>
<td><ul class="saves">
<xsl:apply-templates select="savingthrows[position() <= (2)]"/>
</ul></td>
<td><ul class= "saves">
<xsl:apply-templates select="savingthrows[position() >= (2) and (position() < 5)]"/>
</ul></td>
<td><ul class="saves">
<xsl:apply-templates select="savingthrows[position() >= (5)]"/>
</ul></td>
</tr>
</table>
<hr/>
<!-- Abilities and attacks as simple lists underneath -->
<p class="abilities">
<strong> Feats: </strong> <xsl:apply-templates select="feats/feat | traits/trait"/>
</p>
<p class="abilities">
<strong>Special Abilities: </strong> <xsl:apply-templates select="*/special"/>
</p>
<ul class="attacks">
<xsl:apply-templates select="melee/weapon | ranged/weapon"/>
</ul>
<!-- Gear -->
<p class="gear">
<strong> Magic Items: </strong> <xsl:apply-templates select="magicitems/item"/>
</p>
<p class="gear">
<strong> Other Gear: </strong> <xsl:apply-templates select="gear/item"/>
</p>
<!-- Spells powers only listed if there are any, otherwise we get a list
with no items in it, which looks odd -->
<xsl:if test="count(spellsknown/spell | spellsmemorized/spell) != 0">
<p class="spells">
<strong> Spells: </strong> <xsl:apply-templates select="spellsknown/spell | spellsmemorized/spell"/>
</p>
</xsl:if>
<xsl:if test="count(spellbook/spell) != 0">
<p class="spells">
<strong> Spells in Spellbook: </strong> <xsl:apply-templates select="spellbook/spell"/>
</p>
</xsl:if>
<!-- And a horizontal rule to split between heroes -->
<hr/>
</xsl:template>
<!-- These simple rules match ability scores, skills etc, and display them
appropriately -->
<xsl:template match="abilityscore">
<li> <strong><xsl:value-of select="@name"/>:</strong><xsl:value-of select="abilvalue/@text"/>(<xsl:value-of select="abilbonus/@text"/>)</li>
</xsl:template>
<xsl:template match="save">
<li><xsl:value-of select="@name"/>: <strong><xsl:value-of select="@save"/></strong></li>
</xsl:template>
<xsl:template match="skill">
<li><xsl:value-of select="@name"/>:<strong>
<xsl:call-template name="space"/>
<xsl:if test="@value >= 0">+</xsl:if>
<xsl:value-of select="@value"/>
</strong></li>
</xsl:template>
<!-- Add a comma before all abilities and spells but the first -->
<xsl:template match="feat | trait | special">
<xsl:if test="position() != 1">
<xsl:text>, </xsl:text>
</xsl:if><xsl:value-of select="@name"/>
</xsl:template>
<xsl:template match="spell">
<xsl:if test="position() != 1"><xsl:text>, </xsl:text>
</xsl:if><xsl:value-of select="@name"/> (<xsl:value-of select="@level"/>)</xsl:template>
<xsl:template match="weapon">
<li><xsl:value-of select="@name"/>
(<xsl:value-of select="@attack"/> to hit), <xsl:value-of select="@damage"/> damage</li>
</xsl:template>
<!-- Add a comma before all gear but the first -->
<xsl:template match="item">
<xsl:if test="position() != 1">
<xsl:text>, </xsl:text>
</xsl:if>
<!-- Display the name and quantity - note the lack of newlines / indents
here which make it ugly, but are require to avoid introducing extra
white space which makes the output look bad -->
<xsl:value-of select="@name"/><xsl:if test="@quantity != 1">
(x<xsl:value-of select="@quantity"/>)</xsl:if></xsl:template>
<xsl:template match="image">
<img class="portrait">
<xsl:attribute name="src"><xsl:value-of select="@filename"/></xsl:attribute>
</img>
</xsl:template>
</xsl:stylesheet>
That works because you have access to the skeleton files for Savage World. 5E like most of HL game systems have those files encrypted. You have no ability to create dossiers in 5E.So this is good for xsl templates, but with systems like savage, I can code up some .user files to display customized dossiers right within the Hero Lab program. Has anyone attempted this or have samples of this as I am looking to build my own character sheets but need to know the objects to reference to pull out things such as ability scores, skills, weapons, etc. ??
Thanks in advance,
Felix
Yep, I see that now. Thanks for the confirmation.That works because you have access to the skeleton files for Savage World. 5E like most of HL game systems have those files encrypted. You have no ability to create dossiers in 5E.
Your only choice is the custom sheets using XSL.