• Please note: In an effort to ensure that all of our users feel welcome on our forums, we’ve updated our forum rules. You can review the updated rules here: http://forums.wolflair.com/showthread.php?t=5528.

    If a fellow Community member is not following the forum rules, please report the post by clicking the Report button (the red yield sign on the left) located on every post. This will notify the moderators directly. If you have any questions about these new rules, please contact support@wolflair.com.

    - The Lone Wolf Development Team

Author Question - Army Builder for Firestorm Armada

veritechc

Member
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: www.theblackocean.com/resources/Firestorm/Army Builder/Firestormtest.zip
 
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
 
Hello,

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
 
Back
Top