I hesitate blaming Vassal for something that in 99% of the cases is my own fault, but I think I have investigated this bug very carefully, so here goes:
In my module for The Burning Blue 2.3 (Module: The Burning Blue) there is a somewhat complicated function to set up RAF squadrons in their appropriate boxes on a special map called a Tote Board. When this function is called for the first time after the module has been loaded, a Bad Data error message is printed for each squadron:
If we look in the error log, one of these messages looks like this:>
2024-05-25 14:27:03,335 [20752-AWT-EventQueue-0] WARN VASSAL.tools.ErrorDialog - Piece: 54 Sqn (A0) Trait: Trigger Action - Only one of Order, Tally Ho, and Orbit markers for an air unit is allowed - Place Tally Ho! marker => Ctrl+Shift+T => PlaceTallyHoRAF2 - PlaceTallyHoRAF3 - PlaceTallyHoRAF4 Source: {OrderType&&(UnitID==“54 Sqn”)} Error: Expression evaluation error. See the errorlog for more details.
Expression Audit:
Source type=Piece Trait
Source name=Piece: 54 Sqn (A0)
Source description=Trait: Dynamic Property - AssignedAirfield == SetAirfield
Source Expression={OrderType&&(UnitID==“$ShortName$”)}
OrderType=
UnitID=
Error=internal Error: Unimplemented binary String operator
The trait is the same in all of the messages, and it can be identified to be located in [Game Piece Prototype Definitions] - “PlaceOrderTallyBr”:
The Bad Data comes from the trait in Line 2.
The problem here is that this trait is not called at all in the procedure to set up the RAF squadrons!
It can be proved simply by deleting line 2, in which case the former line 3 will appear in Bad Data messages instead, and if you delete the line, the next line will be causing the messages. It is clear that whatever is at that location in memory will be called, and causes an error - fortunately, because if it had not caused an error, it would be even more difficult to locate.
As I said, this error appears the first time the function is called. If you close the game, and start a new one, the error will not appear. I have taken this as another clue that it is a bug in Vassal, not in the module.
The error must be caused in the GKC that calls a trait in each of the RAF squadrons. The GKC is [Game Piece Prototype Definitions] - “ScenarioActions [Definition]”, line 5:
The command that is called in each RAF squadron is [Game Piece Prototype Definitions] - “SquadronReadiness”, line 1:
If you remove all the lines in the trait so that only a single Report action is called, you will still get the Bad Data error, so the bug does not seem to lie in this trigger action, which is why I think it must be caused by the execution of the Global Key Command.
When I look at the GKC, I am at a loss of how I could test it further. I have tried removing the conditions for pre-selection and additional matching expression altogether, and the bug still appears.
If you want to reproduce the bug, follow these instructions:
1) Load the module (it must not be loaded in advance).
2) Select scenario 1 (any scenario except “Build Your Own” will do.
3) Select Player side RAF.
4) Press Alt+Shift+T to open the RAF Tote Board.
5) Press the blue button “Setup Squadrons”.
This should produce the messages that show the bug - unless you have removed some of the command lines in the Trigger Action.
If you modify anything, don’t forget to Refresh Predefined Setups and save the module and quit, so that the bug will appear after the module has been reloaded.