[messages] [Module Design] Determining Strength Ratio in VASSAL

capi3101 capi3101a at netscape.net
Mon Aug 26 09:05:02 MST 2013


Greetings, all. Sorry if this topic has been covered six ways from
Sunday; I'll admit to being lazy on the "search the forums" front here.
I've recently come across the Calculating Value of Cards and show in
Hand[1] thread here on the VASSAL forums and I have a similar problem
with a mod I'm building (not the Star Smuggler one, if anyone's
wondering). My problem is a bit more complex.

Here's what I've got: the tokens in the mod I'm building have three
values: Strength, Maneuver and Hits. I'm handling Hits through a series
of Prototypes that act (among other things) as a layer that puts a
number of "bullet holes" on the token; when the counter has taken its
maximum number of Hits, it turns into a debris cloud (the unit is
destroyed at that point). Additionally, each unit has another Prototype
that contains a Restricted Access property; only the player controlling
the unit is allowed to manipulate it. Strength and Maneuver are being
handled via Marker properties.

So here's what I want the mod to do:
1) When a token is moved onto the "battle board" for combat, sum up the
Strength of tokens __for that side__, and then do the same for the
Maneuver rating (I figure I can use the techniques mentioned in the
Value of Cards thread for that part).
2) Calculate the ratio of Strength values for the two sides - the game
on which I'm basing my mod utilizes a CRT that's dependent upon that
ratio.
3) Determine the difference between the Maneuver ratings for the two
sides.

Preferably, it'd have an option to give the results based upon which
side is attacking and which side is defending. It'd also be nice if,
when a unit was destroyed or removed from the battle board, the unit's
Strength and Maneuver were both set to zero and the mod recalculated the
values.

Can anybody help me out?

[1] http://www.vassalengine.org/forum/viewtopic.php?f=6&t=6570


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


More information about the messages mailing list