Lone Wolf Development Forums  

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


Thread Tools Display Modes
Senior Member
Lone Wolf Staff
Join Date: May 2005
Posts: 8,232

Old April 17th, 2006, 07:35 PM
There are a couple of ways you could implement this, and I'm not sure either one is clearly "better" than the other. So I'll outline them both and you can pick the one you like the most. :-)

Both methods assume that the squads are able to identify the number of units possessing the tag. The easiest way to do that is to designate the tag group as "accrued". That way, the squad can easily verify the number of tags assigned to units within it. Once the squad can determine the number of tags, there are two different places to perform the tallying.

The first approach is to use the SquadDone script. Within the script, you access the accrued tags for the squad. You can delete all instances of the tag except for the first one. The net result is that a single tag will exist for the squad (if any), so only that one tag will be accrued for the overall roster. You can then reference the total number of the tag within the roster and it will be assured to be the number of squads containing units that had the tag.

The second approach is to use a RosterStat. Within the stat, you would specify a scope of "squad". This will then iterate through every squad in the roster. Within the Tally script, you would check for the presence of the tag and increment the value by one if the tag is present. The net result is that the total number of squads containing the tag will be the value of the stat.

Both of these methods is easy to implement, and neither is going to perform discernibly "faster" than the other. So pick the one you like the most and use it. :-)

Hope this helps,

At 02:08 PM 4/17/2006, you wrote:

I'm looking for a way to count how many squad have units with a particular tag (rtTags.Escort).

What is the best way to accomplish this?
rob is offline   #1 Reply With Quote

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 05:15 AM.

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