Junior Member
Join Date: Jul 2008
Posts: 10
|
Hello,
I am trying to validate that the roster must have one squadron of small ships and one squadron of large ships. I am using the following script: if (this.tagcount[size.M] >= 1) then @valid = 1 endif in the file validation.def for some reason it does not validate. In the firestorm.def file I have a size group and each small or medium ship has the proper size assigned to it. This same validation works with the Dystopian wars files which I used as a template. I am at my wits end. This and the other validations are all that is holding back this project from completion. Please help! here is the link to the Firestorm Armada Files: http://www.theblackocean.com/resourc...estormtest.zip |
#1 |
Senior Member
Volunteer Data File Author
Join Date: May 2005
Location: Grenoble, France
Posts: 167
|
Hello,
Your rule is at the Roster level but your tag is not a global one. You can try this instead: Quote:
Garfunkel |
|
#2 |
Junior Member
Join Date: Jul 2008
Posts: 10
|
Thank you so much! That worked perfectly!
But why did it work? Is there a list of expressions I am missing? Can you break that expression down for me? if (tally[unit:size.M] >= 1) then @valid = 1 endif |
#3 |
Senior Member
Volunteer Data File Author
Join Date: May 2005
Location: Grenoble, France
Posts: 167
|
Hello,
Quote:
You can find the list of expression on ...\Program Files\Army Builder\doc\Kit\kit_access.htm file. tally[what:tagexpr] (Read-Only) Returns the total number of things that satisfy the given criteria. The things tallied are specified by what, which must be one of: "unit", "item", "model", "instance", or "point". The criteria are set forth by tagexpr, which must be a valid tag expression. All entities within the validation context are processed, with the appropriate value being accrued for every entity that satisfies the tag expression. For example, the reference "this.tally[model:compgroup.core]" will return the total number of models within the validation context that possess the tag "compgroup.core". WARNING! See performance warning below. NOTE! Any explicit target entity is ignored when tallying. All entities appropriate to the validation context, as given by the scope, are tallied. Regards, Frédéric |
|
#4 |
|
|