• 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

Output sheet for Gizmos?

TCArknight

Well-known member
Is there a good example for including gizmos on an output sheet?

I want to do the hero's gadgets on one sheet by themselves, but I'd like to print them similar to the way the attached page is set up.

In the Statblock, this is how I build the Gadget:
Code:
  <!-- Procedure sbtrackres
        Output all of the tracked resources possessed by the character, if the
        right output source is enabled.
  -->
  <procedure id="sbgadgets" scripttype="synthesize"><![CDATA[

    var ismore as number
    var i as number
    var lastGiz as string
    var thisGiz as string
    
    append @boldon & "Gadgets: " & @boldoff & @newline
  
    ~output the details of all resources
    ismore = 0
    
    foreach pick in hero where "HasGadget.?"
      ismore = 1
      
      append @indent & eachpick.field[name].text
      
      if (hero.tagis[source.ShowGadSB] <> 0) then
	      append @italicson
	      foreach pick in eachpick.gizmo where "component.Ability"
	        thisGiz = eachpick.field[name].text
	        
	        if (compare(thisGiz,lastGiz) = 0) then
	          append " x2"
	        else 
	          append @newline & @indent & @indent & thisGiz
	          endif
	        lastGiz = thisGiz
	        nexteach
	      append @italicsoff
	
	      if (ismore = 0) then
	        append @indent & "-none-" & @newline
	        endif
    	endif
	        
	  append @newline
	  nexteach
	
    ~if we have no resources, output that fact
    if (ismore = 0) then
      append @indent & "-none-" & @newline
      endif
    ]]></procedure>

The Component I'd be looking at for the overall table on the page would be component="Gadget". I've got one portal for the Gadget Name, one for the Story Points, and figured on one for the Details in between.

How can I step through the gadgets on the character to print out each one?
 

Attachments

Thanks Mathias!

I'm making progress on it and another question arose. :)

Is there a way to print across then down instead of down then across?

Currently the gadgets list like:

Gadget 1
Gadget 2
Gadget 3
Gadget 4

I's like them to be:
Gadget 1 Gadget 2
Gadget 3 Gadget 4

Is there some setting I'm missing for that?
Thanks!
TC
 
Not sure what I'm doing wrong, but the columns="2" for the oGadgeDesc portal isn't working. :(

This is the sheet code:
Code:
<document signature="Hero Lab Data">

  <portal
    id="oGadTitle"
    style="outTitle">
    <output_label
     ismultiline="no">
      <labeltext><![CDATA[
        @text = "Gadgets"
        ]]></labeltext>
        </output_label>
    </portal>
    
  <!-- oGadgeDesc portal
        This is a table of all Gadges for the actor.
              <headertitle><![CDATA[
        @text = "Gadgets"
        ]]></headertitle>
  -->
  <portal
    id="oGadgeDesc"
    style="outPlainLt">
    <output_table
      component="Gadget"
      showtemplate="oGadPick"
      columns="2">
      </output_table>
    </portal>
    
  <!-- oDescPick template
        This template presents the Gadges, consisting of the prominent
        name and the summary text in small letters next to it. We use a small margin
        for vertical spacing between abilities.
  -->
  <template
    id="oGadPick"
    name="Output Gadgets Table"
    compset="Ability"
    marginvert="2">

    <portal
      id="name"
      style="outTitle">
      <output_label
       ismultiline="no">
        <labeltext><![CDATA[
          @text = "Gadget: " & field[name].text
          ]]></labeltext>
        </output_label>
      </portal>

    <portal
      id="Cost"
      style="outTitle">
      <output_label
       ismultiline="no">
        <labeltext><![CDATA[
          @text = "{align center}" & "Story Points: " & tagvalue[StoryCost.?]
          ]]></labeltext>
        </output_label>
      </portal>
      
    <portal
      id="Details"
      style="outNameLg">
      <output_label
       ismultiline="yes">
        <labeltext><![CDATA[
          var infotext as string
          var spacing as string
          spacing = "{vert 20}"
          call GadInfo
          @text = infotext
          ]]></labeltext>
        </output_label>
      </portal> 
           
    <position><![CDATA[
      ~size the name to fit the available space
      ~our details width spans the remaining template width
      portal[name].width = width
      portal[Details].width = width
      portal[Cost].width = width
      
      portal[name].lineheight = 1
      portal[Details].lineheight = 12
      ~perform portal[Details].autoheight
      portal[Cost].lineheight = 1
      
      portal[name].top = 5
      perform portal[Details].alignrel[ttob,name,5]
      perform portal[Cost].alignrel[ttob,Details,5]
      
      ~our height is the vertical extent of our portals
      height = portal[Cost].bottom
      
      ]]></position>
    </template>
    
  <!-- oGadTitle layout
        This layout contains the header for the gadgets page.
  -->  
    <layout
    id="oGadTitle">
    <portalref portal="oGadTitle"/>
    <position><![CDATA[
      portal[oGadTitle].width = width
      
      ~position the Gadget table at the top of the page first
      perform portal[oGadTitle].autoplace

      ~the height of the layout is the bottommost extent of the elements within
      height = autoextent
      ]]></position>
    </layout>
    
  <!-- oGadgeDesc layout
        This layout contains a description of the Gadgets the character has.
  -->
  <layout
    id="oGadgeDesc">
    <portalref portal="oGadgeDesc"/>
    <position><![CDATA[
    
      ~if there are no adjustments, then make sure our height is zero
      if (portal[oGadgeDesc].itemsshown = 0) then
        portal[oGadgeDesc].visible = 0
        height = 0
        done
        endif
        
      ~position the Gadge table at the top of the page first
      ~the height of the layout is the bottommost extent of the elements within
      perform portal[oGadgeDesc].autoplace
      height = autoextent
      
      ]]></position>
    </layout>


  <!-- GadgeDesc sheet
  -->
  
  <sheet
    id="GadgeDesc"
    name="Standard Character Sheet, Gadge Descriptions"
    spillover="no">
    <layoutref layout="oGadTitle" reference="top"/>
    <layoutref layout="oGadgeDesc" reference="bottom"/>
    <position><![CDATA[
      ~setup the gap to be used between the various sections of the character sheet
      autogap = 40
      scenevalue[sectiongap] = autogap
      
      ~place the header
      layout[top].width = width
      layout[top].height = height
      perform layout[top].render
      
      ~output the layout on the bottom with whatever information will fit
      layout[bottom].top = layout[top].bottom + 10
      layout[bottom].width = width
      layout[bottom].height = height
      perform layout[bottom].render
      
      ]]></position>
    </sheet>

  </document>

If I do layout[bottom].width = width*4 I get the oGadgeDesc portal across the full width, but still only one column of three gadgets when there should be four total.

Thoughts?
 

Attachments

First, try changing the style on your oGadgeDesc table. The outPlainLt style you've currently got listed there is designed for an output_label, but this is an output_table, so try it out with a table style, not a text style.

Second, In order to help me see everything, I went through and edited out lots of unneeded things in your code:

Code:
<document signature="Hero Lab Data">
 
  <portal
    id="oGadgeDesc"
    style="outNormal">
    <output_table
      component="Gadget"
      showtemplate="oGadPick"
      columns="2">
      <headertitle><![CDATA[
        @text = "Gadgets"
        ]]></headertitle>
      </output_table>
    </portal>
 
  <!-- oDescPick template
        This template presents the Gadges, consisting of the prominent
        name and the summary text in small letters next to it. We use a small margin
        for vertical spacing between abilities.
  -->
  <template
    id="oGadPick"
    name="Output Gadgets Table"
    compset="Ability"
    marginvert="2">
 
    <portal
      id="name"
      style="outTitle">
      <output_label
       ismultiline="no">
        <labeltext><![CDATA[
          @text = "Gadget: " & field[name].text
          ]]></labeltext>
        </output_label>
      </portal>
 
    <portal
      id="Cost"
      style="outTitle">
      <output_label
       ismultiline="no">
        <labeltext><![CDATA[
          @text = "{align center}" & "Story Points: " & tagvalue[StoryCost.?]
          ]]></labeltext>
        </output_label>
      </portal>
 
    <portal
      id="Details"
      style="outNameLg">
      <output_label
       ismultiline="yes">
        <labeltext><![CDATA[
          var infotext as string
          var spacing as string
          spacing = "{vert 20}"
          call GadInfo
          @text = infotext
          ]]></labeltext>
        </output_label>
      </portal> 
 
    <position><![CDATA[
      ~size the name to fit the available space
      ~our details width spans the remaining template width
      portal[name].width = width
      portal[Details].width = width
      portal[Cost].width = width
 
      portal[Details].lineheight = 12
 
      portal[name].top = 5
      perform portal[Details].alignrel[ttob,name,5]
      perform portal[Cost].alignrel[ttob,Details,5]
 
      ~our height is the vertical extent of our portals
      height = portal[Cost].bottom
      ]]></position>
    </template>
 
  <!-- oGadgeDesc layout
        This layout contains a description of the Gadgets the character has.
  -->
  <layout
    id="oGadgeDesc">
    <portalref portal="oGadgeDesc"/>
    <position><![CDATA[
       perform portal[oGadgeDesc].autoplace
       height = autotop      
      ]]></position>
    </layout>
 
 
  <!-- GadgeDesc sheet
  -->
 
  <sheet
    id="GadgeDesc"
    name="Standard Character Sheet, Gadge Descriptions"
    spillover="no">
    <layoutref layout="oGadgeDesc"/>
    <position><![CDATA[
      layout[oGadgeDesc].width = width
      layout[oGadgeDesc].height = height
      ]]></position>
    </sheet>
 
  </document>
 
I'm pretty sure the style="" was the cause of your bug. The rest of what I changed was coding style - accomplishing the same thing with fewer lines of code.
 
Back
Top