[messages] [Module Design] Re: Ownership Model

JoelCFC25 jkoepp at yahoo.com
Mon Nov 7 10:13:28 MST 2011


> I've just spent an entire evening trying to implement one of the most
> unbelievably simple things: how many cards are in each player's hand?
> I totally get the concept of clearing a global to zero and then having
> each card that meets certain criteria increment that global. But that
> is just the tip of the iceberg ...
> 
> First, I have seven different player hands and at least four other
> maps/boards. So, in theory, every time a card moves — anywhere — I
> have to have each of those hands clear its global and count all of its
> cards, since I don't really know which hand the card has come from
> and/or gone to. Over one hundred cards each have to wake up and try to
> increment some global based on where they think they live at the
> moment.


One technique I lifted from another module recently was to give every
card in my game a Marker trait with a value--e.g., CardCount=1. My Game
Piece Inventory Window shows only things on the 6 player hand "maps",
then displays the folder label as follows: $CurrentMap$ =
$sum_CardCount$

In my case I'm actually tracking the number of two types of cards, so
it's slightly more involved, but that's the basic idea. If there is any
chance whatsoever that something other than a card will ever end up in
the player's hand, it needs to get the same Marker with a value of 0,
I've discovered--quite bizarrely, the technique I described will add 1
to $sum_CardCount$ even if a piece without that Marker is present. So in
my case, where I'm tracking basic event cards *and* home cards, they all
have to get a Marker for both types: event cards get CardCount=1 and
HomeCardCount=0, and home cards get the reverse.

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


More information about the messages mailing list