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
MagicSN
Senior Member
 
Join Date: Nov 2012
Posts: 208

Old October 14th, 2014, 01:59 PM
Hi!

Is there a way to put the code inside

<position>
...
</position>

into an external procedure somehow? if yes, what scripttype do I need to use? All my tries to do this sort of failed.

Also for something like

<portal
id="damagebig"
style="outPowDam">
<output_label>
<labeltext><![CDATA[
...

the same question.

For some scripts scripttype=label or =calculate seemed to do the trick, but for some (especially if using @text inside) this would give an error.

(My code works without making this stuff external procedures, but it would look much nicer - with smaller files - if I could make some of that external procedures).

Thanks in advance.

Best regards,
Steffen
MagicSN is offline   #1 Reply With Quote
Mathias
Senior Member
Lone Wolf Staff
 
Join Date: May 2005
Posts: 13,214

Old October 14th, 2014, 02:32 PM
I don't think these procedures are available right now.
Mathias is offline   #2 Reply With Quote
MagicSN
Senior Member
 
Join Date: Nov 2012
Posts: 208

Old October 15th, 2014, 08:58 AM
Quote:
Originally Posted by Mathias View Post
I don't think these procedures are available right now.
Hi!

I found a solution to the second problem, by using a label-procedure with a temporary
string variable (and in the main file I just wrote the temporary variable back to @text,
that works).

The only problem without solution is the <position> script. Right now it is not a real
problem, my procedure still "fits in" without reaching the max number of if-else, but it
is quite close to the limit (the procedure is one which on the character PDF displays
little boxes to cross off during gameplay for spells/magic item uses being used, currently
I only did the magic item stuff for a small amount of items to not reach the maximum of
if-else, so I had hoped external procedure would be possible. If not, I just need to leave
the code as it is now.

Thanks for the information, anyways.

Best regards,
MagicSN
MagicSN is offline   #3 Reply With Quote
Mathias
Senior Member
Lone Wolf Staff
 
Join Date: May 2005
Posts: 13,214

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 offline   #4 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   #5 Reply With Quote
Mathias
Senior Member
Lone Wolf Staff
 
Join Date: May 2005
Posts: 13,214

Old October 16th, 2014, 07:32 AM
So far, you've only mentioned two if...then cases, but you say you're hitting the limit.

Think about where it's best to generate this information. Can the calculations be moved into the component scripts? Can, for example, the ranger class store this in a field:

L1: oooo
L2: ooo
L3: ooo
L1: o

And the pearl of power will instead put this in the same field:

o Pearl of Power

Then, your output only needs to read in whatever's in that field.
Mathias is offline   #6 Reply With Quote
MagicSN
Senior Member
 
Join Date: Nov 2012
Posts: 208

Old October 16th, 2014, 09:17 PM
Quote:
Originally Posted by Mathias View Post
So far, you've only mentioned two if...then cases, but you say you're hitting the limit.

Think about where it's best to generate this information. Can the calculations be moved into the component scripts? Can, for example, the ranger class store this in a field:

L1: oooo
L2: ooo
L3: ooo
L1: o

And the pearl of power will instead put this in the same field:

o Pearl of Power

Then, your output only needs to read in whatever's in that field.
The two if's I mentioned were just an example, it is really a HUGE list of if's (for all classes and many magic items, and some other conditions).

Hmmm, did not think about using fields, but might be an idea ^^ Thx.

Steffen
MagicSN is offline   #7 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   #8 Reply With Quote
Mathias
Senior Member
Lone Wolf Staff
 
Join Date: May 2005
Posts: 13,214

Old December 18th, 2014, 11:58 AM
To create a blank box on the printout to allow the user to write in text, I would just create a portal that has a border and nothing else and add that to the output.

Although if you're asking about the d20 system we publish, and not something you've created, that's not an option, because the character sheet generation isn't exposed in our packaged systems.
Mathias is offline   #9 Reply With Quote
Mauron
Junior Member
 
Join Date: Jul 2013
Posts: 26

Old December 18th, 2014, 01:42 PM
Quote:
Originally Posted by Mathias View Post
Although if you're asking about the d20 system we publish, and not something you've created, that's not an option, because the character sheet generation isn't exposed in our packaged systems.
In the case of d20, I found a way around that. You've included sheet_standard_1.dat and sheet_standard_2.dat in the source folder. By copying those and putting them in the main folder. After renaming a few IDs and adding a new <dossier> element, I was able to make my sheet appear on the list.
Mauron is offline   #10 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 08:15 AM.


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