Is Math Possible within a Matching Statement?

Is it possible to add two values together in a Matching Properties statement?

What I’m looking to do is add two properties before I compare the sum to a third.

The statement would look like this <providing the math delimiters were “(” and “)”>:

(DR_result + DR_modifier) <= $Impulse$

I don’t want to add the modifier to the DR in the dice roll button because

  1. I’m trying to limit user inputs in determining events
  2. I need to evaluate the DR_result for multiple possible events.

If it’s a syntax issue could someone direct me to the location in the documentation?
Otherwise, if the feature is not available does anyone know of any module out there that has an imported class that does that?

Vassal does not do math expressions at this time. The next version (3.2) will have a math engine included.

For now, what you would need to do is use a Dynamic Property or Set Global Property trait to increase/decrease a value. Then you can use property filters to compare that value to another value.

There are java math engines you can incorporate into a mod like Beanshell or Jep but, since Vassal will have a math engine soon, I don’t know if you want to go through the trouble and potentially risk compatibility issues with future versions of Vassal.

Dr Nostromo, thanks for the quick reply. No sooner than when I pressed submit, I thought about using the Global Property route. I was being lazy and was hoping for an easier solution. I’ve never worked with the Dynamic Property feature, so maybe I’ll go that route. Just for fun.

There isn’t much difference in the ways that Dynamic Property and Set Global Property works. Main difference is the Dynamic Property applies specifically to the game piece it’s used on whereas Set Global Property adjusts an defined Global Property.