[messages] [Technical Support & Bugs] Bug 4308 Workaround?

irishwulf irishwulf at gmail.com
Mon Apr 9 05:27:24 MST 2012

Absolutely, you can put them in manually.  BeanShell supports Java
syntax for if statements, but in most if not all places that you can
enter BeanShell in Vassal, you are working with an expression, not a
statement, so you would want the trinary ? : operators:
{ UnitStrength > 5 ? "Uninjured" : "Injured" }
The If function that Brent has written goes like this:
{ If(UnitStrength > 5, "Uninjured", "Injured") }
The second format is probably easier to read for most people.  You can
see the syntax of the callbacks that Brent has written here:
http://vassalengine.svn.sourceforge.net ... iew=markup[1]
The 'If' function begins on line 66, at least on revision 7868.

  Unfortunately, there is no documentation.

[1] http://vassalengine.svn.sourceforge.net/viewvc/vassalengine/VASSAL-src/trunk/src/VASSAL/script/init_expression.bsh?view=markup

Read this topic online here:

More information about the messages mailing list