Title is probably too long and a little vague. But here goes.
I have 1 map with 4 zones. Each zone has a global property. Players can place specific GPs into this map or just copy an existing GP to show ‘ownership’ of a particular attribute. Attributes are, for info, resources (basic & oil) and factories (red & blue). Each specific GP is linked via prototype to a nation (8 major).
I have a production map for each nation. I want to have a counter on this map that will calculate the nations build points (BPs). I need an expression to generate a total of the GPs for each zone of the first map mentioned, for each nation, individually. Generating the available BPs from there is relatively easy.
I’ve searched the forums and maybe I’ve not used the right word search combo. ATM I have not found anything.
I have no idea how to proceed.
Let’s deal with the 1st zone. It’s called basicres and the global property is called baseres. I have the specific GP for the nation China with a marker value of 1 and a setglobalproperty (chown) of 1 (no key commands set ATM). For the counter that will reside in the other map, I can access the zone global prop, but how can I use this the do NumPieces, or whatever, to get a number of the specfic GPs in that zone for that nation?
I’m not sure exactly what procedure you’re hoping, but I have used the following procedure to “count things up” on maps, either in specific locations or anywhere in a zone, or anywhere on a map:
All of this is fired sequentially from a single piece doing the processing -
(1) Zero out global properties for e.g. “China_Oil”, “China_Basic”, etc.
(2) If needed, set GP’s for filtering purposes e.g. set “ActiveZone” to “basicres”, or “ActivePlayer” to “China” or whatever. So that in a minute when you send out a GKC to the world, the pieces you care about will be able to identify themselves as matching the property you care about.
(3) Now send out a Global Key Command called e.g. “ResourceCOUNT”. Make the matching expression as appropriate (e.g. “Zone == ActiveZone”, etc, to filter to what you actually want to count itself.)
… now each piece receiving a ResourceCOUNT has a trait entry for its appropriate matching resource GP’s, and will do an “increment by 1” on that GP.
(4) Now the original piece which fired off the commands has access to the GP’s which now contain the correct values. So if the original piece happens to be the marker on the chart that keeps the count, it could now “Send To Location” itself to the correct position matching the value. Or if it’s some other kind of piece it could take some other kind of action. Obviously you want to minimize the total number of GKC’s you send out, because they’re performance intensive, so ideally you count this stuff up only when needed, do it once, and then make all the decisions you need from it at one time.
Hopefully that at least aims you in the right direction!
I just can’t quite understand what you are suggesting. I can follow some of it Perhaps I’ve too little in depth knowledge. That and I was GP to mean game piece. Notwithstanding, thank you very much for responding with what would work - as it has for you. After posting this message, I found something else under ‘tips and tricks’. With some additional help (https://forum.vassalengine.org/t/use-of-the-tip-trick-calculate-total-of-numeric-property/10347/1) I got the game piece to work in another map window. Yeh. Now all I’ve got to do is to try and get it all together for the other 3 zones and for each major power (32 iterations all up).
Again, many thanks for your help. Very much appreciated.
Oh, haha, I was taking GP to mean Global Property!