# Automatic/Bulk Loading of Counters

**URL:** <https://forum.vassalengine.org/t/automatic-bulk-loading-of-counters/7542>\
**Category:** Module Design\
**Created:** [February 24, 2015, 5:35am UTC](https://forum.vassalengine.org/t/automatic-bulk-loading-of-counters/7542 "2015-02-24T05:35:35Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![geoffreyphipps](https://forum.vassalengine.org/letter_avatar_proxy/v4/letter/g/db5fbb/32.png) [@geoffreyphipps](https://forum.vassalengine.org/u/geoffreyphipps)\
**Post date:** [February 24, 2015, 5:35am UTC](https://forum.vassalengine.org/t/automatic-bulk-loading-of-counters/7542/1 "2015-02-24T05:35:35Z")

</div>

Hi,  
I am the designer of Gallipoli 1915 (see [gmtgames.com/p-505-gallipoli … amble.aspx](http://www.gmtgames.com/p-505-gallipoli-1915-churchills-greatest-gamble.aspx), consimworld etc).

For several years now I have used a javascript program to generate the counters, using Adobe Illustrator. The JS program calls the graphics API on AI and draws the counters. The advantage for me was that I could easily change the design, or the counter information.

I need to create a Vassal module of the game for external playtesting, we have been using hand-assembled cardboard & paper playtest kits for internal playtesting, but I have been advised to also create a Vassal module.

So, I have ported my counter generator to create SVG graphics instead (see attachment, a subset of the Entente forces). My goal is to extend the program to also auto-generate the XML definition of the counters within the Module file. I unzipped and untarred a module and looked at the build file, and could reverse engineer the xml format. I can generate the hierarchy of counters, my code is already organized as a class hierarchy that matches the Order of Battle. I would just create the module file with perhaps one counter, then open it up in a text editor and drop all the counters in. The XML would refer to images in the subfolder, and they will also be auto-created.

My question is whether there already is a bulk loading interface, and am also looking for general comments on the approach.

(In case it is not obvious I am a software engineer by trade).

cheers  
Geoff

[attachment=0]Screen Shot 2015-02-23 at 9.32.10 PM.png[/attachment]

---

<div class="post-metadata">

**Author:** ![Tim\_M](https://forum.vassalengine.org/user_avatar/forum.vassalengine.org/tim_m/32/2_2.png) [@Tim\_M](https://forum.vassalengine.org/u/Tim_M)\
**Post date:** [February 24, 2015, 3:19pm UTC](https://forum.vassalengine.org/t/automatic-bulk-loading-of-counters/7542/2 "2015-02-24T15:19:55Z")

</div>

Under the game piece palette there is a command to add multiple pieces - this is the mass piece loader, you may want to check its documentation to see if this fits your needs in any way

---

<div class="post-metadata">

**Author:** ![Jym](https://forum.vassalengine.org/letter_avatar_proxy/v4/letter/j/e8c25b/32.png) [@Jym](https://forum.vassalengine.org/u/Jym)\
**Post date:** [February 25, 2015, 1:59pm UTC](https://forum.vassalengine.org/t/automatic-bulk-loading-of-counters/7542/3 "2015-02-25T13:59:58Z")

</div>

> [@geoffreyphipps](#):
>
> My question is whether there already is a bulk loading interface, and am also looking for general comments on the approach.

Having written several Perl scripts to bulk edit the buildFile (eg : swap sides of all counters, add a zone for each hex on a map, …) I heartily support this approach. Computers are meant to quickly and flawlessly perform repeated tasks that would bore us to death if we had to do it manually… And I cannot say that I like the Vassal interface for editing modules (several features that I consider crucial for editing are missing or poorly implemented). [I don’t want this to sound like a harsh criticism of the developers, I know it is a hard job to do and I am unable to develop something similar]

Thus, whenever I need to do something many times in Vassal, editing the buildFile is often my favourite way (even if it’s just a bunch of copy/paste that don’t really need scripting).

However, you may run into trouble with prototypes (aka abstract class inherited by the counters, in a programmer’s language) or heavy use of properties like markers (‘constant’) and dynamic properties (‘variables’). Last time I checked, the counters were stored in a mix of XML and csv, the csv inside the XML obviously being used to store prototypes, markers and such. The XML is easy to understand. I did not bother to fully reverse engineer the csv. And given your background, there is probably no need to emphasize the extreme usefulness of prototypes for a clean and maintainable design…

I remember someone saying that soon the buildFile will be pure XML…

---

<div class="post-metadata">

**Author:** ![uckelman](https://forum.vassalengine.org/user_avatar/forum.vassalengine.org/uckelman/32/10020_2.png) [@uckelman](https://forum.vassalengine.org/u/uckelman)\
**Post date:** [February 25, 2015, 4:05pm UTC](https://forum.vassalengine.org/t/automatic-bulk-loading-of-counters/7542/4 "2015-02-25T16:05:42Z")

</div>

Thus spake Jym:

> I remember someone saying that soon the buildFile will be pure XML…

## Yes, it will, in V4.

J.

* * *

messages mailing list  
[messages@vassalengine.org](mailto:messages@vassalengine.org)  
[vassalengine.org/mailman/listinfo/messages](http://www.vassalengine.org/mailman/listinfo/messages)
