How to calculate production at turn start

Hello, have another problem with my game.

At the start of player turn, each player has a production of three types: money, oil and energy.
a player have piece on his board with different value (Example: One piece will produce 1 gallon oil, another one will produce 10 million in money…ecc ecc).
On his board there are 3 At-Start Stack, one with Text Label that show the value of the global property TmoneyP1 (total money for Player 1), one for total oil and one for total energy.

Is possible to have a “Turn Start” button that calculate the production for each type and add that to the player totals?

Thanks!!!

Short answer: yes!

Long answer:
So your “Turn Start” button will be a piece you will place on the board with an At-Start stack. Give it does-not-stack and make it not be able to move. It will need to send out a Global Key Command – you can call it what you like but maybe the the GCK’s own keystroke is Ctrl+P and its menu command is “Calculate Turn Production” and the global keystroke it sends out to everything is “DoTurnProduction”. To make it faster you can optionally put a filter expression that will limit the number of pieces it sends to, e.g. MakesOil==“Y” || MakesMoney==“Y” assuming your pieces that are used in production have Marker traits with “Y” assigned as their values.

Also you can add an “Action Button” property to your piece so that merely left-clicking on the piece can fire the Global Key Command, so the action button sends “Ctrl+P” to its own piece, causing the piece to fire off the DoTurnProduction keystroke. So now you can “just click the button” instead of having to right-click the piece and select the option off the menu.

Now each of your pieces (the ones that make Oil and Money etc) should be set up to respond to the DoTurnProduction keystroke. A simple way to do this is with a “Set Global Property” trait, with the Menu Command removed and the Key Command set to DoTurnProduction and then that line does a “Increment value” by the right amount or some similar calculation. These would also be the pieces you’d add Marker traits too e.g. MakesOil set to “Y” if you want to use filtering on the GCK.

I’d recommend starting small – get your button to work right sending a GCK successfully that gets a single piece to respond correctly, then generalize that to “all of the oil” and then generalize that to “all of the pieces”, etc.

Hope this helps

Brian

Again, thank you!!!
A Marker and a Zone where players place that tokens (…and an ActionButton) solved the problem :slight_smile:

Now have a problem with Restricted Command…I will try to find a solution in the forum, otherwise I will open a thread ;)

By any chance do you have a module where this trait is set out? I’m trying to do the same basic thing and running into problems with message “Unable to locate Global Property named DoTurnProduction.” Was it necessary to set the piece in a defined zone on the map? I am only a few weeks into learning VASSAL so the problem might be far more basic, so I’d love to see a good working example.

Thanks for your help.