[messages] [Module Design] Incrementing a global property

mycenae ed at crucible.cc
Tue Nov 30 19:15:39 MST 2010


I'm working on a mod where the players collect cards, each with
different numeric point values. At the end of the game, the points on
the cards are totalled to determine the winner. The module should track
these points automatically so players don't have to, so I've assigned a
dynamic numeric property (called Score) to each card with its point
value, and set up a Global Property corresponding to each player's Score
(RedScore, BlueScore, etc). 

When the player collects the card, it removes the card from the board,
and should then add its Score value to the player's total (Using the Set
Global Property trait, I picked increment the global property by the
value of the card's Score--that is, Increment by $Score$). 

However, when I run the command, an error is returned saying, "Bad Data
in Module: Numeric field contains a non-number Increment
$playerSide$Score: format=$Score$, value=Score" Does this mean that the
incremented value needs to be a hard-coded number? It doesn't seem to be
finding the value for Score even though I know the card has one. (If I
put in a hard-coded number, this works just fine, but each card has a
different Score.) Each card's Score is marked as a Numeric property.

The help file on Global Properties isn't clear on how this works. It
says, "Increment numeric value adds a fixed value to the property, after
substituting values of Properties [defined for this game Piece]." What
does this mean?

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


More information about the messages mailing list