[messages] [Module Design] Best way to implement counters, please ?
b.easton at exemail.com.au
Fri Jan 19 00:18:28 CET 2018
Don't feel like you have to copy every component of the game and
implement it in exactly the same way. Feel free to Vassal-ize the game.
Things like money/value chits and tracks to track totals are great in a
physical game but are a pain both to implement and to use when playing a
game with Vassal.
For things that change in a numeric range, like your -5 to +40 income
levels, Create a Global Property that will contain the income level.
Then create a special counter that displays the value of the Global
Property using a Text Label. If the Name of the Global Property is
P1_Income_level then the text of the label should be $P1_Income_level$.
Make the text of the label nice and big and centre it in the middle of
the counter. Now you have a way of showing the current income level.
Just place this special counter in an At-start stack anywhere
convenient. If it is secret to one player, put it in a Private Window.
To change the income level, you just manipulate the P1_Income_Level
global property using a Set Global Property component (to have it on the
menu bar) or counter trait (to have the controls on a counter, for
instance the special counter that is showing the value).
Having the Income Level stored in a Global Property also makes it easy
for other game components to reference the current income level if
Hope this helps.
Read this topic online here:
More information about the messages