Lone Wolf Development Forums  

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

Notices

Reply
 
Thread Tools Display Modes
Duggan
Senior Member
Volunteer Data File Contributor
 
Join Date: Nov 2009
Posts: 1,502

Old August 20th, 2017, 04:02 PM
So, this may be a gimme thing, but I'm implementing the optional bits in the Planet Mercenary background and Command Packages where a given Command Package might have "+2 to Inspire or Entertain". I copied the code from 4E and how they allow races to apply a bonus to one ability for another, but I couldn't understand their "BuildLast" sort set, so I left it blank initially. Except... that means that the items rearrange as I fill in values to alphabetize by the chosen skill. Is there a good way to have it sort by the order I added the items so that they don't rearrange themselves? This is the relevant code:

Quote:
<!-- Skill Bonus portal. Used to list skill bonuses from backgrounds, races, and
command packages, and to allow for choices. -->
<portal
id="raFeatures"
style="tblInvis"
width="240">
<table_fixed
component="UserSelect"
showtemplate="MenuSlPick"
showsortset=""
alwaysupdate="yes">
<list><![CDATA[
(!User.NeedChosen | Helper.ChosenOpt)
]]></list>
<headertitle><![CDATA[
@text = "Skill Bonuses"
]]></headertitle>
</table_fixed>
</portal>
Quote:
<template
id="MenuSlPick"
name="Configurable Pick"
compset="UserSelect"
marginhorz="5"
marginvert="3">

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

<portal
id="thinglist"
style="menuSmall">
<menu_things
field="usrChosen1"
component="none"
candidatefield="usrCandid1"
usepicksfield="usrSource1"
maxvisible="10"
sortset="explicit">
</menu_things>
</portal>

<position><![CDATA[
~set up our height; our width is pre-initialized for us
height = portal[thinglist].height

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

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

~center the other portals on the tallest one
perform portal[name].centeron[vert,thinglist]

portal[name].left = 0
portal[name].width = 100

portal[thinglist].left = portal[name].right + 3
portal[thinglist].width = width - portal[name].width - 3
]]></position>

</template>
Quote:
<!-- SkillBonus component -->
<component
id="SkillBonus"
name="Starting Skill Bonus"
autocompset="no"
panellink="basics">

<!-- This tag is added to the hero if our feature is selected. -->
<identity group="HasFeature"/>

<!-- All feats get the same tag for sorting purposes -->
<!--tag group="SpecialTab" tag="RaceFeat"/-->

<!-- Activate any selected build option -->
<eval index="1" phase="Setup" priority="100" name="Build option activated"><![CDATA[
if (field[usrChosen1].ischosen <> 0) then
if (field[usrChosen1].chosen.ispick <> 0) then
perform field[usrChosen1].chosen.assign[Helper.ChosenOpt]
endif
endif

~forward our "has feature" tags to the hero so it knows we're present
perform forward[HasFeature.?]
]]></eval>

</component>
Quote:
<!-- Skill Bonuses -->
<compset
id="SkillBonus">
<compref component="SkillBonus"/>
<compref component="UserSelect"/>
<compref component="SpecialTab"/>
<compref component="Custom"/>
</compset>
Quote:
<!-- Any background, command package, or race can bootstrap this, adding
SkillBonus.attrid tags as necessary -->
<thing
id="fRPlusSk"
name="+2 to Skill"
compset="SkillBonus"
description="Gives a +2 bonus to the selected skill.">
<fieldval field="usrCandid1" value="component.Skill"/>
<tag group="Hide" tag="Special"/>
<eval index="1" phase="PreTraits" priority="5000">
<before name="Calc trtFinal"/><![CDATA[
~build the candidate expression out of our SkillBonus tags
if (tagis[SkillBonus.?] <> 0) then
field[usrCandid1].text &= " & (" & tagids[SkillBonus.?, " | "] & ")"
endif

~#traitbase[field[usrChosen1].chosen] += 2
perform field[usrChosen1].chosen.field[trtBase].modify[+,2,"Background"]
]]></eval>
</thing>

Yes, I know that I need to modify the logic here so that the items with only one choice don't display a list.

Quote:
<thing
id="bckEnter"
name="Entertainer"
compset="Bckgrnd"
isunique="yes"
description="Maybe you played in a band. Maybe the band was a circus. Maybe the circus was the writing pit for a comedy show.{br}{br}{b}Bonus Skill Ranks:{/b} +2 Athletics {i}or{/i} Empathy, +2 Deceive {i}or{/i} Thrown Weapons, +2 Inspire">

<tag group="SkillBonus" tag="skDodge"/>

<bootstrap thing="fRPlusSk">
<autotag group="SkillBonus" tag="skAthlete"/>
<autotag group="SkillBonus" tag="skEmpathy"/>
</bootstrap>

<bootstrap thing="fRPlusSk">
<autotag group="SkillBonus" tag="skInspire"/>
</bootstrap>

<bootstrap thing="fRPlusSk">
<autotag group="SkillBonus" tag="skThrown"/>
<autotag group="SkillBonus" tag="skDeceive"/>
</bootstrap>


<!-- Define any script needed to apply changes to traits or other mechanisms-->
<eval index="1" phase="Setup" priority="4000"><![CDATA[
~#traitbase[skDodge] += 2
~#traitbase[skMedic] += 2
~#traitbase[skXeno] += 2
~#traitbase[skPistol] += 2
]]></eval>

</thing>
Duggan is offline   #1 Reply With Quote
Duggan
Senior Member
Volunteer Data File Contributor
 
Join Date: Nov 2009
Posts: 1,502

Old August 20th, 2017, 08:08 PM
Hmm... and I'm running into something I hadn't noticed before. The bootstrapped changes to #traitbase "stick". So if I get a +2 boost to Inspire from my background (bringing me up to 2 without any points spent on it), then switch to a background that doesn't give that bonus, it acts like I spent those two points. Given trtUser is being changed as well, I suspect I made a different error here. I'll look at it in the morning.
Duggan is offline   #2 Reply With Quote
Duggan
Senior Member
Volunteer Data File Contributor
 
Join Date: Nov 2009
Posts: 1,502

Old August 23rd, 2017, 06:11 PM
And I've got it fixed, albeit by doing something completely different. ^_^
Duggan is offline   #3 Reply With Quote
Duggan
Senior Member
Volunteer Data File Contributor
 
Join Date: Nov 2009
Posts: 1,502

Old August 23rd, 2017, 06:45 PM
The one oddity that I have seen happening is that, if a modification brings an item to the minimum or maximum value, the summary panel does not update for that item. So if I have five ranks and shift-click on the incrementor (changing the value by 5), the tab on the side doesn't update either way because the value is 0 (minimum) or 9 (maximum). The same thing happens for values modified with modify by a script. Maybe the fact that a tag is being assigned for Minimum or Maximum is interrupting it?
Duggan is offline   #4 Reply With Quote
Farling
Senior Member
 
Join Date: Mar 2013
Location: Greater London, UK
Posts: 2,623

Old August 23rd, 2017, 11:56 PM
Quote:
Originally Posted by Duggan View Post
The one oddity that I have seen happening is that, if a modification brings an item to the minimum or maximum value, the summary panel does not update for that item. So if I have five ranks and shift-click on the incrementor (changing the value by 5), the tab on the side doesn't update either way because the value is 0 (minimum) or 9 (maximum). The same thing happens for values modified with modify by a script. Maybe the fact that a tag is being assigned for Minimum or Maximum is interrupting it?
Have you tried selecting "trigger full evaluation immediately" (develop menu)? Maybe the update to the screen is being delayed?

Farling

Author of the Realm Works Import tool, Realm Works Output tool and Realm Works to Foundry module

Donations gratefully received via Patreon, Ko-Fi or Paypal
Farling is offline   #5 Reply With Quote
Duggan
Senior Member
Volunteer Data File Contributor
 
Join Date: Nov 2009
Posts: 1,502

Old August 24th, 2017, 02:12 AM
Thanks for the tip, Farling. I just tried that, and it did not solve the problem. I will look into getting the relevant files publicly available so that others can look at it. The last time I tried zipping them up, it was just above the margin for attachments here, but I still have a fair amount of cruft from the skeleton files and my experiments. I do have it available via GitHub here if you'd like to take a look at the files themselves.
Duggan is offline   #6 Reply With Quote
Mathias
Senior Member
Lone Wolf Staff
 
Join Date: May 2005
Posts: 13,213

Old August 24th, 2017, 07:08 AM
You've got alwaysupdate="yes" on the summary table? I find that I just need to add that to all the summary tables - I'm not sure why the skeleton files don't just do that by default.

For order, add tags from the explicit group - explicit.1, explicit.2, etc., and then add a sort order to the table that looks for those tags.
Mathias is online now   #7 Reply With Quote
Duggan
Senior Member
Volunteer Data File Contributor
 
Join Date: Nov 2009
Posts: 1,502

Old August 24th, 2017, 08:59 AM
Quote:
Originally Posted by Mathias View Post
You've got alwaysupdate="yes" on the summary table? I find that I just need to add that to all the summary tables - I'm not sure why the skeleton files don't just do that by default.

For order, add tags from the explicit group - explicit.1, explicit.2, etc., and then add a sort order to the table that looks for those tags.
Yes.

Quote:
<!-- smSkill portal
Table of skills, using the "smTrait" template defined in "summ_basics.dat".
-->
<portal
id="smSkill"
style="tblInvisSm">
<table_fixed
component="Skill"
showtemplate="smTrait"
scrollable="no"
alwaysupdate="yes">
<headertitle><![CDATA[
@text = #summtitle_decoration[] & " Skills " & #summtitle_decoration[]
]]></headertitle>
</table_fixed>
</portal>
And the explicit tags work just fine. Thank you.

Last edited by Duggan; August 24th, 2017 at 09:17 AM.
Duggan is offline   #8 Reply With Quote
Duggan
Senior Member
Volunteer Data File Contributor
 
Join Date: Nov 2009
Posts: 1,502

Old September 19th, 2017, 02:26 PM
Silly question, is there any way to tell the system to not try to sort a table at all? Right now, I have Specialties that accept a typed-in value (Specifically, the case I'm staring at right now are the Xenobiology specialties where you can specify which world). If I start typing in one, and the value I type causes it to change location, I instead find myself typing in the field which gets sorted into that location. So, for example, if I had the following:

Quote:
World: [blank]
World: [blank]
and I start typing into the first one, "Earth", but pause a second before typing the last "h" because my wife is asking me a question, I'll get the following

Quote:
World: h
World: Eart
I've been fiddling with different sortsets, but to little avail. The 4E code seems to handle this for their custom feats with a sort like the following:

Code:
<sortset
  id="Feats"
  name="Feats by Tier">
  <sortkey isfield="no" id="Tier"/>
  <sortkey isfield="no" id="_Name_"/>
  </sortset>
FWIW, I've tried are sorting by "thingname" instead (to just get the "World" part of it), but it still seems to sort by the domain as well.
Duggan is offline   #9 Reply With Quote
Mathias
Senior Member
Lone Wolf Staff
 
Join Date: May 2005
Posts: 13,213

Old September 19th, 2017, 02:30 PM
Check out the allowuserorder="yes" parameter on the table - would that work? They'd be fixed in place until the user moved the items, which would mean they wouldn't re-sort just because they were renamed.
Mathias is online now   #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 12:10 PM.


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