SumStack Connumdrum

I am trying to use SumStack, to determine if my unit is stacked with an enemy, where G is the property that defines the enemy when it is equal to 1.

Regardless how I try to employ SumStack, I always get an error such as this:

Bad Data in Module: Expression evaluation error 101-506-Calculated Property[Attacking]={SumStack(G)}, Error=Command not found: SumStack( int )

The Property Attacking has been established as an integer. What else do I need to do to effectively use SumStack?

I’m using Vassal 3.2.8

Anyone?

There are two issues here.

  1. SumStack expects the name of a property, ie. a String. Therefore the correct syntax to Sum the property G in a stack is SumStack(“G”), not SumStack(G). The second version tries to sum the value of the property name stored in the property G in the calling unit.

  2. There is a bug in Vassal that causes the error you see if any unit in the stack (including the issuing unit) does NOT have the property G defined.

The workaround for 2 is to make sure every counter defines a property named G.

I have fixed the bug (Tracker bug 11083) and committed it to Brent-3.2-Work@9038.

Regards,
Brent.

Brent, I also found in a code a method called SumLocation – has it been officially embedded into Vassal and can be used in the modules? If so – how?

It does exist in Vassal, but I would be very hesitant to use it. Because
of the way units are stored in Vassal, it is incredibly inefficient.
Using it will likely bring your module to it’s knees.

On 1/06/2014 6:49 PM, grouchysmurf wrote:

Brent, I also found in a code a method called SumLocation – has it been
officially embedded into Vassal and can be used in the modules? If so –
how?


Read this topic online here:
SumStack Connumdrum - #5 by grouchysmurf


messages mailing list
messages@vassalengine.org
vassalengine.org/mailman/listinfo/messages


No virus found in this message.
Checked by AVG - www.avg.com
Version: 2014.0.4570 / Virus Database: 3955/7601 - Release Date: 05/31/14


Brent Easton
Analyst/Programmer
University of Western Sydney
Email: b.easton@exemail.com.au

Thus spake Brent Easton:

There are two issues here.

  1. SumStack expects the name of a property, ie. a String. Therefore the
    correct syntax to Sum the property G in a stack is SumStack(“G”), not
    SumStack(G). The second version tries to sum the value of the property
    name stored in the property G in the calling unit.

  2. There is a bug in Vassal that causes the error you see if any unit in
    the stack (including the issuing unit) does NOT have the property G
    defined.

The workaround for 2 is to make sure every counter defines a property
named G.

I have fixed the bug (Tracker bug 11083) and committed it to
Brent-3.2-Work@9038.

Merged to trun@9040. Please try 3.2.12-svn , available here:

vassalengine.sourceforge.net/builds/


J.