[messages] [General Discussion] How to add two values

flashsolutions larryfortna at gmail.com
Sun Dec 4 15:09:29 CET 2016


I am building a typical 52 deck card game in which I need to assign
numeric values to each of the cards.  9 of these cards will end up being
shown on a map game board.  

At the completion of the game, I need to be able to add the point values
for a total score.  I also need to be able to check the positions of
each card to determine their order and alter the values of the cards if
the order matches the criteria I am looking for.

I have defined a Deck to hold the 52 cards and included a Marker named
"PointValue" with a unique value for each card. 

For testing purposes, I added a Report Action button to display the
value of the card and attempted to add an arbitrary value to it at
runtime, but it does not produce the desired results.

The button action is $location$: $newPieceName$: {$PointValue$+30} and
simply displays "* Hole 1: 10_Hearts: {10+30}" when executed.  The
$PointValue$ is displayed as the correct value, but I wanted to see the
value of 30 added to it for a result of 40.

What do I need to do to get the addition to work and what would be the
syntax to check the value of card to determine the value I wish to add
together with the cards point value?   Ultimately, I wish to have a
button that can be activated from the main menu to go thru the 9 card
values to determine their positions and score accordingly.

Is there a better way to accomplish what I am trying to do?

_______________________________________________
Read this topic online here:
http://www.vassalengine.org/forum/viewtopic.php?p=52654#p52654


More information about the messages mailing list