# Problem with implementing Gamepiece Inventory Window

**URL:** https://forum.vassalengine.org/t/problem-with-implementing-gamepiece-inventory-window/11109
**Category:** Module Design
**Created:** [September 7, 2020, 7:42am UTC](https://forum.vassalengine.org/t/problem-with-implementing-gamepiece-inventory-window/11109 "2020-09-07T07:42:14Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![msoong](https://forum.vassalengine.org/letter_avatar_proxy/v4/letter/m/779978/32.png) [@msoong](https://forum.vassalengine.org/u/msoong)
#### Post date: [September 7, 2020, 7:42am UTC](https://forum.vassalengine.org/t/problem-with-implementing-gamepiece-inventory-window/11109/1 "2020-09-07T07:42:14Z")

</div>

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.

Any help appreciated…

---

<div class="post-metadata">

### Author: ![m3tan](https://forum.vassalengine.org/user_avatar/forum.vassalengine.org/m3tan/32/229_2.png) [@m3tan](https://forum.vassalengine.org/u/m3tan)
#### Post date: [September 7, 2020, 3:17pm UTC](https://forum.vassalengine.org/t/problem-with-implementing-gamepiece-inventory-window/11109/2 "2020-09-07T15:17:48Z")

</div>

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:

CurrentMap=~“Anarchist Hand|Socialist Hand|Communist Hand|Requetes Hand|Carlist Hand|Falange Hand” && countthis==“yes”

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?

---

<div class="post-metadata">

### Author: ![msoong](https://forum.vassalengine.org/letter_avatar_proxy/v4/letter/m/779978/32.png) [@msoong](https://forum.vassalengine.org/u/msoong)
#### Post date: [September 7, 2020, 4:42pm UTC](https://forum.vassalengine.org/t/problem-with-implementing-gamepiece-inventory-window/11109/3 "2020-09-07T16:42:36Z")

</div>

Thanks I tried but no avail. Will leave this be for a while and come back with a fresh look later maybe I will catch it.  
Thanks for the suggestion.

---

<div class="post-metadata">

### Author: ![msoong](https://forum.vassalengine.org/letter_avatar_proxy/v4/letter/m/779978/32.png) [@msoong](https://forum.vassalengine.org/u/msoong)
#### Post date: [September 7, 2020, 5:22pm UTC](https://forum.vassalengine.org/t/problem-with-implementing-gamepiece-inventory-window/11109/4 "2020-09-07T17:22:59Z")

</div>

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!

---

<div class="post-metadata">

### Author: ![JoelCFC25](https://forum.vassalengine.org/user_avatar/forum.vassalengine.org/joelcfc25/32/2687_2.png) [@JoelCFC25](https://forum.vassalengine.org/u/JoelCFC25)
#### Post date: [September 7, 2020, 9:53pm UTC](https://forum.vassalengine.org/t/problem-with-implementing-gamepiece-inventory-window/11109/5 "2020-09-07T21:53:55Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![msoong](https://forum.vassalengine.org/letter_avatar_proxy/v4/letter/m/779978/32.png) [@msoong](https://forum.vassalengine.org/u/msoong)
#### Post date: [September 7, 2020, 10:42pm UTC](https://forum.vassalengine.org/t/problem-with-implementing-gamepiece-inventory-window/11109/6 "2020-09-07T22:42:45Z")

</div>

yep, hard lesson learned…  
(I needed a setup for our 6 player playtest, THEN I was adding card count window due to player demand, that’s how…)

---

<div class="post-metadata">

### Author: ![jrwatts](https://forum.vassalengine.org/user_avatar/forum.vassalengine.org/jrwatts/32/6972_2.png) [@jrwatts](https://forum.vassalengine.org/u/jrwatts)
#### Post date: [September 7, 2020, 10:47pm UTC](https://forum.vassalengine.org/t/problem-with-implementing-gamepiece-inventory-window/11109/7 "2020-09-07T22:47:02Z")

</div>

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).

---

<div class="post-metadata">

### Author: ![msoong](https://forum.vassalengine.org/letter_avatar_proxy/v4/letter/m/779978/32.png) [@msoong](https://forum.vassalengine.org/u/msoong)
#### Post date: [September 8, 2020, 7:04am UTC](https://forum.vassalengine.org/t/problem-with-implementing-gamepiece-inventory-window/11109/8 "2020-09-08T07:04:03Z")

</div>

Ah thanks for the tip, will remember…
