I am currently working on Popular Front VASSAL module. I am using the Game Piece Inventory feature and can’t get it to work.
I used a trait for all cards that have a marker “countthis” and set the marker to “yes”.
I then check for:
((CurrentMap==“Anarchist Hand”)||(CurrentMap==“Socialist Hand”)||(CurrentMap==“Communist Hand”)||(CurrentMap==“Requetes Hand”)||(CurrentMap==“Carlist Hand”)||(CurrentMap==“Falange Hand”)) && countthis==“yes”
I then setup the window (see attachment).
I have seen this work in another module, but for the life of me does not work here.
(Note all the example I see are for a “Player Hand” Object, I am using a Private Window and I do not know if that makes a difference.
I use private GPIWs all the time and don’t have any issues implementing. I don’t see anything amiss with the options that you selected in the GPIW. My guess is that your property expression is not evaluating as expected. I don’t see a syntax error but I find the following method of writing that expression much cleaner and less prone to typos:
Also this is just something I do, but I avoid boolean expressions. I’m always scared that there will be an uppercase / lowercase / quotes / no quotes typo. So I just use something like CountThis==1 where 0 is no and 1 is yes. It also leaves the door open for trickery like conditions when the value is set to 2 or 3. So maybe make sure that the properties for countthis are all lowercase in your pieces?
Problem solved!
I am tweaking this setup, but game has pre-defined scenarios that it loads, apparently in that case the piece counting did not work since the new traits were added after the saved file!
Correct, you really can’t add features like this and expect to see your changes reflected if you are loading predefined setups. Basically a cardinal rule of VASSAL editing.
Just a quick suggestion: I would think
{CurrentMap=~"Hand" && countthis=="yes"}
would work just as well and be a lot less prone to typos (the “=~” searches for a regular expression match, so any Map that contains the text “Hand” will match).