Senior Member
Lone Wolf Staff
Join Date: May 2005
Posts: 13,217
|
Since the game system I'm working on limits rosters to no more items than characters, I'm using a seperate profile to collect the item count and contain the @valid statement to test that you don't have more items than characters.
The items on characters work fine - it's the items that can be chosen on their own that are giving me trouble. The example files included with AB seem to be doing exactly what I'm trying to do, but I noticed that the Wargear profile there doesn't actually collect anything. No matter how many items I select (and the roster even puts one in by default), nothing shows up in the profile (I did notice that the profile is only valid under a certain ruleset). |
#1 |
Senior Member
Lone Wolf Staff
Join Date: May 2005
Posts: 13,217
|
I apologize for the bump, but I think this one was missed the first time around.
|
#2 |
Senior Member
Lone Wolf Staff
Join Date: May 2005
Posts: 8,232
|
At 11:10 PM 3/31/2007, you wrote:
Quote:
If you are tallying up ALL the items in the entire roster, the easiest way to do this is to write a roster scope validation rule that simply accesses the total number of items. I'm assuming you want something a little more complicated than that, though. So the next best technique would be to create a roster stat. You can set the tagexpr to only identify the items that you want to process. Then the Tally script isn't even necessary, because you'll automatically get a count of all the items that satisfy the tagexpr. You can then use the roster stat in a profile and anywhere else you might want to use it (e.g. other validation rules). Within a profile, you'll need to jump through a bunch of hoops. The reason is that profiles only process UNITS. An independently selected item that is not a child of a unit will NOT be processed. So the easiest solution for having a profile to display the information is to just use a roster stat to tally up the number and then use that value within the FinalTest script of the profile via the "statcalc[id]" target reference. Hope this helps, Rob |
|
#3 |
Senior Member
Lone Wolf Staff
Join Date: May 2005
Posts: 13,217
|
Thank you, I got it working. Just a note, you may want to add some of this to the manual, or make it more obvious, and you may want to alter the example files so that their version of this rule actually works.
|
#4 |
|
|