[messages] [Module General Discussion] Some help with building custom code

capi3101 capi3101a at netscape.net
Wed Sep 11 06:49:36 MST 2013

Alright, I've done a bit of homework, so time to ask for a case. So what
I have in VASSAL is two Strength values, both custom Global Properties,
both integers. Let's say the Global Properties are called P1 and P2.
I've got the case where either of them has a value of zero covered
already via a Trigger Action property, so the chance of a division by
zero error is successfully avoided.  Say P1=6 and P2=4; would the
following expression give me a result of 1.5 or not?

(float)Math.round((P1/P2) * 10) / 10

I'm guessing it hinges on whether or not VASSAL loads up that Math
library or not...I imagine it does, but I don't know for sure. I also
don't know if VASSAL will allow the re-cast.

There's a quick way to find out, I suppose...

Read this topic online here:

More information about the messages mailing list