Senior Member
Join Date: May 2013
Posts: 1,458
|
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? |
#1 |
Senior Member
Volunteer Data File Contributor
Join Date: Nov 2009
Posts: 1,505
|
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.
|
#2 |
Senior Member
Join Date: May 2013
Posts: 1,458
|
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.
|
#3 |
Senior Member
Volunteer Data File Contributor
Join Date: Nov 2009
Posts: 1,505
|
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? |
#4 |
Senior Member
Join Date: May 2013
Posts: 1,458
|
Quote:
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> Code:
<portal id="baTrait" style="tblInvis"> <table_fixed component="Derived" showtemplate="baTrtPick" showsortset="explicit" scrollable="no"> </table_fixed> </portal> 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> 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> WPR STA REF STU This doesn't match the order in thing_traits.dat, and it's not alphabetical. |
|
#5 |
Senior Member
Join Date: May 2013
Posts: 1,458
|
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.
|
#6 |
Senior Member
Volunteer Data File Contributor
Join Date: Nov 2009
Posts: 1,505
|
Just to be clear, the explicit tags you have (and setting the sort to explicit) indicates that you want the display to be
Those are the Explicit tags you have on them. |
#7 |
Senior Member
Join Date: May 2013
Posts: 1,458
|
|
#8 |
Senior Member
Join Date: May 2013
Posts: 1,458
|
I kept thinking that explicit meant the order in which they're listed. I knew better, though. I just had a mental block.
|
#9 |
Senior Member
Volunteer Data File Contributor
Join Date: Nov 2009
Posts: 1,505
|
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).
|
#10 |
|
|