Performing math on DP?

Is there a way to perform division/multiplication on dynamic/global properties? I’ve tried several methods none which seem to work.

Also are DP/GP set to numeric restricted to integers? Being able to use .5 values in the properties would have worked for my module.

Specifically in my module, I have a GP being set by the number and value of coutners being placed in a zone. I’d like to be able to determine what half of that value is and add a die roll to it and display the result.

No, but this is a planned enhancement for either version 3.2 or 3.3. A Calculated Property will allow you to specify a Named Property whose value is a formula referencing other properties. You will be able to include arbitrarily complex mathematical equations.

Numeric properties are restricted to Integers.


Messages mailing list
Messages@forums.vassalengine.org
forums.vassalengine.org/mailman/ … engine.org

Post generated using Mail2Forum (mail2forum.com)

If needed, I already implemented a custom class implementing some basic RPN calculator. It can do addition, multiplication, subtraction, division, maximum, minimum, sum (of the stack), and a few other things (random number, also). If asked, I can provide it. It works quite well.

Ha! I have a custom class that uses JEP (Java Expression Parser) to implement much the same functionality.

The version I plan to build into Vassal will use BeanShell, which can also be used to provide a full scripting language.

BTW, Please let me know if you are interested in assisting with implementing this (and scripting) into Vassal. I am desperately in need of programmers to assist with polishing up and finalising projects I have half built.

Regards,
Brent.


Messages mailing list
Messages@forums.vassalengine.org
forums.vassalengine.org/mailman/ … engine.org

Post generated using Mail2Forum (mail2forum.com)

Will the enhancement also allow non-integer property values? It would be very handy for parts of the F&E module.