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,156

Old February 24th, 2018, 09:30 AM
I'm building part of the character sheet which shows the Health and then some defense values.



I started out with a somewhat crude, but reasonably functional setup where I built everything with individual labels (still working on scaling):



It then dawned on me that I could probably use templates, since this is essentially all the same data (not to mention that I'm suddenly realizing I never actually stuck the code in to load those box labels with the values). I found the use of "templateref", but it looks like you can only use a template once in a layout. Looking at example source code, it looks like this is usually handled by applying the template to a single trait that has multiple values, such as initiative, and all references in the position script are to the template name. Is there a way to simply build a layout that has four instances of this template, pointing to trHealth, trDR, trDefense, and trDodge, and then refer to each uniquely?

The alternate method which I'm going to mess around with is one templateref for the Health and then a table with three columns for the other three, but I figured I'd ask here while I'm fiddling (and also to remind me to post the answer if I find one).
Attached Images
File Type: png Health and Defense Section.png (6.4 KB, 11 views)
File Type: png Health and Defense Actual.png (8.8 KB, 11 views)
Duggan is offline   #1 Reply With Quote
Duggan
Senior Member
Volunteer Data File Contributor
 
Join Date: Nov 2009
Posts: 1,156

Old February 24th, 2018, 09:31 AM
Silly me... I didn't read the documentation well enough.

Quote:
The "templateref" Element

The "templateref" element identifies a template used within the layout and assigns it a logical name for use within the Position script. The complete list of attributes for this element is below.

template Id – Unique id of the template to be utilized within the layout.
reference (Optional) Id – Specifies the alternate unique id to be used when referencing this template within the Position script. This makes it possible to re-use the same template more than once within the same layout, giving each instance a different logical id. If empty, the reference id is simply the template id. Default: Empty.
thing (Optional) Id – Specifies the unique id of the thing or pick that is associated with this template. The given object is used with the template when determining the contents of fields and such. If empty, no thing/pick is associated with the template, which means that the template cannot contain any portals that utilize a field reference. Default: Empty.
dynamic (Optional) Boolean – Instead of specifying a thing, you can flag a template as "dynamic". This means that instead of using a specific pick, the template uses the "dynamic pick" to as its context, for determining field contents and so on. The dynamic pick is only set if the layout is used on a form that's summoned via a pick (usually by clicking a button on a template for that pick); it is set to the pick from which the form was summoned. Default: "no".
ispick (Optional) Boolean – Indicates whether the template is associated with a pick or a thing. If a pick, the first pick within the container that based on the specified thing is used. Default: "yes".
taborder (Optional) Integer – Specifies the relative tab order position of the template and its contents within the overall layout. As long as the tab orders are different for all portals and templates within the layout, HL can properly sequence the flow of control. Default: "0".
Duggan is offline   #2 Reply With Quote
Duggan
Senior Member
Volunteer Data File Contributor
 
Join Date: Nov 2009
Posts: 1,156

Old February 24th, 2018, 10:42 AM
Note to self... (and to others trying this), if the boxes seem like they're showing up far right of where you put them, check your marginhorz value... ^_^
Duggan is offline   #3 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 04:25 PM.


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