VASSAL Reference ManualHome > Expressions |
|||||||||||||||||||||||||||||||||||||||||
Expressions![]() Any field within the Vassal Editor that is followed by a Calculator icon ![]() Property Match Expressions are a special kind of expression that are used in Global Key Commands to select what counters to operate on, and in Trigger Action traits to check if the action is Triggered. These are described on a separate page. There are two varieties of Expressions. BeanShell Expressions are identified by being surrounded by curly braces {}. They are very powerful and can be arbitrarily complex. Simple Expressions are identified by not being surrounded by the curly braces {}. Simple Expressions are far less powerful than BeanShell expressions and are supported to provide compatibility with earlier versions of Vassal. Expressions should not be confused with Message Formats that are used by various traits and component to generate messages. Message Formats are far more limited than Expressions. They only allow the inclusion of Property values, they do not allow any sort of calculations. BeanShell ExpressionsBeanShell Expressions (named after the software package the implements them in Vassal) allow you to use arbitrarily complex formulae to define the value returned. BeanShell Expressions are marked by being surrounded by braces {}.The BeanShell processor is an accurate implementation of the Java programming language and BeanShell Expressions are made up of Java language components. You can use any introductory Java tutorial to learn more about the syntax of BeanShell Expressions. The basic components are as follows:
Simple ExpressionsSimple expressions are not surrounded by braces and provide compatibility with earlier versions of Vassal that only implemented a much simpler version of Expressions. Simple Expressions are far more limited than BeanShell Expressions, only allowing the substitution of property values into a pre-determined string.
SEE ALSO: Properties |
|||||||||||||||||||||||||||||||||||||||||