Dynamically assigning marker value for game piece layer

I am looking for a way to hide/display game pieces to the players based on who owns them using the game piece layer.

Here is more detailed information:
In the module I am working on there are several railroads. Players can buy these railroads and own them. When someone buys a railroad I highlight that railroad in the players color. I want to add the ability to the module for players to select which players railroads they want to see highlighted or not. So for example the blue player may want to see only railroads owned by the red player. They would click on a black, green, yellow,and white buttons on the toolbar to deactivate the black,green, yellow,and white layers so they can only see their railroads and the red players railroads.

How I was hoping to implement it.
Layers are determined by a marker name with a value. For example Marker - Layer = Land or Marker - Layer = Air on another piece. I was hoping to assign the Marker - Layer value with a dynamic variable like the following Marker - Layer = $OwnerColor$. Then I could change the $OwnerColor$ variable based on who owned that railroad.

My question is, can marker values accept a variable or property? If they cannot does anyone have any ideas on how during the game I can assign a piece to either a numeric layer on the map or a layer based on the player colors (blue, red, black, white, green, yellow)? If I can assign them to a number or color during gameplay I could then easily turn them off using the game piece layer control.

If I cannot use game piece layers and the game piece layer control to activate/deactivate them my other line of attack would be to use the invisible property for the basic piece definition. I would then use a global key command with a filter that check for the piece ownership and for each one that matches the correct color toggle it between invisible/visible. That is the only other way I can see to achieve this. The problem with this method is that I believe when toggled it applies to all player views whereas the game piece layer control settings I believe are separate for each player so each player can have whatever layers activated or deactivated based on their individual needs/preferences.

Extra info:
I am rendering the color highlight for each railroad based on which color player owns the railroad using the layer property (not to be confused with game piece layer) in the basic piece definition. I have six images of the railroads and I toggle through to the appropriate level based on the player the acquired the railroad. I have 28 railroads each with seven images (the six player colors plus one black one when no one owns the railroad).

Thanks in advance for any ideas on how I can solve this problem.

  • John

Hi, John

Sorry for not getting back to you on this question in Skype yesterday …busy.

No, I don’t think you can use a variable for Marker traits. If I’m wrong, I’m sure someone will correct me.

I also don’t think a player can change something on the board without making it visible to all players unless you’re using some sort of Mask or Invisible trait and I don’t think you could use either effectively in this situation without getting really complicated.

However, I can see a very easy way of doing this if you don’t care about a player seeing what another player is highlighting. Without giving it too much thought, this is an example of how I would do it.

Create another layer trait for your railroad pieces and place it above the OwnerColor layer. Have this new layer follow the Property Value of ColorHighlight. Level 0 would be a transparency. Level 1 would be a semi-transparency …like maybe green with 60% transparency.

Give your railroad pieces a Dynamic Property for the ColorHighlight variable. Set it to numeric with min to 0, max to 1, and make sure the Wrap option is checked. Set up a hot key to increment the numeric value by 1 (with the Wrap option, if it’s already 1 it will increment it back to 0).

Now set up your buttons to activate the highlight. If a player selects the Blue player button, for example, you can have the button send a GKC to all pieces in

CurrentMap = Board && OwnerColor = Blue

…that would increase the ColorHighlight dynamic property by 1 on all the railroads owned by the blue player and they would now be highlighted with the green transparency. Since you have this dynamic property set to wrap, clicking the button again would turn the highlight off.

Would that do it?

PS. After looking at your module, the property filter I used

…would actually be OwnerColor = X with X being the number you have assigned to that particular color.