How do you stop no matching pieces from stacking together?

Here’s my problem. I got 2 stacks of cards and 2 stacks of blocks. One stack for each player. Call them black and white. I have used player side trait on these peices thinking that would stop a card from white mixing with a card from black, but it doesnt. I have no issue on the map board itself because card stacking is turned off. But rather off to the side the card stacks themselves don’t seem to care what goes in them. If I pick up a black card and dump it on the white draw deck it will merge right in and cause the whole stack to go black card. And since shuffle is on, the stack will stay black until you keep pulling cards to find the lone black card in there. At which point the deck will return to white. The reverse will happen as well of coarse. Now I know one could just use the undo button to reverse this mistake, but I’m to much of a perfectionist to let this flaw slide. I don’t want these cards to mix period. This issue also extends to the black and white army blocks as well. Since I prefer to define them as a card stack so they fit together more tightly the engine will also let army blocks stack with the draw card decks. And when you drop an army block on a draw deck it turns the entire stack into an army block of like color. It really just the same issue as the cards mixing. So you see I got 4 potential decks on the side that can mix in whatever combo you like.

The trait ‘does not stack’ for cards only applies once played on the game map. So that’s not a solution to this problem. Using ‘marker - side=xxx’ doesnt prevent unlike side pieces from deck stacking which is really hair pulling. I’m thinking that I might have to define a separate layer for each draw stack, but I don’t want to go and rework all of that yet. So I’m asking for a suggestion on what to do here. Thankyou.

It sounds like you want to regulate what can and can’t be put in a deck, basically. The quick answer is that there’s no easy way to do it.

One idea–and I can’t vouch for this without putting together a proof-of-concept module–is to try and leverage the map feature “Key command to apply to all units ending movement on this map” (found at the bottom of a map window’s properties). If you have a Trigger on every card or block that listens for this keystroke you define, you can basically “cancel” a piece’s movement based on criteria you set up.

Example: You draw a Zone on your map surrounding the deck for the black cards, say it’s called “BlackCards”. All the white cards and blocks get a Trigger that listens for the ends-movement-here map keystroke, and with a property match expression of CurrentZone = BlackCards. The result is to fire a Send to Location trait targeting $oldLocation$.

How this would theoretically play out would be that the user tries dropping a white card in the black card deck. The trigger occurs and the module recognizes that movement is ending in the zone you identified in the PME, and intervenes to send the card back to where it was picked up.

The part I’m not sure about is if dropping into a deck takes precedence over dropping into a zone.

If your problem is just about stacking into a “deck” (the Vassal object), it should be easy:
You can “restrict adding counters by Drag 'n Drop” on a deck (at the bottom of the deck configuration panel) and define expressions like type=card && color=white

It prevents only manual operations (you could still send cards to the deck with the send to location or return to deck traits, or by loading from a file).

Oh yeah, derp. Ignore my entire reply (way too overwrought)–the previous post has it. Serves me right for answering off the top of my head without actually firing up VASSAL.

Oh yeah I totally forgot to mention I was trying the restrict drag and drop check box. Problem was I just could not figure out how to define it properly. I will try and use your example as a base and see if I can get it to work without having to ask for more specifics. Thanks for the answers guys.