Senior Member
Join Date: Nov 2012
Posts: 208
|
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 |
#1 |
Senior Member
Lone Wolf Staff
Join Date: May 2005
Posts: 13,214
|
I don't think these procedures are available right now.
|
#2 |
Senior Member
Join Date: Nov 2012
Posts: 208
|
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 |
#3 |
Senior Member
Lone Wolf Staff
Join Date: May 2005
Posts: 13,214
|
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> |
#4 |
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 |
|
#5 |
Senior Member
Lone Wolf Staff
Join Date: May 2005
Posts: 13,214
|
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. |
#6 |
Senior Member
Join Date: Nov 2012
Posts: 208
|
Quote:
Hmmm, did not think about using fields, but might be an idea ^^ Thx. Steffen |
|
#7 |
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 |
|
#8 |
Senior Member
Lone Wolf Staff
Join Date: May 2005
Posts: 13,214
|
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. |
#9 |
Junior Member
Join Date: Jul 2013
Posts: 26
|
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.
|
#10 |
|
|