Mouse over stack viewer and Masks/Layers/pieceName

Greetings all,

I’ve just discovered the joys of altering the default behavior of the mouse over stack viewer - yum!

However, I’m struggling to get the names to be displayed properly and I’m assuming this has to do with trait order.

The viewer is set to display $pieceName$ and the masks all redefine the piece name to be something generic (infantry, artillery, brigadier). However in the viewer all of the infantry and artillery units show up with ‘0’ (zero) as their names - masked or not and the brigadiers show up with ‘name (brigadier) ()’ when unmasked and ‘(brigadier) ()’ if masked.

So the infantry and artillery names are broken.

The brigadier names seem to be working (but I don’t know why there is an extra ‘()’ displayed).

Each unit has a basic piece and a layer that displays the flip-side of the piece. These layers seem to interfere with the display of the names. The layers are configured to be always on, the first layer has no image but a layer name that is the same as the basic piece name, and the second layer has the flip-side image and a ‘-d’ suffix.

If the layer is above the mask trait - the name displays as ‘0’ (zero) but if the layer is below the mask trait the name displays as it is on the layer - not as it is on the basic piece. If I remove the pointless first layer (and thus the layer name) - the pieceName always shows up as ‘0’.

So something is breaking pieceName and something is stopping the display of the Masked name.

Any thoughts how to begin to debug this one?

OK. First clue was this post about ‘0’ (zero) for piece names: https://forum.vassalengine.org/t/name-appears-as-0-when-reporting/7471/1

Indicating that it is likely to be an issue with a layer name being used. If I use $BasicName$ instead, the names display correctly - but still no masking.

OK. Found the bad layer that was giving them all ‘0’ for names. Now the pieceNames are correct - and now the masking is working!!

Moral of the story: don’t give names to your layers unless you want them to modify the pieceName…