Create account / Log in

Property matching

Topics related to the main Vassal engine.

Moderators: Tim M, uckelman

Property matching

Postby msward1 » January 16th, 2020, 6:06 pm

Can anyone tell me what I'm doing wrong.

I have a piece sending a global key command to remote pieces (in a piece prototype) piece with matching Marker key.
Local Property Formation = 10Div (same for remote piece.)
Global Key Commnd's Matching Property = {Formation==$Formation$}

The remote piece gets the command and acts on it correctly, problem is all the other Formations (not equal to 10Div) also get the command and act or it?
Posts: 23
Joined: July 23rd, 2015, 4:03 pm

Re: Property matching

Postby Cattlesquat » February 1st, 2020, 1:01 am

The "Matching Property" of a GKC is resolved using the properties of the Piece that receives it, not the Piece that sends it. So both sides of your comparison are actually using the *target* piece's formation.

One way to get around this is, before sending the GKC, set a Global property to the value of the piece you want to search for (e.g. set "SearchFormation" to be "10Div"), and then have your Matching Property compare Formation to SearchFormation if you see what I mean.
User avatar
Posts: 329
Joined: December 2nd, 2019, 4:57 pm
Location: Baltimore, Maryland, USA

Re: Property matching

Postby msward1 » February 18th, 2020, 7:38 pm

Yeah I guess that can work. Maybe I'll have to think on it.
I'm displaying the setting as well and there are many many Divs.
So the displays all get messed up.
This type of variable comparison is a must. It's either a vassal bug or serious oversite.
Posts: 23
Joined: July 23rd, 2015, 4:03 pm

Return to General Discussion

Who is online

Users browsing this forum: No registered users and 4 guests