Creating a deck file external to VASSAL

I have successfully created Extensions externally from VASSAL. But I can’t seem to figure out how to do it for a Deck.

I’m working on creating a module for a CCG. Each “set” of the CCG is its on Extension. Each extension contains just the Cards, which happen to be added to a “Deck Builder” Map. This way I can use just the Extensions we need to play.

This Deck Builder Map then has 1 of each card. The player draws cards from the main deck and Clones them as necessary and places all the cards into another deck for saving.

But what I’d really like to do is automate the “deck creation” process so someone can send in a deck list and have it spit out the VASSAL deck file for use.

(I don’t mean send it to VASSAL, but to an external program which creates deck files. Perhaps this would require a plug-in, not sure. But I’d rather just make it an external program that creates the deck files.)*

I looked into the deck files created thru VASSAL and they were a bit cryptic.

My first question is why is a deck more complicated than an extension? Why can’t it just contain the basic card attributes, like prototype names, etc.? Why must it break out the prototypes into individual attributes? This means if I change my module which contains the prototype definitions, all my decks need to be remade.

Second question, is it possible to create a deck external to VASSAL? If so, what are the secret bits I need to know. (And it would be a lot easier if the “deck” was generic like an Extension, or at least had the option to be so.)

VASSAL is great. Sorry for the long winded explanation. I hope I got my questions across ok.



I looked through the code to do some research…

It appears that a deck is a serialized list of commands. So it looks like this would be easier as a plug-in.

The plug-in could be an extension of a Deck, adding a function which…

  1. Requests a file name.

  2. Reads the file and extracts a list of Piece Names. (Not sure what Name means exactly, but there must be a way to find a piece from another deck by a common name.)

  3. Builds the Deck from the pieces acquired in #2 above.

  4. Places the Deck into a designated Map Deck.

  5. Now the user can click “save” (which already exists).

Any thoughts?

How do you make a plug in that does that?