I am trying to have the automatic placement of a “Spotted” marker when a piece moves into the same hex as an enemy piece. The enemy piece is hidden. I have tried multiple suggestions online but nothing seems to work.
Unless you’ve configured your Mask trait of the enemy unit, so that Can be masked by is Any Player or Any Side, then only the owning side - the side that hid the unit initially - may reveal the piece.
As you piece is moving into the location of the enemy unit, and the [Map Window](https://vassalengine.org/doc/latest/ReferenceManual/MKey Command to apply to all units ending movement on this mapap.html#top) _ configured Key Command to apply to all units ending movement on this map is executed by your piece, then it is executed in the context of your side. If the enemy piece was hidden by an opponent, then your side cannot unmask the enemy piece.
In short, it will not work, unless anyone can unmask pieces that are not own by themselves.
I think we need a key command configuration that will unmask a piece unconditionally. The module designer should of course take measures to not execute that command willy-nilly and only in the case of very specific events. Preferably, the key command should only allow named key commands, so that a key short cut cannot trigger the unmasking.
I am just trying to drop a “spotted” marker in the hex. Both sides are invisible to the other player and are found by searching. The owning player is responsible for revealing the counter once spotted.
As far as I can tell the problem seems to be in the GKC matching expression. If I clear this field the marker is Spotted placed, but placed as soon as the piece is placed on the map, regardless of hex.
Aren’t the FastMatch to CurrentLocation and range limitation doing the same thing the CurrentHex check is trying to do? If so, could you not get the same result without the CurrentHex condition?
Presumably you need the != “Allied” check to stop the piece from sending the command to itself, so no check at all gets the result you described. What happens if you keep the != “Allied” check, and removed the CurrentHex check?