Global Key Command & Matching Properties

I have almost got my casualty track system working, but I don’t seem to be able to restrict the target of the key command using the Matching Properties" field. All of the possible targets respond.

The Matching Property is
{definingBrigiment$==owningBrigiment}

owningBrigiment is defined in on the unit losing the step loss (i.e. the source of the message).
definingBrigiment is defined on the counter on the casualty track. Each counter here has its own value, so ideally only one of them should respond. But they all respond. I suspect something is wrong with my expression, but I can’t work out what

Any hints?

cheers
Geoff

Don’t use the builder

Type in

$definingBrigiment$ = owningBrigiment

The builder will/should then correct with brackets and remove the $

From: messages [mailto:messages-bounces@vassalengine.org] On Behalf Of
geoffreyphipps
Sent: Saturday, June 13, 2015 7:30 PM
To: messages@vassalengine.org
Subject: [messages] [Module Design] Global Key Command & Matching Properties

I have almost got my casualty track system working, but I don’t seem to
be able to restrict the target of the key command using the Matching
Properties" field. All of the possible targets respond.

The Matching Property is
{definingBrigiment$==owningBrigiment}

owningBrigiment is defined in on the unit losing the step loss (i.e. the
source of the message).
definingBrigiment is defined on the counter on the casualty track. Each
counter here has its own value, so ideally only one of them should
respond. But they all respond. I suspect something is wrong with my
expression, but I can’t work out what

Any hints?

cheers
Geoff


Read this topic online here:
https://forum.vassalengine.org/t/global-key-command-matching-properties/7769/1

I am back to this again after a break. I re-read the section on expression in the manual, although I think it is out of date. The Help on the Global Key Command is better, but unfortunately the example uses the same variable names on source and target, so it is hard to follow (see below).

On source (the combat unit) if I use a constant string for the matching expression for the GKC as:
{definingBrigiment==“1A”}
then it works, but if I follow the advice of the Help and use $varname$ then it does not:
{definingBrigiment==$owningBrigiment$}
definingBrigiment is on the target counter, owningBrigiment is on the sending counter.
I have also tried it with only one $