Globals - delete piece on only the map?

HI all,

I have a global command triggered by an end-turn action that removes certain markers from the main map window. I’ve just noticed that it removes those same markers from the scenario card window as well! That means a supply marker on the map goes away (perfect), but also every supply marker on the scenario card (that will be available in future turns) goes away as well (bad!).

How do i generally modify the delete command to only affect pieces in the main map window? Thoughts?

There is a system property called “CurrentMap” which reports on which map each piece currently resides. So if the name of your main map is “Main Map”, you want to add to your existing Beanshell expression {[EXISTING EXPRESSION] && CurrentMap==“Main Map”} to your Global Key Command. This will limit the GKC to only pieces on the Main Map. Those that are not on the Main Map would fail that expression test. Another way to solve the problem would be to add a Restrict Command to each affected piece with the expression {CurrentMap!=“Main Map”} that would disable the key command that is executed by the GKC. This is a less efficient method, but I’ve had to resort to it in a few unusual circumstances.

Perfect, thanks.