Copy/Paste stuff between modules

Felt need to add this to the Vassal knowledge base.
While you cannot copy paste stuff from 1 Vassal module to another there is an excellent work around.
Download and install notepad++. Then download and drag the to the notepad++ addins folder. Add add Compare add in to notepad++.
Drag/drop the xml buildfies to an open instance of notepad, go to addins and select compare. Scroll around and enjoy.
I used this ability, today 26 May 22, to copy, paste many xml lines from one module that took many, many hours to do what I did, to the other 2 modules that use the same game piece database but with different maps.
Loved it. Several day tedious work eliminated.
While there may be some renumbering of counter IDs, that was all.


Thx for that tip. That may become extremely handy, at some point.

Btw, I thought counter IDs were established by Vassal. Wouldn’t that be a self-correcting problem? …or is my assumptions of counter IDs faulty?

The internal counter Id’s (GamePiece Id’s or GpId’s that show in the piece trait editor) are established and maintained by Vassal. If you copy parts of the buildfile and create duplicate gpid’s, Vassal will detect this and re-allocate new unique gpid’s to the duplicates to allow save games from that time onwards to be correctly refreshed.

That is what happened to the 2 modules I copied stuff into. Vassal is very accommodating there.

There is one gotcha if you are working on a module that has existing save games that you may want to update after the changes you are making.

If you copy and paste the new buildfile content AFTER the existing buildfile content, then load the module, the duplicate gpid’s will be resolved with the new additions getting new id’s. Past save games will refresh properly.

If you copy and paste the new buildfile content BEFORE the existing buildfile content, then the old versions of the counters will be allocated new gpid’s and a refresh of an old save game will magically convert all of the counters to the unrelated new counters.

In this case you need to either allocate new gpid’s manually in the buildfile (painful and prone to error) or do it in two stages. Do the cut and paste after the exising content, load and save the module, then start moving the piece definitions around, either by buildfile editing or in Vassal.

gpid’s out of order do not matter, only duplicates.

1 Like

I did not create any new counters. I have 3 modules (World in Flames), the only difference between is the map set used. Keeping these 3 modules essentially the same is a pain in the butt. I work on 1 module to get what I want and then repeat the same process for the other 2. The last change cycle involved around 100 existing counters, each with a bit of rework to make the counters ‘work’ better. My copy then paste just transferred the changed data for these counters into the other 2 modules buildfiles. Yes there were a couple of ID reassignments, about 5 in total across 2 modules. I was apprehensive about doing this, but by jingos it saved me a lot of time. That and it reduced the error rate as when I did things the ‘old’ way I did make an error or 2 in changing the next 2 modules. Wish I had tried this process earlier.

1 Like