Create account / Log in

Global key expression builder vs legacy

Issues with the Vassal engine.

Moderators: Tim M, uckelman

Global key expression builder vs legacy

Postby barbanera » January 22nd, 2019, 9:07 pm

I apologize if this is already a know bug/issue (feature..), but I just noticed that a global key command written in the old style as follows:

Matching Properties: CurrentZone=$Dummy$

is parsing for Dummy the value of a variable with the same name on the piece where the global key is (source).

However, when using:

Matching Properties: {CurrentZone==Dummy}

it looks like Dummy is parsed from the target piece.

That's really confusing because {CurrentZone==Dummy} is exactly how CurrentZone=$Dummy$ gets translated in automatic from the Expression Builder and one would expect identical behaviour.

I tried

Matching Properties: {CurrentZone==GetProperty(Dummy)}

but that seemed to match nothing at all (neither reading Dummy from source nor from target).
barbanera
 
Posts: 378
Joined: January 12th, 2012, 2:27 pm

Re: Global key expression builder vs legacy

Postby Brent Easton » January 23rd, 2019, 5:37 am

Hi.

First up, GetProperty() requires a string argument, so {CurrentZone==GetProperty(Dummy)} should be {CurrentZone==GetProperty("Dummy")} which should then return the same results as your first two options.

There is a bit of an oversight in the GKC handling. Any $property$ references are always evaluated before an expression is sent to the target piece for evaluation, but there is no way to force this in the {} notation except by continuing to use $property$.

So, I believe what you need is

{CurrentZone=="$Dummy$"}

Regards,
Brent.
User avatar
Brent Easton
 
Posts: 2836
Joined: December 21st, 2007, 3:06 am
Location: Berry, NSW, Australia

Re: Global key expression builder vs legacy

Postby barbanera » January 23rd, 2019, 7:35 pm

Thanks Brent.

It's not mission critical to me now (as the legacy CurrentZone=$Dummy$ works perfectly), but take note that I just tried and {CurrentZone=="$Dummy$"} does not seem to work either.

P.S. More precisely what I am actually using is something like

Class=Card && CurrentZone=$Dummy$ Market (legacy, working)

vs

{(Class=="Card") && (CurrentZone=="$Dummy$"+" Market")} (not working)
barbanera
 
Posts: 378
Joined: January 12th, 2012, 2:27 pm


Return to Technical Support & Bugs

Who is online

Users browsing this forum: stew-rt and 5 guests