Talk:How to calculate total of numeric Property of all pieces in particular location/state.

From Vassal

There are two recent Vassal developments (from around Vassal 3.4 onwards) that readers of the original article will want to consider:

1. All traits that move a piece now set the Old… properties. Therefore, simply comparing Old and Current properties is a valid way to check if a piece has moved from one place to another; for example if the condition {CurrentZone != OldZone} is true, then the piece has been moved out of the zone it was previously in.

2. Vassal's bean-shell support now includes the Sum() function that does the calculation on the fly, in place of individual action tracking. Care is required as there is a performance trade-off but it is an acceptable one in many (most?) cases. A Count() function provides for the basic use-case of counting pieces that match specified criteria.

Use of these features is now well established and any problems should be reported on the forum, using the Technical Support & Bugs category.