[messages] [Module Design] Can you count pieces in a zone?

JoelCFC25 jkoepp at yahoo.com
Fri May 23 15:30:41 CEST 2014


The key components as I see them would be: 

1. The map needs a keystroke that will be applied to all pieces ending
movement there (e.g., __MovedOnMap__)
2. Global properties for each zone to hold the piece count
3. Every piece type that will be counted needs 2 Triggers and 1 Set
Global Property _per zone_  (this is guaranteed to work, but there's
probably a more elegant method, more below)

Each Trigger watches for __MovedOnMap__, and when it receives that
keystroke, it fires the keystroke defined in the SGP to increment or
decrement by 1. The property match on the increment Trigger would be
along the lines of this (I'm using an example zone name of Italy just
for a lark): 

__CurrentZone = Italy && OldZone != Italy__

That's just to make sure we don't increase the count for someone futzing
around with pieces _within_ the zone. The property match on the
decrement Trigger would be: 

__CurrentZone != Italy && OldZone = Italy__


There's probably a way to do it all with just 2 Triggers (one for
incrementing when a piece is moved into a zone where it's meant to be
counted, one for the reverse) and a single SGP where you reference a
Zone-level property by inline substituting your zone name (e.g.,
__$CurrentZone$Count__).

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


More information about the messages mailing list