Changing a counter's text values after it's created

Is there a way to change, say, the value in a counter’s text box after it is created and on the mapboard? For example, if the counter has a layer with a number of levels, can the level name be put into a text box so that if the level changes, the value in the text box changes?

I see how to do it with images, but the design I am working on has units that can lose strength points (rather than just having a reduced-value side) and want to be able to have the current strength visible on the counter as a text value.

Store the value as a Dynamic Value (say named Strength) and display it on your counter using a Text Label with text value of $Strength$.

B.


Messages mailing list
Messages@forums.vassalengine.org
forums.vassalengine.org/mailman/ … engine.org

Post generated using Mail2Forum (mail2forum.com)

Set your value range in a dynamic property.
Have the text label follow the dynamic property by putting
$whateveryourdynamicpropertynameis$ as the text label value.

As a bonus you can then make the graphical layer levels also follow this
dynamic property

Post generated using Mail2Forum (mail2forum.com)

Thanks for the help. Dynamic properties didn’t quite do what I wanted it to do (there didn’t appear to be an easy way to increase/decrease the values one step at a time with keystrokes), but I created a layer called “Strength” with no images but just label names, then defined a text box within the individual game pieces themselves and set the text to $Strength_Name$.

I did notice what I assume is a bug; when I put the layer and the text box into a prototype and then add the prototype to a counter, the counter says “Strength_Name” where the value should be in the design window; when playing the module, when the Pieces button is pressed, the counter appears with “Strength_Name” in the text area, but when it is dragged onto the map, the value changes to the correct value (the layer name for the first layer).
(I assume it is a bug because if I add the layer and text box directly onto the unit rather than through a prototype, it shows the layer name for the first layer. Is this some strange property with prototypes that is causing this, and if so, is there an easy way around it?)

*********** REPLY SEPARATOR ***********

On 8/01/2009 at 10:10 PM That Don Guy wrote:

This is very easy to do. See the ‘New’ button at the bottom of the Dynamic Property? Click on it to add KeyStroke commands to change the value of the property.

Go back to the Dynamic Properties.

What version of Vassal are you using? This should be fixed in the later 3.1 betas.

B.


Messages mailing list
Messages@forums.vassalengine.org
forums.vassalengine.org/mailman/ … engine.org

Post generated using Mail2Forum (mail2forum.com)

What I have is a series of text values. What I want to be able to do is to use one key to switch to the next-highest value (if it isn’t already at the highest value), and another to switch to the next-lowest value (if it isn’t already at the lowest value). The only four keystroke options I can see are (a) enter a value, (b) increment a numeric value, (c) set the value to a pre-specified value, and (d) select from a list.

I am using 3.0.17. I couldn’t find a way to download the 3.1 betas from the main site; where can I find one (or do I have to use VASSAL online, which I usually don’t do)?

While I am asking…is there a list somewhere of just what values I can put between dollar signs and expect substitution to happen?

– Don

Thus spake “That Don Guy”:

sourceforge.net/project/showfile … _id=260612


J.


Messages mailing list
Messages@forums.vassalengine.org
forums.vassalengine.org/mailman/ … engine.org

Post generated using Mail2Forum (mail2forum.com)

You need two keys

Set one of the values to -1 with a key command CTRL 1 and the other to 1
with a key command SHIFT 1
When you defined the numeric dynamic property you should have given it a
range for example 0 min and 10 max

Now when you execute either CTRL 1 or SHIFT 1 the value will increase or
decrease by 1 but it will never go below your defined minimum or maximum
value of the numeric dynamic property (i.e 0 or 10)

Post generated using Mail2Forum (mail2forum.com)

Better yet, here is a demo mod inside the zip doing exactly what you want to do.
Select the piece you see with the “5” on it
Left arrow key decreases the number by 1
Right arrow key increases it by 1
It will stop at 0 or 10

Edit the module to see how it was done it consists of 1 single piece in an at start stack - everything is there

Thanks for the help (and the SourceForge pointer, although is it usually that slow - 7 KB/sec isn’t much faster than dialup).

Next question: is there a way to set a value in a Game Piece Image that can be set in, say, a Protoype Definition or a Single Piece?

– Don

Thus spake “That Don Guy”:

There are a lot of mirrors. Possibly you got one which wasn’t optimal for
your location.


J.


Messages mailing list
Messages@forums.vassalengine.org
forums.vassalengine.org/mailman/ … engine.org

Post generated using Mail2Forum (mail2forum.com)