Lone Wolf Development Forums  

Go Back   Lone Wolf Development Forums > Hero Lab Forums > HL - Authoring Kit
Register FAQ Community Today's Posts Search

Notices

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
EightBitz
Senior Member
 
Join Date: May 2013
Posts: 1,458

Old October 19th, 2017, 03:31 PM
I'm having an issue with a character sheet layout. It's based on a table pick, but then I add extra text to it through a script, and this is confusing me in regards to how I can manage the height.

The concept I'm going for is that each character can pick from a list of schools of the art (supernatural predilections), and they can then pick certain disciplines associated with those schools.

For instance, I can pick the "Kinetic" school and the "Protective" school, then I can pick the "Hidden Hand" and "Skeleton Key" disciplines which are associated with the "Kinetic" school, and the "Line of Defense" discipline which is associated with the "Protective" school. I want this to show up on the character sheet as such:

Code:
Kinetic
 » Hidden Hand
 » Skeleton Key
Protective
 » Line of Defense
The problem is that each the number of disciplines each school can have is variable, which means the height of each table element is variable. If my position script includes the following line:

height = portal[name].height +10

...then each School will have the height of the first element, in this case "Kinetic", regardless of how many disciplines have been added. In this case, that means that "Protective" would have too much white space.

If I reversed it, and gave one discipline to "Kinetic" and two to "Protective", then the second discipline in "Protective" would be cut off.

I'm pasting my template code below, and I'm attaching a PDF that shows how things get cut off.

If anyone has any ideas, I'd appreciate the feedback.

Thanks.

Code:
  <template
    id="oSchPick"
    name="Output The Art Table"
    compset="School"
    marginvert="10">

    <portal
      id="name"
      style="outNormLt">
      <output_label>
      	<labeltext><![CDATA[
  	   var schname as string
  	   var discipname as string
  	   var linkname as string
           var disciplvl as string
	   var disciproll as number
					
  	   schname = field[name].text
  				
  	   @text = schname
    	   foreach pick in hero from Discipline where "component.Discipline & !Hide.Discipline"
    	      discipname = eachpick.field[name].text
    	      disciplvl = eachpick.field[disLvlInit].text
    	      disciproll = eachpick.field[disRoll].value
    	      linkname = eachpick.linkage[dissch].field[name].text
	      if (compare(schname,linkname) = 0) then
    	        @text &= "{br} » " & discipname & " " & disciplvl & " " & disciproll
    	        endif
    	     nexteach
      	   ]]></labeltext>
        </output_label>
      </portal>

    <!-- Portals used as the header -->
    <portal
      id="thearthdr"
      style="outTitle"
      isheader="yes">
      <output_label
        text="The Art">
        </output_label>
      </portal>

    <position><![CDATA[
      var thirdwidth as number
      
      ~our height is driven by the tallest portal (they're all the same)
      height = portal[name].height +10
      
      ~Calculate 1/3 of available width to account for three portals,
      ~   each with it's own column, with a padding of 6 between each.
      thirdwidth = (width-12)/3
      thirdwidth = round(thirdwidth,0,0)
      doneif (issizing <> 0)
      	
      ~setup appropriate widths for the various value portals
      portal[name].width = thirdwidth
			
      ~center everything vertically within the template
      perform portal[name].centervert

      ~perform portal[name].alignedge[left,0]
      ]]></position>

    <header><![CDATA[
      ~our header height is the title plus a gap plus the header text
      ~height = portal[thearthdr].height
      ~width = (width-12)/3
      doneif (issizing <> 0)

      ~our title spans the full width of the name portal
      portal[thearthdr].width = portal[name].width
      ]]></header>
    </template>
Attached Files
File Type: pdf Hero Lab - Rory Calhoun.pdf (68.8 KB, 0 views)

Last edited by EightBitz; October 19th, 2017 at 03:36 PM. Reason: Fixed indents.
EightBitz is offline   #1 Reply With Quote
 


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 11:16 PM.


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