Problems with Matching Properties on GKC

I’m at a loss.

I have a deck of cards named Creatures.

Each card may contain a marker that will restrict that creature from appearing in a particular area of the Kingdom. For example: If the creature does not appear in Laurica’s Palace, it will have the Marker trait: LP = No

I have an event button for Laurica’s Palace that will trigger 3 commands:

Remove all creatures with Marker: LP = No from the Creatures deck and send them to a temporary hold deck.
Draw a creature from the Creatures deck
Return all the creatures from the temporary hold deck back to the main Creatures deck.

The problem is in pulling the restricted creatures out of the deck using a variable.

If I use the following Matching Properties on the Global Key Command:

{CurrentMap == “Resources” && DeckName == “Creatures” && LP == “No”}

It works perfectly. In other words, if I name the area of the map directly (in this case, LP), it works just fine. However, I have the map area code as a Global Property called Region. …and if I use the following:

{CurrentMap==“Resources” && DeckName==“Creature_B” && (GetProperty(Region)==“No”)}

…it will not work. I even tried using the old Vassal syntax of:

CurrentMap = Resources && DeckName = Creatures && $Region$ = No

…and that won’t work either.

Why?

After posting my original message, it occurred to me that maybe my use of Region as a Global Property may be causing a conflict with the Region Point system within Vassal. So, I changed the Global Property to District and updated all its uses within the module. It still doesn’t work. I can get:

LP = No

to work just fine but if District = LP, I cannot get either…

(GetProperty(District) == "No) or $District$ = No

…to work.

Try

(GetProperty(GetProperty(“District”)) == “No”)

On 5/09/2016 2:49 AM, DrNostromo wrote:

After posting my original message, it occurred to me that maybe my use
of Region as a Global Property may be causing a conflict with the
Region Point system within Vassal. So, I changed the Global Property
to District and updated all its uses within the module. It still doesn’t
work. I can get:

LP = No

to work just fine but if District = LP, I cannot get either…

(GetProperty(District) == "No) or $District$ = No

…to work.


Read this topic online here:
Problems with Matching Properties on GKC - #2 by DrNostromo


messages mailing list
messages@vassalengine.org
vassalengine.org/mailman/listinfo/messages


No virus found in this message.
Checked by AVG - www.avg.com
Version: 2016.0.7752 / Virus Database: 4649/12944 - Release Date:
09/04/16


Brent Easton
Analyst/Programmer
Western Sydney University
Email: b.easton@exemail.com.au

That didn’t work.

Here’s the full expression used on the GKC:

CurrentMap==“Resources” && DeckName==“Creature_D” && (GetProperty(GetProperty(“District”)) == “No”)

I also nested it with operators for a different creature class to see if that would work. It looks like this:

((CurrentMap==“Resources”) && (DeckName==“Creature_C”)) && (GetProperty(GetProperty(“District”)) == “No”)

That didn’t work either.

Ok,
You have to be a little bit careful when sending GKC’s to face down units in Decks. Units that are Face Down in Decks are masked, but not owned by any player. Masking hides access to properties and commands that you do not own to prevent you from manipulating other players units. So once in a Deck, these properties and commands are hidden from you when you execute the GKC.

Therefore, to be able to do what you want, the District property, the LP property and the Return to Deck traits that move the units between Decks must be defined BELOW the Mask trait in the trait list so that they are visible to all players when the unit is masked.

I suspect your LP trait is defined below the mask but your District trait is defined above, explaining why it worked when you reference LP directly. I recreated your example and was able to get it to work by moving the traits down below the mask.

Regards,
Brent.

I don’t use Mask traits in my module. All cards are permanently face up.

Ok. Here’s a complete breakdown of what’s happening. Maybe you can see something that I’m missing. All traits listed below are in execution order, i.e. I’m listing the bottom trait first and moving up. I have several buttons set up to draw events. I’ll use the Mariah Lowland button as an example as that also takes into consideration terrain restrictions (which I can’t get to work, either).

I have a Button with the following:

Does Not Stack
Select - Yes
Move - No

Action Button
Evoke Key command - E1Click

Trigger Action
Keyboard command - E1Click

Perform these Keystrokes
GetD100Roll
SetDistrict
DetermineEvent

Then I have a prototype named EventML which has the following:

Set Global Property
District
Key Command - SetDistrict
Set Value Directly to ML

Global Hotkey
Keyboard Command - GetD100Roll
Global Hotkey - RollD100 (this gets a random number from 1 to 100)

I now have a multitude of Trigger Actions based on the D100 roll. For this, I’ll stick with the roll that generates a creature.

Trigger Action
Matching Properties - {D100_result > 56 && D100_result < 67}
Keyboard Command - DetermineEvent
Perform these keystrokes - DetermineCreature

The original button then refers to a prototype called CreatureTS1 which has the following:

Trigger Action
Keyboard Command - DetermineCreature
Perform these keystokes
GetDCreatureRoll
SetTerrain
DetermineClass

Global Hotkey
Keyboard Command - GetDCreatureRoll
Global Hotkey - RollDCreature

This get a random number that will determine what class of creature is encountered. We’ll assume the number rolled would generate a Class C Creature

Set Global Property
Terrain
Key Command - SetTerrain
Prompt user to select from list (for this example, we’ll say the player selects M for mountainous terrain)

Trigger Action
DCreature_result > 95
Keyboard Command - Determine Class
Perform these keystrokes - DetermineCreatureC

If then goes to another prototype, in this case, called CreatureC, which has the following:

Trigger Action
Keyboard Command - DetermineCreatureC
Perform these keystrokes
RemoveDistrictC
RemoveTerrainC
GetCreatureC
ReturnSort

Global Key Command
Keyboard Command - RemoveDistrictC
Global key command - SendToSort
Matching Properties - CurrentMap = Resources && DeckName = Creatures_C && $District$ = No
All pieces

Global Key Command
Keyboard Command - RemoveTerrainC
Global key command - SendToSort
Matching Properties - CurrentMap = Resources && DeckName = Creatures_C && $Terrain$ = No
All pieces

Global Key Command
Keyboard Command - GetCreatureC
Global key command - SendToMain
Matching Properties - CurrentMap = Resources && DeckName = Creatures_C
1 piece

Global Key Command
Keyboard Command - ReplaceSorts
Global key command - Trash
Matching Properties - CurrentMap = Resources && DeckName = Sort_1
All pieces

So, any creature that has a Marker trait with ML=No and/or M=No should be sorted out before a creature is drawn from that deck. But they are not.

Do you see anything here that could mess this up?

Drat, I was able to exactly reproduce the problem you described, and fix it for face down decks.

I can’t see anything obvious in your setup that would cause the problem,

I have reproduced the situation you describe in a noddy module and it works perfectly with no problems using GetProperty(GetProperty(“District”)) where marker District contains “LP” and marker LP contains “No”.

At this stage I can only suggest debugging by either cutting down your existing setup or building up a noddy module to match and further isolate the problem.

Rgds.

I’m going to make a sample mod now to duplicate what I’m doing on a much smaller scale to see if it causes the same problem.

Well cut off my legs and call me shorty. I just found a “space” typo. Those are kind of hard to see. All better now.