Create account / Log in

v3.5.5: Mouse-Over Sum() doesn't work

Issues with the Vassal engine.

Moderators: uckelman, Tim M

v3.5.5: Mouse-Over Sum() doesn't work

Postby marktb1961 » May 8th, 2021, 1:45 pm

The [url=file:///Applications/VASSAL%203.5.5.app/Contents/Resources/doc/ReferenceManual/Map.html#StackViewer]documented[/url] Sum() feature is throwing an Expression evaluation error, even for the simplest expressions.

Example: - Bad Data in Module: Expression evaluation error {Sum("IgnoreFLG")}

IgnoreFLG does exist on the test piece (though that shouldn't matter).
Rest of Mouse-Over text was displaying as expected.

Workaround: I will try using piece-based methods in the "below text".

Mark
Platform: Vassal 3.5.7, MacOS Big Sur on iMac (27", mid-2020)
User avatar
marktb1961
 
Posts: 610
Joined: October 4th, 2018, 2:36 pm
Location: Liverpool, England

Re: v3.5.5: Mouse-Over Sum() doesn't work

Postby rdmorss » May 8th, 2021, 3:56 pm

In one of my modules, each unit has a Dynamic Property named strength

In the mouse-over stack viewer component I have:

Text below each piece
Code: Select all
$strength$

Summary text above pieces
Code: Select all
$LocationName$: $sum(strength)$

Has worked in vassal 3.2.17 through 3.5.5
User avatar
rdmorss
 
Posts: 28
Joined: October 4th, 2010, 1:40 am
Location: Sanford Maine

Re: v3.5.5: Mouse-Over Sum() doesn't work

Postby marktb1961 » May 8th, 2021, 7:13 pm

Thank you Robert. That's made me look again... it won't have helped that I capitalised "Sum". Beyond that, I am starting to suspect that the special mouse-over functions, sum() and perhaps $countPieces$, just aren't Beanshell-friendly.

From the manual, as my link as never going to work either:
"Summary text above pieces: A Message Format specifying the text to display above the drawn pieces in the viewer. In addition to standard Properties, you can include $countPieces$ to count the pieces included in the display. You can also include a property with the name sum(propertyName) where propertyName is a property defined on a Game Piece. The sum of the numeric values of this property for all included pieces will be substituted."
Platform: Vassal 3.5.7, MacOS Big Sur on iMac (27", mid-2020)
User avatar
marktb1961
 
Posts: 610
Joined: October 4th, 2018, 2:36 pm
Location: Liverpool, England

Re: v3.5.5: Mouse-Over Sum() doesn't work

Postby marktb1961 » May 8th, 2021, 7:20 pm

Yes, that is it. sum() only works outside of Beanshell and must be enclosed in $...$, like some of the special Report trait properties. Also, the property name must not be enclosed in quotes. A relic of earlier versions of Vassal, I guess.
Platform: Vassal 3.5.7, MacOS Big Sur on iMac (27", mid-2020)
User avatar
marktb1961
 
Posts: 610
Joined: October 4th, 2018, 2:36 pm
Location: Liverpool, England

Re: v3.5.5: Mouse-Over Sum() doesn't work

Postby Cattlesquat » May 8th, 2021, 8:27 pm

I'm glad there's a working method to do it, but we should probably fix the beanshell version too, if you wanted to open a bug for that.

Brian
User avatar
Cattlesquat
 
Posts: 1141
Joined: December 2nd, 2019, 4:57 pm
Location: Baltimore, Maryland, USA

Re: v3.5.5: Mouse-Over Sum() doesn't work

Postby marktb1961 » May 9th, 2021, 3:25 am

Cattlesquat wrote:I'm glad there's a working method to do it, but we should probably fix the beanshell version too, if you wanted to open a bug for that.

Brian



Done: http://www.vassalengine.org/tracker/sho ... i?id=14465
Platform: Vassal 3.5.7, MacOS Big Sur on iMac (27", mid-2020)
User avatar
marktb1961
 
Posts: 610
Joined: October 4th, 2018, 2:36 pm
Location: Liverpool, England


Return to Technical Support & Bugs

Who is online

Users browsing this forum: Google [Bot] and 2 guests