Adding a number counter to a module

Hello all,

I am currently working on a module of a game with a treasury system. Is it possible to have a self-updating text block that reflects the number of a certain type of piece you have in your player hand? (i.e. If I have 7 gold pieces in my hand, can I build a variable into the game that shows me a numerical representation of the number of gold pieces I have in my hand?) This would make calculations much, much easier.


Yes, you can do that. Basically you will want to watch for a gold piece being moved to a players hand. When it is moved to the players hand you can increment a global property that represents that gold value. Then you can have a piece on your main board that has a text label that displays the value of that global property.

Yep, that’ll work but you may want to set it up so that it resets to zero and then adds them all up whenever you move a piece. If you just have it increment an existing value, then it will do so every time it’s moved. So, if a player is just re-adjusting where it sits in a window, it will increment again.