My units have several layer “flags” that can be toggled on/off; for this example let’s talk about “Fly CAP”, which is used to graphically flag an air unit as flying a CAP mission.
It is simple enough to create the layer and give it a menu item and key command (CTRL F) to activate when needed. This works fine for a single unit, as pressing CTRL F will toggle it on and off as desired. However, if you fly this unit to another hex and stack it with another air unit which is NOT flying a CAP mission, you run into a stack toggle problem.
Air Unit A is Fly CAP
Air Unit B is not flying CAP
Click on the stack with the intention of toggling CAP off
Press CTRL F
Air Unit A is now not flying CAP
Air Unit B is now set to Fly CAP
Of course the player can double-click the stack then select the unit that he wants to toggle off CAP, but as the stack gets bigger and potentially several units are in varying states of layer activation, this becomes cumbersome.
I did come up with one really rough workaround, which was to create two identical image Levels inside the CAP Layer :
- The CAP layer is Always Active, but the first level is blank (so base state is not flying CAP)
- CTRL F steps through the Levels, so if your stack has a mix of units at Layers Level 1 and Level 2, they end up at Level 2 and Level 3 which are both the same graphic for CAP.
- ALT F is used to “Reset to level 1”, which drops any Layer Level greater than 1 down to Level 1, thus clearing the CAP flag.
Is there a cleaner way to do this? It seems kludgy, and I feel like I must be missing something; surely Vassal has a method to hard-deactivate a layer, not just toggle the state from active/inactive?
I would probably just leave it alone, but now I’m looking for a way to make a trigger or key to reset all Flags when a unit lands on the Dead Unit map. I was hoping to read the Layer property CAP_Active=true, but to get the stack behavior I want my layers are always Active.
I hope that all makes sense to someone