I think I found a bug in 3.2.5

I have a module I have been using.

It uses a “Set Global Property” that Sets the variable value directly to “($DrawDeck_numPieces$)” (no quotes) and displays this variable for all to see in their private windows.

Now with 3.2.5, it can no longer read _numPieces. I uninstalled 3.2.5, went back to 3.2.2 (the last version I had) and it worked.

Thought you might want to know this.

Could you please try the latest development release (VASSAL-3.2.6-svn8721) available from vassalengine.sourceforge.net/builds/ and see if this resolves the problem. This has bug fixes in a closely related area that will hopefully fix your problem also.
Thanks,
Brent.

OK, will try. Sorry I didn’t see it before, but I cross-posted this to " Technical Support & Bugs" once I realized there was a better forum for the topic, and I provided my system data and the steps used to create the problem.

It worked.

The reason is that {$variable$} is actually incorrect, it should be {variable}, but the earlier versions of Vassal 3.2 supported it, purely by accident. Bug fixes in 3.2.5 removed the support. We have added support for it back in to 3.2.6.

Question…

I thought numPieces wasn’t a variable, but rather, some sort of property. Here is my logic.

When you said the $ was incorrect, I use the numPieces in a text box elsewhere, and in that textbox, I tried typing without the dollar signs:
Cards left = {RomeDraw_numPieces}

And it literally posts that message.

But if I wrap RomeDraw_numPieces in $ signs, then it works and says something like:
Cards left = 15

Therefore, I concluded that numPieces was a type of property (sorry, I don’t know Java, so I don’t know the proper lingo), and that it’s not like the variables that I set up in the Global Properties section.

Therefore, when I was in the Set Global Property section, and I went to type in the value for the “New Value” field, I clicked the black box on the right (that looks like a calculator), and it gave me the Expression Builder pop-up box. There, I copied what I had in the earlier text box, which was $DrawDeck_numPieces$, and when I clicked “OK”, it put the brackets around it.

Not saying I’m right, because I’m not, and I obviously don’t know Java. I’m just saying it’s probably a good idea to put that support in 3.2.6 because it can be mighty confusing.

I guess my question is: is _numPieces really a variable just like the ones created in Global Properties and is treated the same in all usage?

Yes, RomeDraw_numPieces is a global property that is created by the Deck named RomeDraw and can be used just like any other Global property, except that it’s value cannot be set.

Again, this usage is completely incorrect and it is amazing that it produced anything sensible at all before. Again, it was just by chance. The correct expression is {"Cards left = "+RomeDraw_numPieces}

Prior to Version 3.2, support for the display and reference of properties was quite ad hoc. The notation $variable$ was added to Report Action and Auto-move formats to allow pre-defined values like $playerSide$, $locationName$ etc. This was later expanded to allow reference to any Global property. Each field that allowed $variable$ to be used had to be specifically programmed to accept it, and it was not obvious which fields allowed it and which did not.

In 3.2 we added the concept of a Calculated Expression. Expressions look like this

{}

i.e. completely surrounded by a single pair {}. Fields that allow an Expression to be entered are clearly identified by the small calculator Icon after them.