Member
Join Date: Mar 2006
Posts: 39
|
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 |
#1 |
Senior Member
Volunteer Data File Author
Join Date: May 2005
Location: Santa Cruz, CA, US
Posts: 123
|
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 Space Marine Maintainer for AB3 Battlefleet Gothic Maintainer for AB3 40K: Space Wolves, 13th Company, Grey Knights, Deathwatch BFG: Space Marine Fleet, Armageddon Fleet, Tau Fleet |
#2 |
Member
Join Date: Mar 2006
Posts: 39
|
Thanks dude!
|
#3 |
Junior Member
Join Date: Aug 2005
Posts: 19
|
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?
|
#4 |
Senior Member
Volunteer Data File Author
Join Date: Mar 2005
Posts: 345
|
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] |
#5 |
Junior Member
Join Date: Aug 2005
Posts: 19
|
OK Thanks. Will try that once I've had a good nights sleep!
|
#6 |
Junior Member
Join Date: Aug 2005
Posts: 19
|
Thanks for that! Works like a charm!
|
#7 |
Senior Member
Join Date: Jan 2012
Posts: 122
|
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! |
#8 |
Senior Member
Join Date: May 2012
Posts: 206
|
this still applies but bear in mind the warning in the AB kit manual:
Quote:
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 My own Warlord Games gallery and the home of the Warlord Games datafiles: http://www.facebook.com/ABDataFileWarlordGames |
|
#9 |
|
|