Lone Wolf Development Forums

Lone Wolf Development Forums (http://forums.wolflair.com/index.php)
-   Army Builder (http://forums.wolflair.com/forumdisplay.php?f=16)
-   -   Total Army Point Cost Question (http://forums.wolflair.com/showthread.php?t=6126)

DarkHost March 17th, 2006 04:38 PM

Total Army Point Cost Question
 
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

HakujinGrande March 17th, 2006 05:36 PM

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

DarkHost March 17th, 2006 05:54 PM

Thanks dude!

InquisitorValdez March 21st, 2006 10:44 PM

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?

harkan March 22nd, 2006 01:16 AM

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]

InquisitorValdez March 22nd, 2006 11:29 AM

OK Thanks. Will try that once I've had a good nights sleep!

InquisitorValdez March 23rd, 2006 08:13 AM

Thanks for that! Works like a charm!

Destrin April 16th, 2014 06:36 AM

Quote:

Originally Posted by HakujinGrande (Post 19924)
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!

Harkan_again April 16th, 2014 11:31 AM

this still applies but bear in mind the warning in the AB kit manual:

Quote:

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


All times are GMT -8. The time now is 01:17 AM.

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