displaying a property value on a piece?

This seems REALLY obvious, but I can’t get it to work.

I’ve got Piece A that has a text label, with property name: BelgiumBRPCurrent

I want Piece B, located elsewhere in the module, to be non-editable and always display the current value of that other text label.

I can’t figure out what trait I need to use to SHOW a property. It seems they’re all used to RECORD properties… :question:

Again, sorry if this is brutally obvious. :frowning:

A property defined within a Piece is only visible to that piece.

A piece can only see properties defined within itself, or global properties defined in its current Zone, or Map, or the module itself.

Therefore, You need to create the BelgiumBRPCurrent property as a Global Property, either at the Map level, or at the Module level and then any counter can display the value of the text property via a Text Label displaying $BelgiumBRPCurrent$.

To change the value of BelgiumBRPCurrent using a counter, you then use the ‘Set Global Property’ trait. Or, you can define toolbar buttons and menus to do it by hanging change commands off the Global property.

B.

On 8/07/2009 at 8:56 PM Shad wrote:


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

Post generated using Mail2Forum (mail2forum.com)

Brent, that worked beautifully.

In doing so, I may have uncovered a bug, however.

In the attached image BRP Base: is an editable text label.
Current BRPs: is the new text label reporting the global property with a set global property trait.

It seems the “center” ability of the text label is no longer working.

The blank to the right is the test counter to show the global property value and can be ignored.

I’ll put together a mini module and post it shortly.

Ok, don’t unzip this as it’s just been renamed .zip to satisfy the forum upload rules.

The counter on the upper left is a global property.
The counter on the lower right just shows a regular text label.

Both should center text, but if you enter a sufficiently long string you will see that the GP text label does not.

I think this is a bug.