Lone Wolf Development Forums  

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

Notices

Reply
 
Thread Tools Display Modes
ChainsawXIV
Member
 
Join Date: Oct 2005
Posts: 39

Old April 26th, 2006, 06:54 PM
I need to count the number of points in a roster from units carrying a specific tag in order to run a validation script, and cant figure out how to make it run. The sample script follows, but I suspect that my problem is that I'm misunderstanding exactly what sort of data is returned by the tagvalue[ ] function. The documentation isn't really clear on what the 'value' is that is returned, and weather matching multiple instances of a tag in this way accumulates the values, or just returns the value for one instance of the tag. If anyone can fill me in on the details, and/or help me back onto the right track, that'd be great. Here's the script:

Code:
var quarter as number
quarter = this.roster.activesize / 4

if (tagcount[CharStuff.Ikit] > 0) then
  if (tagvalue[SkavStuff.ClanSkryre] >= quarter) then
    @valid = 1
  else
    @valid = 0
  endif
else
  @valid = 1
endif
ChainsawXIV is offline   #1 Reply With Quote
harkan
Senior Member
Volunteer Data File Author
 
Join Date: Mar 2005
Posts: 345

Old April 26th, 2006, 11:34 PM
try using a statcalc to add up the points in the roster and then use the results of that in the rule. Something similar to:

(statcalc)

id - (suggested) clanSkyrePnt
scope - unit
test expression - SkavStuff.ClanSkryre (am assuming that units with this tag are what you want to count)
tally expression - @value = @value + cost[total]

(rule)

var quarter as number
quarter = this.roster.activesize / 4

if (tagcount[CharStuff.Ikit] < 1) then

@valid = 1
done
endif

if (statcalc[clanSkyrePnt] >= quarter) then

@valid = 1
endif
harkan is offline   #2 Reply With Quote
ChainsawXIV
Member
 
Join Date: Oct 2005
Posts: 39

Old April 27th, 2006, 03:55 PM
Thanks for the assist, I'd never used the statcalc feature before. That worked like a charm.
ChainsawXIV is offline   #3 Reply With Quote
Reply

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 11:43 AM.


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