Create account / Log in

Beanshell puzzler

Issues with the Vassal engine.

Moderators: uckelman, Tim M

Beanshell puzzler

Postby marktb1961 » October 29th, 2020, 4:54 pm

I'm trying to use Count{} in a Restricted Command expression but i'm getting this error.
Any one got any pointers for where I'm going wrong or things I can try?

- Bad Data in Module: Expression evaluation error Expression={Count("{CurrentX==$CurrentX$ && CurrentY==$CurrentY$ && can_garrison==true}","Main Map")==0 && maintenance==false}, Error=Method Invocation _interp.count
Platform used:
Vassal 3.4.11
MacOS Big Sur
iMac (27", mid-2020)
User avatar
marktb1961
 
Posts: 342
Joined: October 4th, 2018, 2:36 pm
Location: Liverpool, England

Re: Beanshell puzzler

Postby Brent Easton » October 29th, 2020, 11:18 pm

What you have done looks good.

There was an issue in this area http://www.vassalengine.org/tracker/sho ... i?id=13291 but it should have been fixed in version 3.4.0.

However, a quick debug session shows me something whacko is going on. I have opened a new bug report and will investigate.
User avatar
Brent Easton
 
Posts: 3229
Joined: December 21st, 2007, 3:06 am
Location: Berry, NSW, Australia

Re: Beanshell puzzler

Postby marktb1961 » October 30th, 2020, 7:52 am

Thanks Brent; appreciate the update. I can stop tearing my hair out... which is just as well.
Platform used:
Vassal 3.4.11
MacOS Big Sur
iMac (27", mid-2020)
User avatar
marktb1961
 
Posts: 342
Joined: October 4th, 2018, 2:36 pm
Location: Liverpool, England

Re: Beanshell puzzler

Postby marktb1961 » November 11th, 2020, 4:52 am

V3.4.8 appears to fix the problem that I was having, with one exception; I am seeing the same error messages as before but only generated from pieces that have been placed via the Replace Marker trait - i.e. the first action taken to do such a replace, generates the messages shown below:

Code: Select all
- Bad Data in Module: Expression evaluation error Expression={Count("{LocationName==\"$LocationName$\" && Type==\"Garrison\"}","Main Map")>0}, Error=Method Invocation _interp.count
- Bad Data in Module: Expression evaluation error Expression={Count("{CurrentX==$CurrentX$ && CurrentY==$CurrentY$ && can_garrison==true}","Main Map")==0 && maintenance==false}, Error=Method Invocation _interp.count


However, the functionality that these expressions supports still operates, even on the Replacement pieces. This was not the case before.

Is this some kind of Refresh Counters issue that I am seeing here?

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


Return to Technical Support & Bugs

Who is online

Users browsing this forum: marktb1961 and 9 guests