Level Name problem in Layer trait

I have created an “always active” Layer trait for a piece, and I have set the Level Name field to be neither prefix nor suffix. The consequence appears to be that Vassal uses the level name as a substitute for the piece name in reports. Maddening.

For example, I have a piece with the basic piece name “infantry.” I create an always-active Layer trait with 2 levels named “untried” and “veteran”. (I double-quote here for clarity. I do not double-quote the actual fields.) I do not check off “is prefix/suffix” fields. I also have a Report trait “$newPieceName$ is eliminated.” Instead of reporting “infantry is eliminated” as I would expect, I get “veteran is eliminated” or “untried is eliminated.” I.e. the level name has become the piece name.

In truth, I care nothing about reporting the level name. I use it in property tests only. So why not make the level name a prefix? Because then I get “veteraninfantry” or “untriedinfantry” unless I add a space after the level names or before the piece names, which is a headache. If I add it after the level name, then my property tests break because I can’t seem to test against "veteran " or "untried ".

Yes, that is the standard behavior. Otherwise it would be impossible to over-ride the piece name with a Level name.

Yes, this is the intended behaviour. Always has been.

I usually approach this by setting the basic bame to "Infantry " and then setting the level names to prefixes of “(veteran)” and “(untried)”. The you get

Infantry (veteran) moved here
Infantry (untried) moved there

which makes it a lot easier to follow what unit is moving when reading the chat messages.

Then you can use (veteran) and (untried) in your property tests. If you really just want the pieces to be reported always as ‘Infantry’ then a few choices come quickly to mind:

  1. Leave the level name blank and base your property tests on Level Number instead of Level Name

  2. Use $BasicName$ instead of $PieceName$ in your reports.

  3. Set a marker Type = Infantry and use $Type$ instead of $PieceName$ in your reports.


Messages mailing list
forums.vassalengine.org/mailman/ … engine.org

Post generated using Mail2Forum (mail2forum.com)