Vassal 3.4.1 error message not very helpful

On testing Pax Pamir 2e in Vassal 3.4.1, the very first step in a new game (choose a player side, open setup window, click setup for X players) takes much longer than it used to, and returns a couple of errors.

The two error reports are rather unhelpful, stating that {CurrentZone==} is a bad expression. Without knowing what is on the other side of the CurrentZone, it’s hard to track down what expression worked in 3.3 and no longer works in 3.4.1.

It’s also not obvious what actually went wrong. I’m told that market refresh is also broken (not yet tested), but this post is about the error report itself (although any help in making 3.4.1 friendly expressions would also be appreciated).

vassalengine.org/wiki/Module … nd_Edition

The problem will be where you have used un-quoted $$ variables inside Property Match Expressions.

Looking at your module, it is these:

{CurrentZone==$BitOld$}
{CurrentZone==$BitCurrent$}

These need to be replaced with either

{CurrentZone==BitOld}

or

{CurrentZone=="$BitOld$"}

depending in whether you want BitOld to be evaluated on the piece issuing the GKC (version 2) or on the piece that is the target of the GKC (Version 1).

The fact that these invalid expressions worked at all on older versions of Vassal was merely chance, They are incompatible with the correct operation of GKC’s.

It is extremely difficult to provide meaningful error messages in some cases because the errors occur deep down int the bowels of Beanshell that we don’t necessarily have access to. The ‘{CurrentZone==}’ is appearing because the $BiltOld$ in you GKC expressions is now being correctly (as per manual) pre-evaluated on the piece issuing the GKC and is evaluating to “”.

I have added an issue to the track to review and improve Beanshell error messages.

Regards,
Brent.

Thanks for the help!

If possible, please make the error reports more informative.

(Also, with the improvements to Vassal, is the whole rigamarole of using BitOld and BitCurrent as substitutes for OldZone and CurrentZone no longer necessary?)