Lone Wolf Development Forums  

Go Back   Lone Wolf Development Forums > Hero Lab Forums > HL - Authoring Kit

Notices

Reply
 
Thread Tools Display Modes
EightBitz
Senior Member
 
Join Date: May 2013
Posts: 1,458

Old September 21st, 2017, 11:45 PM
When I started working in Chill, I defaulted to listing the primary attributes in alphabetical order. I did not lost the derived traits in alphabetical order, but I don't recall why. Still, the reason isn't important.

Now, I'm working on some cosmetic changes to more closely match how things are listed on the official character sheet.

I edited thing_attributes.dat, and simply changed the order of the attribute things. I reopened Hero Lab, and the order in which the attributes were now listed matched the changes I made in the .dat file.

I then similarly edited thing_traits.dat. I reopened Hero Lab, and the order of the derived traits was no different than before. The order of appearance did not match my changes, nor was in alphabetical.

I have no idea what's determining the order in which the derived traits are listed. Is it supposed to match the order in which I list them in the file?
EightBitz is offline   #1 Reply With Quote
Duggan
Senior Member
Volunteer Data File Contributor
 
Join Date: Nov 2009
Posts: 1,444

Old September 22nd, 2017, 03:32 AM
Assuming you're using a table to display them, it's based on the sortset (which does default to alphabetical). If you're explicitly building individual portals, it is of course according to how you did your position section.
Duggan is offline   #2 Reply With Quote
EightBitz
Senior Member
 
Join Date: May 2013
Posts: 1,458

Old September 22nd, 2017, 06:38 AM
Quote:
Originally Posted by Duggan View Post
Assuming you're using a table to display them, it's based on the sortset (which does default to alphabetical). If you're explicitly building individual portals, it is of course according to how you did your position section.
That's the thing, though. It's not alphabetical. It's maintaining my original order, like it's cached it and won't let go.
EightBitz is offline   #3 Reply With Quote
Duggan
Senior Member
Volunteer Data File Contributor
 
Join Date: Nov 2009
Posts: 1,444

Old September 22nd, 2017, 06:42 AM
Oh man... I wish I could get it to do that on some of mine. :-P

Can you provide the code for how you're displaying it?
Duggan is offline   #4 Reply With Quote
EightBitz
Senior Member
 
Join Date: May 2013
Posts: 1,458

Old September 22nd, 2017, 09:21 AM
Quote:
Originally Posted by Duggan View Post
Oh man... I wish I could get it to do that on some of mine. :-P

Can you provide the code for how you're displaying it?
thing_traits.dat
Code:
<document signature="Hero Lab Data">

  <!-- Stamina Trait -->
  <thing
    id="trSta"
    name="Stamina"
    compset="Trait"
    isunique="yes"
    description="\n\n{b}Source:{/b} Core Rulebook">
    <fieldval field="trtAbbrev" value="STA"/>
    <tag group="explicit" tag="2"/>
    <tag group="User" tag="Combat"/>
    <tag group="DashTacCon" tag="Combat"/>
    <tag group="DashTacCon" tag="Traits"/>

    <!-- Calculate the Initiative trait as appropriate -->
    <eval value="1" phase="Traits" priority="4000">
      <before name="Derived trtFinal"/>
      <after name="Calc trtFinal"/><![CDATA[
      var val as number
      val = (#trait[attrAgl] + #trait[attrStr])/2
      field[trtBonus].value = round(val,0,0)
      ]]></eval>
    </thing>

  <!-- Willpower Trait -->
  <thing
    id="trWill"
    name="Willpower"
    compset="Trait"
    isunique="yes"
    description="\n\n{b}Source:{/b} Core Rulebook">
    <fieldval field="trtAbbrev" value="WPR"/>
    <tag group="explicit" tag="1"/>
    <tag group="User" tag="Combat"/>
    <tag group="DashTacCon" tag="Combat"/>
    <tag group="DashTacCon" tag="Traits"/>

    <!-- Calculate the Willpower trait as appropriate -->
    <eval value="1" phase="Traits" priority="4000">
      <before name="Derived trtFinal"/>
      <after name="Calc trtFinal"/><![CDATA[
      var val as number
      val = (#trait[attrFoc] + #trait[attrPsy])/2
      field[trtBonus].value = round(val,0,0)
      ]]></eval>
    </thing>

  <!-- Reflexes Trait -->
  <thing
    id="trReflex"
    name="Reflexes"
    compset="Trait"
    isunique="yes"
    description="\n\n{b}Source:{/b} Core Rulebook">
    <fieldval field="trtAbbrev" value="REF"/>
    <tag group="explicit" tag="3"/>
    <tag group="User" tag="Combat"/>
    <tag group="DashTacCon" tag="Combat"/>

    <!-- Calcualte the Defense trait as appropriate -->
    <eval value="1" phase="Traits" priority="4000">
      <before name="Derived trtFinal"/>
      <after name="Calc trtFinal"/><![CDATA[
      var val as number
      val = (#trait[attrDex] + #trait[attrPcn])/2
      field[trtBonus].value = round(val,0,0)
      ]]></eval>
    </thing>

  <!-- Sense The Unknown Trait -->
  <thing
    id="trSense"
    name="Sense the Unknown"
    compset="Trait"
    isunique="yes"
    description="\n\n{b}Source:{/b} Core Rulebook">
    <fieldval field="trtAbbrev" value="STU"/>
    <tag group="explicit" tag="4"/>
    <tag group="User" tag="Combat"/>
    <tag group="DashTacCon" tag="Combat"/>

    <!-- Calculate the Power Points trait as appropriate -->
    <eval value="1" phase="Traits" priority="4000">
      <before name="Derived trtFinal"/>
      <after name="Calc trtFinal"/><![CDATA[
      var val as number
      val = #trait[attrPcn]/5
      field[trtBonus].value = round(val,0,0)
      ]]></eval>
    </thing>

  </document>
baTrait portal from tab_basics.dat
Code:
  <portal
    id="baTrait"
    style="tblInvis">
    <table_fixed
      component="Derived"
      showtemplate="baTrtPick"
      showsortset="explicit"
      scrollable="no">
      </table_fixed>
    </portal>
baTrtPick template from tab_basics.dat
Code:
  <template
    id="baTrtPick"
    name="Trait Pick"
    compset="Trait"
    marginhorz="16"
    marginvert="3">

    <portal
      id="name"
      style="lblSecond"
      showinvalid="yes">
      <label
        field="name">
        </label>
      </portal>

    <portal
      id="abbrev"
      style="lblXLarge"
      showinvalid="yes">
      <label
        field="trtAbbrev">
        </label>
      </portal>

    <portal
      id="details"
      style="lblXLarge">
      <label>
        <labeltext><![CDATA[
          @text = field[trtFinal].text
          ]]></labeltext>
        </label>
      <mouseinfo><![CDATA[
        ~insert appropriate code to explain how the trait was derived
        @text = "???"
        ]]></mouseinfo>
      </portal>

    <portal
      id="info"
      style="actInfo">
      <action
        action="info">
        </action>
      </portal>

    <position><![CDATA[
      ~set up our height based on our tallest portal
      height = portal[name].height + 10

      ~if this is a "sizing" calculation, we're done
      doneif (issizing <> 0)

      ~position our tallest portal at the top
      portal[info].top = 0

      ~center the other portals vertically
      perform portal[name].centervert
      perform portal[abbrev].centervert
      perform portal[details].centervert
      perform portal[info].centervert

      ~position the info portal on the far right
      perform portal[info].alignedge[right,-215]

      ~position the name on the left and give it some reasonable space
      ~portal[name].left = 0
      ~portal[name].width = 135

      ~position the details to the right of the name and the left of the info portal
      portal[details].width = 50
      portal[abbrev].width = 50
      perform portal[details].alignrel[rtol,info,-10]
      perform portal[abbrev].alignrel[rtol,details,0]
      perform portal[name].alignrel[rtol,abbrev,-10]
      
      portal[details].width = portal[info].left - portal[details].left - 10
      
      ]]></position>

    </template>
basics layout from tab_basics.dat
Code:
  <layout
    id="basics">
    <portalref portal="baAttrib" taborder="10"/>
    <portalref portal="baTrait" taborder="20"/>
    <portalref portal="Horizontal"/>

    <!-- This script sizes and positions the layout and its child visual elements. -->
    <position><![CDATA[
      ~size and position the attributes table in the top left; we set the height to
      ~the full layout height, but the table will only use the space it needs
      portal[baAttrib].width = width
      portal[baAttrib].left = 0
      portal[baAttrib].height = height

      ~set the separator width and position it beneath the attributes
      portal[Horizontal].width = portal[baAttrib].width - 30
      portal[Horizontal].top = portal[baAttrib].bottom + 15
      portal[Horizontal].left = portal[baAttrib].left + (portal[baAttrib].width - portal[Horizontal].width) / 2

      ~size and position the traits table beneath the separator; we set the height
      ~the the full layout height, but the table will only use the space it needs
      portal[baTrait].width = portal[baAttrib].width
      portal[baTrait].left = portal[baAttrib].left
      portal[baTrait].top = portal[Horizontal].bottom + 15
      portal[baTrait].height = height - portal[baTrait].top

      ~figure out the total height we need for the tab
      height = portal[baTrait].bottom
      ]]></position>
The order of display for the traits is:
WPR
STA
REF
STU

This doesn't match the order in thing_traits.dat, and it's not alphabetical.
EightBitz is offline   #5 Reply With Quote
EightBitz
Senior Member
 
Join Date: May 2013
Posts: 1,458

Old September 22nd, 2017, 09:24 AM
The current display matches the ORIGINAL order in which I listed them in thing_traits.dat. But after I changed the order, the display did not follow suit.
EightBitz is offline   #6 Reply With Quote
Duggan
Senior Member
Volunteer Data File Contributor
 
Join Date: Nov 2009
Posts: 1,444

Old September 22nd, 2017, 09:35 AM
Just to be clear, the explicit tags you have (and setting the sort to explicit) indicates that you want the display to be
  1. WPR
  2. STA
  3. REF
  4. STU

Those are the Explicit tags you have on them.
Duggan is offline   #7 Reply With Quote
EightBitz
Senior Member
 
Join Date: May 2013
Posts: 1,458

Old September 22nd, 2017, 09:37 AM
Quote:
Originally Posted by Duggan View Post
Just to be clear, the explicit tags you have (and setting the sort to explicit) indicates that you want the display to be
  1. WPR
  2. STA
  3. REF
  4. STU

Those are the Explicit tags you have on them.
*facepalm*
EightBitz is offline   #8 Reply With Quote
EightBitz
Senior Member
 
Join Date: May 2013
Posts: 1,458

Old September 22nd, 2017, 09:39 AM
Quote:
Originally Posted by Duggan View Post
Just to be clear, the explicit tags you have (and setting the sort to explicit) indicates that you want the display to be
  1. WPR
  2. STA
  3. REF
  4. STU

Those are the Explicit tags you have on them.
I kept thinking that explicit meant the order in which they're listed. I knew better, though. I just had a mental block.
EightBitz is offline   #9 Reply With Quote
Duggan
Senior Member
Volunteer Data File Contributor
 
Join Date: Nov 2009
Posts: 1,444

Old September 22nd, 2017, 09:42 AM
Quote:
Originally Posted by EightBitz View Post
I kept thinking that explicit meant the order in which they're listed. I knew better, though. I just had a mental block.
It would nice if there were an option for that. I currently have an issue with one of my lists where, depending on user input, the items can shift locations, because internally, part of the name is changing. And explicit isn't an option because the items are user-added (or via the editer).
Duggan is offline   #10 Reply With Quote
Reply

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

Forum Jump


All times are GMT -8. The time now is 10:05 AM.


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