cards and tokens

Is there a generic / universal way to achieve the following:

  1. There cards, coming in two variants:
    a. movable / selectable;
    b. non-movable but selectable (this can be implemented through Does not Stack trait);
    c. in both cases there should be a set of right-click commands available to the user.

  2. Player can place units / tokens on the cards.

How do I ensure:

A. card is always on the bottom?
B. card does not overlay the units / tokens placed on the card?

(in both, i.e. 1a and 1b, cases).

In case 1b:

  • made the card non-movable and non-stackable;
  • made a transparent layer, always active, selectable that can be right clicked;
  • BUT once the layer is selected, even though the units on the card are still visible (because the layer is transparent), they cannot be selected (because the layer-covered card has moved to the top of the stack, overlaying the units which are now beneath i.e. can’t be selected).

Any elegant way to deal with it?

Map Layers:

Right click the [Map Window] in which you want to set up piece layers and “Add Game Piece Layers”.

Property Name for the Layers = name it something like “MapLayers”. Then add your layers below …something like

Map
Card
Token

The item at the TOP of the list is your BOTTOM most layer.

On the cards and tokens, add the Marker trait and mark the pieces with MapLayers = (the level you want). They will now automatically occupy that layer.

As far as changing a selectable/movable piece to a non… The easiest way that I can think of would be to use a “Replace with Other” trait and define it as exactly the same piece but with the Does Not Stack set to non-selectable/non-movable. Then when you replace the the original piece with the new piece, it will become permanent.

I keep forgetting what an amazing piece of code–given all the shortcomings originating from the ancient past–Vassal is.

Thanks, that perfectly gets the job done.