Possible bug with v3.4.0 release candidate

Just tried v3.4.0 with my San Marco mod:

vassalengine.org/mediawiki/i … odqueued=1

The mod works fine with v3.3.2 ( or earlier ) but with the new v3.4.0 do this:

  1. Start an offline game ( pick “yellow” as your player )
  2. Pull off 5 ( green-backed ) limit cards off the draw pile ( right, 2nd to top pile of cards ) and put them to the right of the board
  3. Drag/area select all these 5 cards
  4. Right click them and choose “Add to my limit”

What should happen is JUST THESE 5 selected cards should move to the green discard pile automatically ( this has happened with all pre-v3.4.0 VASSAL releases ) and is as I programmed the mod.

What happens with v3.4.0 is ( I think ) ALL green cards ( even the ones still in the draw pile ) go to the green discard pile ( because the draw pile is suddenly depleted as well ).

The above link to the module results in a message about a change being sent for moderation.

Proper link to San Marco module:

vassalengine.org/wiki/Module:San_Marco

Thanks for the report and I have opened issue 13378 for this problem.

I have been able to reproduce the problem you did describe and confirm that it did work differently on earlier versions. A quick inspection of the module shows you have used invalid constructs in your Beanshell Property Expressions and the fact that it ever worked at all is more by good fortune than anything else. As we fixed some other bugs, it caused this particular invalid construct to stop working.

However, the particular construct you have used ( {$variableName$==“String”}) has been used by other modules and we did add a fall-back mode that should have allowed your module to keep working. I am investigating as to why this hasn’t happened.

Regards,
Brent.

PS. The correct Beanshell would be {variableName==“String”} (preferred) or {"$variableName$"==“String”}

Thanks for the correction - I’ll put it into the mod

Ok, I have had a closer look and the problems are being caused by the use of

{$Selected$ == “true”}

This use of $xxx$ variables was designed to have a special meaning when used in the Matching Expression field of Global Key Commands that is described in the reference manual. Unfortunately, it never worked until we fixed it for 3.4.0 and your module just happens to use this exact same construct.

I was able to get you module to work as before by changing {$Selected$ == “true”} to just {Selected}

Beanshell knows that “true” means True, so that’s not needed, and using $Selected$ inside a Property Match Expression causes it to be evaluated against the piece issuing the GKC, not the piece receiving the GKC. The issuing piece is always Selected, so the expression is always true, so every card in the Discard deck was also being scooped up in the GKC.

I edited the buildfile to make the change in bulk, but you might want to pull all those repeated Triggers and GKC’s out of the units in the At-Start stack and into a prototype, it will make future maintenance much easier.

Regards,
Brent.

Will do

@Brent

I’ve done the two changes you pointed me to:

all {$Selected$ == “true”} become just {Selected}

and changed all {$variableName$==“String”} to {variableName==“String”}

and this updated mod works as expected in both v3.3.2 and v3.4.0

Thanks.