• 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

Total Army Point Cost Question

DarkHost

Active member
First, I am assuming that since the value is displayed, the total army/roster point cost is a roster statistic internally calculated by AB. If so, what is the syntax for accessing the total point cost of an army/roster?

If my assumption is incorrect, then what is the proper way to reference a Stat Calc/Stat Id in a Rule script?

-DH
 
The roster size cam be accessed in the rule scripts with two expressions:

roster.activesize for the currently used points
roster.usersize for the user set number of points
 
If I have a situation where only one third of my force can be units of tag Spec.Third, then how do I work get army builder to keep track of the total points cost of all these units, so I can then compare it to the roster.usersize tag in a validation rule?
 
create a statcalc that totals up the points value of any unit that has the relevant tag, then reference the statcalc within the rule by using:

statcalc[id] where id is the unique id of the statcalc

The statcalc maybe along the lines of:

test expression: spec.Third

tally expression: @value = @value + cost[total]
 
roster.activesize for the currently used points

I appreciate I'm necromancing and ancient thread here, but is this still valid in 3.4c? I'm working on an override that is supposed to change a tag for a unit when the total number of points in the roster exceeds 800...but roster.activesize doesn't appear to work.

In the debug viewer, I cans see roster.size is set to the user size but if a user sets unlimited, that's not that useful for me!
 
this still applies but bear in mind the warning in the AB kit manual:

Returns the current total size of the roster. The total roster size is not tallied until the roster has been fully evaluated, so this target will not contain a useful value within entity and option evaluation scripts. Example: "this.activesize".

roster.activesize is calculated after the rest so that any script in a pre/post links won't trigger on a roster.activesize wouldn't be triggered - you'll have to try and work something else out.

It may be worth trying to have a specific tag for this unit and then put a script in the Global Script section under Roster Done that checks for the tagged unit and then checks roster.activesize and if the criteria meet then the tag is changed - the only problem though is if the change of tag under this criteria is supposed to change other costs/function this may not trigger
 
Back
Top