SumMap not working

I have a use case where I need to both count and sum a particular property value of pieces. I am using “Set Global Property” (“Set Value directly”, triggering on the “Update” key command) for both.

Count works great, but Sum doesn’t appear to work. I’ve tried multiple permutations, but so far haven’t been able to get it to work.

(Note I find it odd that these two very similar expressions, reverse the order of property and map name).

CountMap(“Main Map”,WorldCount,“{Owner=="Red"}”)

SumMap(WorldCount,“Main Map”,“{Owner == "Red"}”)

Any help appreciated…

If this is the name of the property that you wish to Sum, then it needs to be in quotes like the other parameters.

The same is true for CountMap too, by the way. I can only imagine Vassal is counting a null-named property on every piece where Owner=Red, so it seems to be working but only by luck.