I have a Dynamic Property on a game piece - “shield_count”. It’s numeric.
I have a layer that has a level with a shield graphic (intended to be an overlay).
How do I turn the layer off (or maybe show a level with no image?) when shield_count = 0? What is the exact syntax for the expression?
I’ve tried every conceivable variation of the likely syntax but nothing works. There don’t seem to be any explicit instructions for doing this, and the manual refrers to an old version of VASSAL. This program really is making me feel extremely stupid…
The layer image Level starts from 1 by default but there is an option to offset your expression values by setting the base expression value that is to equate to Level 1.
It sounds like you need to adjust the Layer trait by putting a blank image at level 1 and set Level 1 = 0. To insert a blank image - add a new layer then use the arrows to move that blank layer from the end to the top.
You may have a more general syntax issue with the expression you are using… more information would be helpful if so.
There is also the option to use a Key Command to toggle the Activation state off (you likely have this checked as “Always Active”). If the activation state is off, then the evaluation of the layer level will be ignored, I think (it certainly won’t result in any image being displayed).
@Mark - thank you that’s pretty much what I’ve done. Two levels in my layer, first has no image. Follows expression “shield_count”, level 1 = 0. Layer set to always active.
So now a unit can start with shields, and the shield graphic is present until the shield count gets to 0, when it disappears. I suppose I could get really fancy and draw different layer levels of the graphic to represent shield deterioration / overload… Maybe one day.