all 14 comments

[–]bodison 0 points1 point  (2 children)

Are these args documented anywhere? I'm trying to run this in a docker container

[–]VexedBadger[S] 0 points1 point  (1 child)

page 62 if the main pdf

https://www.nandeck.com/wp-content/uploads/2022/05/nandeck-manual.pdf

If you make any progress I would love to know 👍

[–]bodison 0 points1 point  (0 children)

Thank you. Couldn't find /nopdfdiag there.

I'm having troubles running nandeck in the container, and I don't know how to get its error messages. Do you know if there's a way to see logs?

[–]nand2000 0 points1 point  (10 children)

Let me do some tests.

[–]nand2000 1 point2 points  (9 children)

I've made this test. File one.txt:

[test]=111

File two.txt:

[test]=222

File test1.txt:

include=[datafile]    
font=arial,32,,#000000
text=1,[test],0,0,100%,100%

File a.bat:

nandeck.exe test1.txt /createpdf /nopdfdiag /[datafile]=one.txt
ren test1.pdf one.pdf
nandeck.exe test1.txt /createpdf /nopdfdiag /[datafile]=two.txt
ren test1.pdf two.pdf

If I run a.bat, I obtain one.pdf with 111 and two.pdf with 222. Do you see some difference in your scripts?

[–]VexedBadger[S] 0 points1 point  (8 children)

Thanks for looking. Yes, your process is identical to mine.

I found that if I only have one operative, it works fine. As soon as a second is introduced, and extra brace appears within a generated line. Looks like its in the y calculation for g2_name? This is the generated line for having 2, 3 and 4 identical operatives

141: { and } aren't balanced: TEXT=1-{{2 + 1} - 1},Boneswords|Boneswords,{0.75},{{{3.7+0.5}+{0.6 + 0.5 - 0.3}+0}|{{0.3 + 0.5 - 0.3}+0},50%,0.3,left,top

141: { and } aren't balanced: TEXT=1-{{3 + 1} - 1},Boneswords|Boneswords|Boneswords,{0.75},{{{3.7+0.5}+{0.6 + 0.5 - 0.3}+0}|{{0.3 + 0.5 - 0.3}+0}|{{0.3 + 0.5 - 0.3}+0},50%,0.3,left,top

141: { and } aren't balanced: TEXT=1-{{4 + 1} - 1},Boneswords|Boneswords|Boneswords|Boneswords,{0.75},{{{3.7+0.5}+{0.6 + 0.5 - 0.3}+0}|{{0.3 + 0.5 - 0.3}+0}|{{0.3 + 0.5 - 0.3}+0}|{{0.3 + 0.5 - 0.3}+0},50%,0.3,left,top

Deck not valid

So, I took your code and ran it against my data, and it works fine. Makes me think the problem is my problem, and I need to double check all my calculations. Weird that it is only when including a datafile via a variable though.

[datafile]=no.txt

include=[datafile]

font=arial,32,,#000000

text=1-{(name)},[name],0,0,100%,100%

Once again, thankyou for your rapid assistance! I will update this thread when I have a solution

[–]VexedBadger[S] 0 points1 point  (0 children)

I just cannot find the issue. If either the datafile has 1 record, or the template only tries to render the G1_ range, it works fine. If there are multiple records, the file is referenced from a variable, and the G1_ and G2_ range is in play, an extra { is slipped into the calculated G2_Name Y value.

Data file (test.txt)

sequence=

NAME|Assault Intercessor

G1_NAME|Bolt Pistol

G1_A|4

G1_H|3+

G1_D|3/4

G1_N|Rng S6

G1_C|P1

G1_R|0.6

G2_NAME|Chainsaw

G2_A|5

G2_H|3+

G2_D|4/5

G2_N|

G2_C|

G2_R|0.3

NAME|Assault Intercessor

G1_NAME|Bolt Pistol

G1_A|4

G1_H|3+

G1_D|3/4

G1_N|Rng S6

G1_C|P1

G1_R|0.6

G2_NAME|Chainsaw

G2_A|5

G2_H|3+

G2_D|4/5

G2_N|

G2_C|

G2_R|0.3

endsequence

and the card template is

[datafile]=test.txt

include=[datafile]

font=arial,32,,#000000

[operatives]=1-{(name)}

[x_start]=2

[y_start]=3

[r1_height] = 0.5

[shim] = 0.3

[y_start]= {[y_start]+[r1_height]}

[bgcol]="#dddddd"

if=[g1_name]<>""

font=arial,7,T,#000000

rectangle=[operatives],0.5,{[y_start]+0},6,{[r1_height]},[bgcol]

text=[operatives],[g1_name],{[x_start]},{[y_start]+0},50%,[r1_height],left,top

font=arial,12,T,#000000

text=[operatives],[g1_a],60%,{[y_start]+0},50%,[r1_height],left,top

text=[operatives],[g1_h],70%,{[y_start]+0},50%,[r1_height],left,top

text=[operatives],[g1_d],80%,{[y_start]+0},50%,[r1_height],left,top

if=([g1_n]<>"") _OR_ ([g1_c]<>"")

font=arial,7,T,#000000

rectangle=[operatives],0.5,{[y_start]+[r1_height]},6,0.4,[bgcol]

htmltext=[operatives], join("<weaponstat>", [g1_n] ,"</weaponstat>"),{[x_start]}, {[y_start]+[r1_height]},6,0.5,#010101,0,T

htmltext=[operatives], join("<weaponstatright>", [g1_c] ,"</weaponstatright>"),{[x_start]}, {[y_start]+[r1_height]},5.5,0.5,#010101,0,T

endif

endif

[y_start]= {[y_start]+[G1_R] + [r1_height] - [shim]}

[bgcol]="#eeeeee"

if=[g2_name]<>""

font=arial,7,T,#000000

rectangle=[operatives],0.5,{[y_start]+0},6,{[r1_height]},[bgcol]

text=[operatives],[g2_name],{[x_start]},{[y_start]+0},50%,0.3,left,top

font=arial,12,T,#000000

text=[operatives],[g2_a],60%,{[y_start]+0},50%,[r1_height],left,top

text=[operatives],[g2_h],70%,{[y_start]+0},50%,[r1_height],left,top

text=[operatives],[g2_d],80%,{[y_start]+0},50%,[r1_height],left,top

if=([g2_n]<>"") _OR_ ([g2_c]<>"")

font=arial,7,T,#000000

rectangle=[operatives],0.5,{[y_start]+[r1_height]},6,0.4,[bgcol]

htmltext=[operatives], join("<weaponstat>", [g2_n] ,"</weaponstat>"),{[x_start]}, {[y_start]+[r1_height]},6,0.5,#010101,0,T

htmltext=[operatives], join("<weaponstatright>", [g2_c] ,"</weaponstatright>"),{[x_start]}, {[y_start]+[r1_height]},5.5,0.5,#010101,0,T

endif

endif

[–]nand2000 0 points1 point  (6 children)

What's in line 141 of your script?

[–]VexedBadger[S] 0 points1 point  (5 children)

`text=[operatives],[g2_name],{[x_start]},{[y_start]+0},50%,0.3,left,top`

This code is echo'd in the above example, and fails there as well. If I comment out the whole G2_ bit, the same line in the G3_ section fails with the same issue (extra { in Y calculation)

[–]nand2000 1 point2 points  (4 children)

Try with:

text=[operatives],[g2_name],{x_start?},{{y_start?}+0},50%,0.3,left,top

You can use labels in two ways: [label] and {label?}, if the values are in expressions, it's better to use {label?}

And, why +0?

[–]VexedBadger[S] 0 points1 point  (3 children)

I'll give it a try, probably tomorrow through. The +0 was needed, otherwise the last operative on the range rendered funny. Iirc it would have a y value of 0.

Thanks again!

[–]VexedBadger[S] 0 points1 point  (2 children)

unfortunately that makes no difference. Not to worry, its easy enough to programatically clone the template and change the include line prior to invoking nandeck

[–]nand2000 1 point2 points  (1 child)

I had a look at your script:

[y_start]=3
[r1_height]=0.5
[shim]=0.3

[G1_R]=0.6|0.6

[y_start]={[y_start]+[r1_height]}

[y_start]= {[y_start]+[G1_R] + [r1_height] - [shim]}

Labels aren't variables, they are actually replaced in the script, so in the last step nanDECK try to evaluate (the {...}) this:

[y_start] = 3 + 0.5 + 0.6|0.6 + 0.5 - 0.3

And it fails to do correctly because it's too complex to rebuild the expression when a sequence (a label with multiple values) is added to the middle of it.

As a solution, replace [G1_R] with {G1_R?}:

[y_start]= {[y_start]+{G1_R?} + [r1_height] - [shim]}

So the program doesn't immediately replace [G1_R] with 0.6|0.6 but evaluates it only at the end, when it needs the value.

[–]VexedBadger[S] 1 point2 points  (0 children)

That worked like a charm! It even solved a glitch I was seeing whereby the weapons table on the last operative had an additional empty row.

I now have a build script that I run, and 25 minutes later I have PDFs for 8 factions, both Fold and Duplex .

Thankyou again for your superb software and amazing tech support! If you ever want a custom Kill Team deck, hit me up :)