• 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

External Procedures

MagicSN

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

Actually, I was referring to within HL d20. My group almost exclusively have converted to using the HL electronically, they like being able to adjust spells used, conditions, etc on the fly... I was hoping via the editor there was a means similar to the generic "gear" open text box that allows the user to write a brief description in a box to describe an item, ie a map (Found in dungeon blah) or a Potion, Unknown( Bright orange smells like old socks), or Ring (magical, gold with red stones) etc...
 
Actually, I was referring to within HL d20. My group almost exclusively have converted to using the HL electronically, they like being able to adjust spells used, conditions, etc on the fly... I was hoping via the editor there was a means similar to the generic "gear" open text box that allows the user to write a brief description in a box to describe an item, ie a map (Found in dungeon blah) or a Potion, Unknown( Bright orange smells like old socks), or Ring (magical, gold with red stones) etc...
DLG you would be better off asking this in the d20 forums then in the Authoring kit forums. This forum is for making whole new games and your question relates to an existing game system. This is why Mathias answered was assuming you have "full" control over a new game system you where building.
 
Back
Top