"Replace with Other" doesn't match layer

Two step unit counter using layers. Name & Level Names are the same on the before & after counters

The counter is replaced but the current layer is not set if the original unit is reduced. I see a red border around the unit when I carry out this action.

Thus spake BoardGameBloke:

Two step unit counter using layers. Name & Level Names are the same on
the before & after counters

The counter is replaced but the current layer is not set if the original
unit is reduced. I see a red border around the unit when I carry out
this action.

In what module are you seeing this?


J.

I am creating a module for 1918/1919 Storm in the West

The replacement sort-of works.
The reported $newPieceName$ & $oldPieceName$ are correct except that the reduced (level 2) of the unit is not set. The replacement unit is defined separately & it not defined in the “Replace with Other” dialog.

Example
Level 1 name is GE 3rd XXX
Level 2 name is (GE 3rd XXX)

Before Replace with Other

After

Note the log shows the correct before and after names. The correct counter is substituted, but the 4th XXX is not reduced in strength.

I have tried changing the order of traits. Experimented with above & below ordering.

If you want to look at my module; here is a link. The vsav sets up some counters

dropbox link

So it turns out that the “match current state” only matches traits that are exactly the same, and even though your layer traits are otherwise identical they have different images. I will be the first to admit, “maybe that’s not how it should work”, but anyway that’s how it currently works.

So one thing you could do… add a DynamicProperty called something like “CounterLayer”, and have it have a “Ctrl+F” “Flip” thing that makes it +1 (and set the property to wrap around between 1 and 2 or between 0 and 1 or whatever you want), and then for the Layer you could set it to “Layer follows Follow Expression” with the checkbox and put your CounterLayer in there. So now it’s the DynamicProperty that controls what side of the counter is showing, and since your DynamicProperty WILL be identical between your pieces, its state WILL be copied. And then the Layer of the new counter will also be “follow expression”, etc. If that thumbnail sketch is too loosey-goosey let me know and I can give you more precise steps.

We stuck a note in the buglist that we ought to make the “match current state” thing be a little more useful/flexible.

Brian

Thanks Brian

I understand your solution, in theory. I’ll investigate and have a go at implementing it. If I need help I’ll shout out. Don’t go too far. :smiley:

Tim

Brian

It works! Using a dynamic property to set the layer does allow “match current state” to connect the dots correctly.

Thanks
Tim
P.S. Now I have to rejiggle the whole module ;-)