|
Senior Member
Lone Wolf Staff
Join Date: May 2005
Posts: 13,217
|
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> |
#1 |
Senior Member
Join Date: Nov 2012
Posts: 208
|
Quote:
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 |
|
#2 |
Senior Member
Join Date: Jul 2012
Location: Texas
Posts: 707
|
Quote:
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 |
|
#3 |
|
|