Help to set global properties


I just started to learn how to create a new module in Vassal, so probably this is a stupid question. I’m working in a board game where some pieces, while they are still on the board, give a certain ammount of points of a global property called “orders”. So my objective is a key command that, once activated by the player at the beginning of the turn, sums the points of all pieces on the borad that have “order” points.

First of all, i created the global property in the main tree of the module and activated the numeric option with values between 0 and 100. After that I created the trait “set global property” in those pieces, indicating the location in the current module and setting a key command to increment the numeric value of that property in X points.

It doesn’t work, and no message appears in the main window. I am not sure if i’m doing the correct steps or if there is something wrong in the way I filled the text commands.

Any help and ideas will be really appreciated.


You’re on the right track.

Each piece would have a Set Global Property trait to increment the value of “Order” by the amount you want it to increase. The key command to do this should be the same on all pieces. For this example, let’s say CTRL 1

All the pieces should also have a Marker trait. Let’s say OrderPiece = true

Now set up an At-Start Stack somewhere and make it a button with the Action Button trait. Have it fire a CTRL A

Also on this button, have a Trigger Action trait that triggers on a CTRL A and fires off a CTRL B and CTRL C

Give it a Set Global Property trait to set “Order” to 0 (zero) so you get a clean count. Have this trigger on a CTRL B

Then use a Global Key Command trait that triggers on a CTRL C and fires a CTRL 1 at all pieces that match property filter

CurrentMap = (map the pieces are on) && OrderPiece = true

All of the pieces that have the OrderPiece = true marker will receive the CTRL 1 that updates the “Order” count.

Thanks very much for your help. I’ll work on that.

By the way, is any document available to read more about the module design?. The tutorials and help of Vassal are useful, but sometimes options are not explained in deep, or at least not enough for a noob like me. :smiley: