Lone Wolf Development Forums  

Go Back   Lone Wolf Development Forums > Hero Lab Forums > HL - D&D 5th Edition SRD
Register FAQ Community Today's Posts Search

Notices

Reply
 
Thread Tools Display Modes
FelixBluestone
Junior Member
 
Join Date: Jul 2016
Posts: 12

Old July 20th, 2016, 10:20 AM
So has anyone attempted to make custom 5e character sheets either for Hero Lab or xsl for custom output ??

Thanks in advance,
Felix
FelixBluestone is offline   #1 Reply With Quote
Dervish
Senior Member
 
Join Date: May 2013
Location: Grand Forks ND
Posts: 130

Old July 21st, 2016, 07:31 PM
I have been playing with it made a copy of the sample output and made some mild alterations but i have not yet tried tackling an actual charactersheet
Attached Images
File Type: jpg output.JPG (59.7 KB, 38 views)
Dervish is offline   #2 Reply With Quote
Dervish
Senior Member
 
Join Date: May 2013
Location: Grand Forks ND
Posts: 130

Old July 22nd, 2016, 06:54 PM
today i worked on this tweaking where i can get it how i want it the only thing i have not been able to get to work are showing the saving throws and it is beginning to drive me crazy


here is a copy of my current statblock code its mostly just arranging it the way i like it. My hope is that i am just gettign the saving throw tag wrong or something like that and Rob or one of the other devs can point me in the right direction if they have a bit of time to look at this.


Code:
<?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">
        &lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
          "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"&gt;
        </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">
      &lt;meta http-equiv="Content-Type" content="text/html;charset=ISO-8859-1"/&gt;
        </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() &lt;= 2]"/>
          </ul>
		   </td>
		   
		   <td>
		    <ul class="abilityscores">
          <xsl:apply-templates select="abilityscores/abilityscore[position() &gt;= 3 and (position() &lt; 5)]"/>
          </ul>
		   </td>
		   
		   <td>
		    <ul class="abilityscores">
          <xsl:apply-templates select="abilityscores/abilityscore[position() &gt;= 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() &lt;= (6)]"/>
          </ul></td>
		  
		  <td><ul class="skills">
          <xsl:apply-templates select="skills/skill[position() &gt;= (7) and (position() &lt; 13)]"/>
          </ul></td>
		
		  
        <td><ul class="skills">
          <xsl:apply-templates select="skills/skill[position() &gt; (12)]"/>
          </ul></td>
		    </tr>
		  </table>
		  
		  <hr/>
		  
		  <table>
		 
		 <tr>
		  <td><ul class="saves">
          <xsl:apply-templates select="savingthrows[position() &lt;= (2)]"/>
          </ul></td>
		  
		  <td><ul class= "saves">
          <xsl:apply-templates select="savingthrows[position() &gt;= (2) and (position() &lt; 5)]"/>
          </ul></td>
		  
        <td><ul class="saves">
          <xsl:apply-templates select="savingthrows[position() &gt;= (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>
Attached Images
File Type: png Updated Custom Output.PNG (14.8 KB, 27 views)
Dervish is offline   #3 Reply With Quote
FelixBluestone
Junior Member
 
Join Date: Jul 2016
Posts: 12

Old July 25th, 2016, 03:08 PM
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
FelixBluestone is offline   #4 Reply With Quote
ShadowChemosh
Senior Member
Volunteer Data File Contributor
 
Join Date: Jan 2010
Location: Chicago, IL (USA)
Posts: 10,729

Old July 25th, 2016, 03:25 PM
Quote:
Originally Posted by FelixBluestone View Post
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
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.

Hero Lab Resources:
Pathfinder - d20pfsrd and Pathfinder Pack Setup
3.5 D&D (d20) - Community Server Setup
5E D&D - Community Server Setup
Hero Lab Help - Hero Lab FAQ, Editor Tutorials and Videos, Editor & Scripting Resources.
Created by the community for the community
- Realm Works kickstarter backer (Alpha Wolf) and Beta tester.
- d20 HL package volunteer editor.
ShadowChemosh is offline   #5 Reply With Quote
FelixBluestone
Junior Member
 
Join Date: Jul 2016
Posts: 12

Old July 25th, 2016, 03:39 PM
Quote:
Originally Posted by ShadowChemosh View Post
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.
Yep, I see that now. Thanks for the confirmation.
FelixBluestone is offline   #6 Reply With Quote
Reply


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

Forum Jump


All times are GMT -8. The time now is 05:22 PM.


Powered by vBulletin® - Copyright ©2000 - 2024, vBulletin Solutions, Inc.
wolflair.com copyright ©1998-2016 Lone Wolf Development, Inc. View our Privacy Policy here.