Determining the piece above

Games often put a marker on top of a piece to show its state (Disperse, Out of Ammo, etc.). In a game where pieces are stacked, this works fine on the tabletop, but I wonder if I can make it work in Vassal.

For instance, I have a stack of three units, some of which have a counter above them marking them as dispersed. There may be three units with two of them dispersed, so the stack may look something like A, Dispersed, B, C, Dispersed. In game, this means that A and C are dispersed but B isn’t.

Can Vassal recognized this situation, so that I can have a calculated property (“Dispersed”) that is true for A and C but false for B? Is there any way to identify the piece in the stack that’s above THIS piece?

Much thanks.

This is something that is not handled well in Vassal implementing markers as separate pieces. If you want to detect and take action based on markers like these, it is much easier to implement them as layers on the pieces themselves that when activated display a visual aid the the piece is out of ammo or dispersed. Each Layer has property that can be used to determine if they are active or not.

1 Like

That’s an idea. I suppose I could make a semi-transparent layer to lay over the piece or a smaller version of the dispersed marker.

I’d prefer to use markers, to keep the Vassal experience closer to the board game. Too bad Vassal doesn’t expose the list of pieces in a stack.

Thanks much.

That’s what I did for all the modules I developed.

It is more complicate than you think. What if one of the units has 2 markers on it, Out of ammo AND Dispersed? Then there are other marker that may apply to all units in the Stack (Barrage, Trench).

I allowed for the stand-alone makers as well, but I ended up having to write some custom java classes to handle this, it became very complex.

Thanks very much for the advice.