Math with traits - How do I do it???

I have a layer trait called ROUND that has 6 levels. I would like to be able to report a value of 11 minus $ROUND_Level$, but I’m not sure how to do it.

Example: If the current $ROUND_Level$ is 4, I’d like to be able to report “this unit must exit the map at the end of Round # 7.”

Please help.

Rich,

There is no easy way to do this in the current version of VASSAL. The next version (3.2) will have features that make using maths much simpler.

The way I would approach it is to maintain the current round number in a Global or Dynamic Property (GP/DP) and have the layer trait ‘follow’ the value of the Property. Lets call this property ROUND

This means the layer trait is just displaying the value of the ROUND, not generating it. All manipulation of the round number is now done by manipulating the value of the ROUND GP/DP. I find this much easier to handle when building the module.

The simplest way of maintaining the ROUND+3 value is then to just maintain a second GP/DP (say called ROUND3) that contains this value. ROUND3 would be initialised to 4 instead of 1 and whatever actions you take to change the ROUND DP/GP, you also do to the ROUND3 DP/GP to keep it in step.

Regards,
Brent.

*********** REPLY SEPARATOR ***********

On 10/02/2010 at 5:30 PM Richz99 wrote:


Messages mailing list
Messages@forums.vassalengine.org
forums.vassalengine.org/mailman/ … engine.org

Post generated using Mail2Forum (mail2forum.com)