Your problem stumped me, so I created my own small test module to understand what was going on. I normally don’t control-left click multiple pieces at a time, so I easily would miss this.(And it’s likely I have a similar problem in modules I’ve made, and I don’t even know it.)
And you are right. I got mine to behave the same as yours. At first I thought it was a Vassal bug, but the more I thought about it, the more I think Vassal has no choice but to behave as it does. It took me some work, but I think I have figured out how to get around it. First I’ll tell how what to do, and later I will explain why it didn’t work as we hoped.
- Edit one of your car pieces (e.g. “brakes”). Then edit the layer trait. At the top is the space for a name. Type in a brief name, and please don’t embed spaces in the name. For example, “brakes.” Later when I refer to “layerName”, I mean your specific layer name. You should substitute what you typed there (brakes) in place of layerName, You will need to do this for all your pieces, but for now let’s do one at a time.
I am assuming, by the way, that each of your layers has 3 levels corresponding to -1, 0, +1.
- Add a new trait to this piece called “restrict commands.” For the restriction field you can choose hide or disable. Hide will make a command completely disappear; disable will gray it out. Choose one. I don’t care.
For “restrict when properties match,” we will tell Vassal the condition when the command will NOT be available. This is a bean shell expression. Here you will type this: { layerName_Level == 1 }
Yes, the expression must be enclosed in curly braces. If you instead click on the icon to the right, which looks like a calculator, you enter the expression without the braces. It will add them for you, and you should see a green checkmark to indicate your syntax is correct or a red X if it isn’t.
For “restrict these key command,” click on the “+” to create a blank line, and type minus1 in the left space What this restrict command will do is to not allow anyone to subtract one from the layer level when the level is 1. We need this primarily to shut down the “minus1” in the global property.
- Add another restrict commands trait. Yes, you need two of them. In this one, you will have {layerName_Level==3} and the command is plus1.
Do this for all the pieces in this player’s window. Then check it out, and if you are happy, do the same thing for the other players. You could do all of this in protypes, by the way, and save yourself a lot of work.
So why didn’t it work? Suppose you have three pieces, and you left click on A, B, and finally C, which selects all of them. Then right click C, and choose some valid command. Let’s say it translates to “minus1.” What it does is it unconditionally sends minus1 to all the other selected pieces as if C had issued a global key command to A and B. In your case it caused the set global property to subtract from “sum,” even though we thought we had stopped that via the layer. I did discover though that by using restrict commands, I could stop it.
This is something I never check for or anticipate, so this ticking bomb is probably there in most of my modules. I wish I could disable the control click feature, but alas, I can’t, and I just have to hope no one sets it off. Thanks for bringing up your problem because I learned something out of it.