Text Labels not displaying whilst Piece is in Piece Tray

Heres the issue, hoping there is someway around this.

I have a Game Piece Layout that I have designed which is very generic, essentially a background png image and a Nato Symbol over it. Thats It. I want to get away from Adobeing a billion counter images of which many have multiple steps to them as well.

Under Game Piece Palette ive created the piece and set up all the Markers for the piece as well as also placed TextLabels on the actual piece (the labels will be moved to Prototypes when I get it all working). These labels show things such as the Attack/Defence/Movement in a single label, another shows AA value, another shows units size (yes I know the Nato Symbol sort of does that but I have some other trickery required based on which step you are on).

Some of these TextLabels source from Calculated Properties which in turn depend on Dynamic Property’s and Marker’s to calculate the required strings or values.

What I have found however is that the TextLabels which do source from Calculated Properties for there Text value, do NOT show any text when the counter is still sitting in “Pieces” (i.e. in the Piece tray thingy). When the Counter is dragged onto a map it works fine and all these TextLabels appear fine.

Is there some way around this where I can get the TextLabels to source and display whilst the Piece is just in the tray? Or is this something to do with sourcing from Calculated Properties and they do NOT fire and calculate at this point (i.e. before the piece goes onto a map) or something?

HELP!! Im so close to getting all this working but cant really have counters with no meaningful strength values or whatever when in the tray.

Any help welcomed. Cheers

Sounds like it is to do with Calculated Properties, as indeed these are not evaluated in a palette.

You might try putting the calculation directly into the label text, enclosed in {} … though beanshell is not officially supported here, it does work (though from my experience, syntax errors seem to prone to generate infinite loop warnings; just fix the beanshell if this happens to you).

Calculated properties are not evaluated when a piece is in a piece palette for technical reasons. These pieces are not on a map and can generate large numbers of ‘Bad Module Data’ errors when they fail to evaluate.

Also, it is a very bad idea to display the value of a Calculated Property in a text label as each CP for each label on each piece will be re-evaluated each time the piece is redrawn, which can happen multiple times per second in active parts of the window. You will find that Vassal performance will degrade (laggy drags and redraws) as you increase the number of counters on the board at a time.

It is much better to base Text Labels on Dynamic Properties and use Calculated Properties to set the value of the Dynamic Properties.

3 Likes

Thanks Brent.
Ive sort of come to the conclusion that trying to implement layering programatically is pretty much impossible. On top of this, trying to get the graphical richness I need from text labels with HTML (i.e. front and background colouring of individual numbers in the Attack/Defence/Movement string, specific Google fonts that Vassal doesnt seem to load in the HTML snippet, etc) winds up with a cumbersome HTML snippet that has to be entered into a very small text edit box, and now I cant generated this via Calculated Properties due to performance (yes there are like 800+ counters on the map at once). I was also using Calculated Properties to determine which step was supposed to be showing.

So suspect I am back to continuing to draw them all graphically, chopping them up with a batch script and some image tools and the doing load multiple pieces, setting all the layers or unzipping and rezipping if I am updating existing ones.

Have you ever thought that for the vast number of wargames at least, the piece image stays the same pretty much across all the steps, and on the layers (i.e. steps) its just he combat values that change? If there was some way to have just one image and let the combat values be loaded from say a list of values depending on the current step that was displayed it would be really good! And display the first step when its in the pieces tray!

Yes, but the vast majority of modules have been built from scanned or original artwork. In my experience there are often subtle differences between the front and back of the counter, so separate images in a Layer trait are the easiest to handle. Not so easy if you a creating artwork from scratch.

Vassal does have the ‘Game Piece Images’ facility that allows you to build your counters inside Vassal and provides for building stand counter layouts and adding arbitrary text to specific counters. It’s good for prototyping but may not be artistically sufficient for your needs.

Another option is to implement the Attack/Defence/Movement values as Dynamic properties and add a Layer trait for each with multiple value images and a transparent background that follows the value of the DP’s. Then you just adjust the DP values and the displayed values will automatically changes.

Thanks for the suggestion brent. I now get the multi image thingy.
One Layer for each of the moving parts with upteen images in that layer for all the possible values (i.e. Attack values 14 down to say 1 etc). And this overcomes the HTML fandango. I also think as it would rely on DPs then it may work whilst still in the Piece Tray? Not sure.

Only problem thing I saw with DPs is that you cant set the Initial Value to like $InitialAttackValue$ where InitialAttackValue is a Marker. It seems to just take the actual value and save that as when I reopen the DP dialog it has like 6 as the Initial value and the $InitialAttackValue$ has been replaced with 6. Wierd.

Correct.

To set an initial value in a DP that is different in each piece you define, then you need to create the DP in each individual piece and just set the value there not define it in a prototype.It’s a technical limitation of protoypes. You then don’t need the InitialAttackValue marker.

Thanks Brent. will try it out. Ive allready got about 300 counters graphic’ed up but theres still heaps more to do and long term want a more manageable way of generating. Will tinker and send an update at some point.

cheers

In the long run (V4), you’ll be able to set text elements in an SVG template, but that’s not a solution you have available in V3.