nanDECK - Tutorial D
This tutorial was written for nanDECK 1.9b (or later versions). First, we start from a file (data01.txt), not a script, but a simple data file for a counter's list (this is an example, for a fictional WWII wargame):
The first row will be used as titles for the data. If we want include this list in a nanDECK' script, we can create a new script, set the counter' size (2x2 cm) and use a LINK directive (during the script's execution, the values from data file are converted to labels):
Next, we'll define some labels:
The [all] label will be translated to 1-18 at runtime (we have 18 counters).
Some positioning for values, three below the symbol, one on the top.
IMPORTANT: The ger and fre are equal to [nation] column values in data file.
We draw a background rectangle:
IMPORTANT: The [back_[nation]] label will be translated to [back_ger] or [back_fre], depending on values from [nation] column, and then translated again to a color.
We draw an empty rectangle in the center of the counter.
We draw combat and movement values, taken from data file.
With the new IF construct, we draw the command value of the counter only if it is different from zero.
We draw the counter's id on top (with a smaller font).
We can have four different kind of unit (infantry, cavalry, armour and HQ), and with the IF construct we use only the corresponding command for drawing a NATO symbol.
This is the result (only six counters):
You can resize the counters with a ZOOM directive, withouth changing other commands.
You can download the script from here, the data file here and the PDF from here.