Lone Wolf Development Forums  

Go Back   Lone Wolf Development Forums > Army Builder Forums > Army Builder

Notices

Reply
 
Thread Tools Display Modes
veritechc
Junior Member
 
Join Date: Jul 2008
Posts: 10

Old January 26th, 2012, 12:11 PM
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
veritechc is offline   #1 Reply With Quote
Garfunkel
Senior Member
Volunteer Data File Author
 
Join Date: May 2005
Location: Grenoble, France
Posts: 167

Old January 26th, 2012, 11:40 PM
Hello,

Your rule is at the Roster level but your tag is not a global one.
You can try this instead:

Quote:
if (tally[unit:size.M] >= 1) then
@valid = 1
endif
Regards,
Garfunkel
Garfunkel is offline   #2 Reply With Quote
veritechc
Junior Member
 
Join Date: Jul 2008
Posts: 10

Old January 27th, 2012, 08:25 AM
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
veritechc is offline   #3 Reply With Quote
Garfunkel
Senior Member
Volunteer Data File Author
 
Join Date: May 2005
Location: Grenoble, France
Posts: 167

Old January 30th, 2012, 04:50 AM
Hello,

Quote:
Originally Posted by veritechc View Post
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
The main issue was your rule was at ROSTER level, but your tag size.M was local only. AB cannot find non global tags with tagcount instruction at roster level. It can only be performed with a Tally script (Which parse all units/item for the tag expression) On the Dystopian Wars files, do you know in which file it is used? I didn't find it.


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
Garfunkel is offline   #4 Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -8. The time now is 04:21 AM.


Powered by vBulletin® - Copyright ©2000 - 2024, vBulletin Solutions, Inc.
wolflair.com copyright ©1998-2016 Lone Wolf Development, Inc. View our Privacy Policy here.