Lone Wolf Development Forums  

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

Notices

Reply
 
Thread Tools Display Modes
Mathias
Senior Member
Lone Wolf Staff
 
Join Date: May 2005
Posts: 13,217

Old October 15th, 2014, 09:05 AM
You're using an if...elseif...endif to output lots of boxes?

Can't you use a for...next to generate the correct number?

Here's something from Cortex's output:

Code:
    <portal
      id="boxes"
      style="outNormLt">
      <output_label
        ismultiline="yes">
        <labeltext><![CDATA[
          ~output empty boxes for each point, with a gap every 5; we fit a maximum
          ~of 10 boxes on a line, splitting additional boxes onto extra lines
          var i as number
          var last as number
          last = field[trkMax].value - 1
          for i = 0 to last
            if (i % 5 = 0) then
              if (i <> 0) then
                if (i % 10 = 0) then
                  @text &= "{br}"
                  endif
                endif
              @text &= "{horz 15}"
              endif
            @text &= "{bmpscale 3 output_box}"
            next
          ]]></labeltext>
        </output_label>
      </portal>
Mathias is online now   #1 Reply With Quote
MagicSN
Senior Member
 
Join Date: Nov 2012
Posts: 208

Old October 16th, 2014, 06:48 AM
Quote:
Originally Posted by Mathias View Post
You're using an if...elseif...endif to output lots of boxes?

Can't you use a for...next to generate the correct number?

Here's something from Cortex's output:

Code:
    <portal
      id="boxes"
      style="outNormLt">
      <output_label
        ismultiline="yes">
        <labeltext><![CDATA[
          ~output empty boxes for each point, with a gap every 5; we fit a maximum
          ~of 10 boxes on a line, splitting additional boxes onto extra lines
          var i as number
          var last as number
          last = field[trkMax].value - 1
          for i = 0 to last
            if (i % 5 = 0) then
              if (i <> 0) then
                if (i % 10 = 0) then
                  @text &= "{br}"
                  endif
                endif
              @text &= "{horz 15}"
              endif
            @text &= "{bmpscale 3 output_box}"
            next
          ]]></labeltext>
        </output_label>
      </portal>
Hi, Mathias!

Not to actually draw the boxes I need if-else, but to find out IF a box has to be drawn
at a particular space. The <position> procedure produces something like that:

L1: oooo
L2: ooo
L3: ooo
L1: o
o Pearl of Power
o Arcane Recovery

The if's are stuff like:

if the character is multiclass and if one of the classes is a ranger: calculate #boxes like
this.
If the character has pearl of power put in a box here
...

Currently, as I said, it does not yet reach the limit of if's, but it is already quite
large.

I did not use the way to draw boxes inside of @text though, but instead stuff like this:

<portal
id="used24"
style="outValBTn">
<output_label
text=" ">
</output_label>
</portal>


Possibly by using @text the stuff could be moved out of the <position> into a different
procedure where sub-procedures can be used, solving the problem.

Is it possible to have some {}-stuff to ensure correct tabbing in some way?

Thanks again!

Best regards,
Steffen
MagicSN is offline   #2 Reply With Quote
Dark Lord Galen
Senior Member
 
Join Date: Jul 2012
Location: Texas
Posts: 707

Old December 18th, 2014, 11:34 AM
Quote:
Originally Posted by Mathias View Post
You're using an if...elseif...endif to output lots of boxes?

Can't you use a for...next to generate the correct number?

Here's something from Cortex's output:

Code:
    <portal
      id="boxes"
      style="outNormLt">
      <output_label
        ismultiline="yes">
        <labeltext><![CDATA[
          ~output empty boxes for each point, with a gap every 5; we fit a maximum
          ~of 10 boxes on a line, splitting additional boxes onto extra lines
          var i as number
          var last as number
          last = field[trkMax].value - 1
          for i = 0 to last
            if (i % 5 = 0) then
              if (i <> 0) then
                if (i % 10 = 0) then
                  @text &= "{br}"
                  endif
                endif
              @text &= "{horz 15}"
              endif
            @text &= "{bmpscale 3 output_box}"
            next
          ]]></labeltext>
        </output_label>
      </portal>
Mathis, Could I utilize something like this to add a Box for user entries on items?
For example, an unidentified potion, the PC may get a description, but not know what it is.. my hope is to create a generic combined with this script to allow them to enter the descriptions conveyed, until the item is identified. Currently using D20 (3.5e)
Thanks DLG
Dark Lord Galen is offline   #3 Reply With Quote
Reply


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 01:38 PM.


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