In VASSAL terminology this works the other way around–see the “Levels follow expression value” portion of the Layer documentation. This sounds like a straightforward application of that technique. A changing value belongs in a Dynamic Property rather than a Marker. The user is presented with commands in the Dynamic Property to set it to different values, and the Layer automatically tracks that property to know which image to display.
A basic hypothetical usage: you have a two-sided counter, one side is “full health” and the other is "damaged’. You choose to create a Dynamic Property called Health
where a value of 1 represents full health and a value of 2 represents damaged. You create two commands inside your Dynamic Property that get exposed to the user–one sets the value to 1 and is called “Restore to Full Health”. The other command sets the value to 2 and is called “Damage”. Create a Layer trait called Status
(or something similar) and tell it to track the value of the property Health
. Set images for each level so the correct image gets shown when Status = 1
and when Status = 2
.