Create account / Log in

Global Key Command & Matching Properties

Talk about module design ideas and techniques.

Moderators: Tim M, uckelman

Global Key Command & Matching Properties

Postby geoffreyphipps » June 14th, 2015, 12:29 am

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
geoffreyphipps
 
Posts: 29
Joined: February 24th, 2015, 5:04 am

Re: Global Key Command & Matching Properties

Postby Tim M » June 14th, 2015, 2:21 pm

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:
viewtopic.php?p=49034#p49034
Tim,
Vassal Uber Geek/Guru

Problems? post your OS, Physical Mem, version of Vassal and Java plus the Module in question.
No developer can help with out that info, thx!
User avatar
Tim M
 
Posts: 1777
Joined: December 8th, 2007, 12:22 pm
Location: Earth

Re: Global Key Command & Matching Properties

Postby geoffreyphipps » June 20th, 2015, 3:48 am

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 $
geoffreyphipps
 
Posts: 29
Joined: February 24th, 2015, 5:04 am


Return to Module Design

Who is online

Users browsing this forum: No registered users and 1 guest

cron