Scripts

This section describes add-ons to protograf that are not part of the “core” functionality.

Using Scripts

Scripts are pre-defined sets of code, designed to carry out a specific functions, or a set of functions.

To use a script, you open a terminal and “run” it with Python in a similar way that you do for a protograf script — see Run a file with Python.

For example, to run the counter extraction script (note the extra -m):

python -m protograf.scripts.counter_extraction

Some scripts may require additional information to work properly e.g. the name of a configuration file.

Available Scripts

Creating Cards

The card creation script, called card_creation, is designed to run a series of prompts whose answers will be used set up a protograf file for you, containing a basic template for the cards.

To run the card creation script (note the extra -m):

python -m protograf.scripts.card_creation

Obviously, card designs vary widely, so this script can only provide a very basic starter — hopefully enough to see what the structure of such a script should be…

Extracting Counters

Extracting individual rectangular counter images, as might be found on a scan of a full set of counters on a wargame’s countersheet — typically an A4 or Letter-sized card —, is useful to provide images to programs such as VASSAL

For details, refer to Counter Extraction reference.