• Please note: In an effort to ensure that all of our users feel welcome on our forums, we’ve updated our forum rules. You can review the updated rules here: http://forums.wolflair.com/showthread.php?t=5528.

    If a fellow Community member is not following the forum rules, please report the post by clicking the Report button (the red yield sign on the left) located on every post. This will notify the moderators directly. If you have any questions about these new rules, please contact support@wolflair.com.

    - The Lone Wolf Development Team

Height of confusion ... or confusion of height

EightBitz

Well-known member
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>
 

Attachments

Last edited:
On the portal this template is being displayed from, add varyheight="yes".
 
Last edited:
That is only an option on the printout. Same-height tables is an annoying limitation of some of the standard windows methods that HL calls to build its tables, so in the UI, they all have to be the height set by the first one.
 
Back
Top