Member
Volunteer Data File Author
Join Date: Apr 2005
Location: North Western Arizona
Posts: 97
|
I'm having trouble with the following rule. With only the one unit in
the roster, it is not validating correctly. If I'm following my logic correctly, because the tyTags.AddHW is 2 it should skip the group portion and return a result of 1. Or am I misunderstanding the way the tagcount[] works? Here's my current tag settings: tyTags.Warriors = 1 tyTags.Winged = 3 tyTags.AddHW = 2 Group.HQ = 0 Group.Fast = 0 Here's my rule, set at the unit level: var result as number if (tagis[tyTags.Warriors] + tagis[tyTags.Winged] >= 2) then if (tagcount[tyTags.AddHW] < 2) then if (tagis[Group.HQ] + tagis[Group.Fast] = 0) then result = 0 done else result = 1 endif else result = 1 endif else result = 1 endif @valid = result |
#1 |
Guest
Posts: n/a
|
Is this one unit of Warriors and does it consist of one Warrior? If
thats the case then is the one model got the 3 tags for wings or do they come from other units? What is the script trying to validate as well - is it a restriction on the a number of units in the roster or a number of objects within a unit? --- In armybuilder@yahoogroups.com, "d_verley" <warmonger@p...> wrote: > > I'm having trouble with the following rule. With only the one unit in > the roster, it is not validating correctly. If I'm following my logic > correctly, because the tyTags.AddHW is 2 it should skip the group > portion and return a result of 1. Or am I misunderstanding the way > the tagcount[] works? > > > Here's my current tag settings: > tyTags.Warriors = 1 > tyTags.Winged = 3 > tyTags.AddHW = 2 > Group.HQ = 0 > Group.Fast = 0 > > Here's my rule, set at the unit level: > var result as number > if (tagis[tyTags.Warriors] + tagis[tyTags.Winged] >= 2) then > if (tagcount[tyTags.AddHW] < 2) then > if (tagis[Group.HQ] + tagis[Group.Fast] = 0) then > result = 0 > done > else > result = 1 > endif > else > result = 1 > endif > else > result = 1 > endif > @valid = result |
#2 |
Member
Volunteer Data File Author
Join Date: Apr 2005
Location: North Western Arizona
Posts: 97
|
No, this is a unit, that has 3 models, and then it has two child units at 1 model each. The child units are where the tyTags.AddHW tags are coming from. I just thought that maybe because they are children, they are not showing up in the unit context? How would I include them if that's the case?
---------- Original Message ---------------------------------- From: "harkanironfist" <dom@wendndom.karoo.co.uk> Reply-To: armybuilder@yahoogroups.com Date: Wed, 16 Feb 2005 19:10:23 -0000 > > >Is this one unit of Warriors and does it consist of one Warrior? If >thats the case then is the one model got the 3 tags for wings or do >they come from other units? > > >What is the script trying to validate as well - is it a restriction >on the a number of units in the roster or a number of objects within >a unit? > >--- In armybuilder@yahoogroups.com, "d_verley" <warmonger@p...> wrote: >> >> I'm having trouble with the following rule. With only the one unit >in >> the roster, it is not validating correctly. If I'm following my >logic >> correctly, because the tyTags.AddHW is 2 it should skip the group >> portion and return a result of 1. Or am I misunderstanding the way >> the tagcount[] works? >> >> >> Here's my current tag settings: >> tyTags.Warriors = 1 >> tyTags.Winged = 3 >> tyTags.AddHW = 2 >> Group.HQ = 0 >> Group.Fast = 0 >> >> Here's my rule, set at the unit level: >> var result as number >> if (tagis[tyTags.Warriors] + tagis[tyTags.Winged] >= 2) then >> if (tagcount[tyTags.AddHW] < 2) then >> if (tagis[Group.HQ] + tagis[Group.Fast] = 0) then >> result = 0 >> done >> else >> result = 1 >> endif >> else >> result = 1 >> endif >> else >> result = 1 >> endif >> @valid = result > > > > > >To unsubscribe from this group, email > >armybuilder-unsubscribe@yahoogroups.com >Yahoo! Groups Links > > > > > > > > > __________________________________________________ ______________ |
#3 |
Senior Member
Lone Wolf Staff
Join Date: Dec 2008
Posts: 4,690
|
At 04:46 PM 2/16/2005 +0000, you wrote:
>I'm having trouble with the following rule. With only the one unit in >the roster, it is not validating correctly. If I'm following my logic >correctly, because the tyTags.AddHW is 2 it should skip the group >portion and return a result of 1. Or am I misunderstanding the way >the tagcount[] works? > > >Here's my current tag settings: > tyTags.Warriors = 1 > tyTags.Winged = 3 > tyTags.AddHW = 2 > Group.HQ = 0 > Group.Fast = 0 > >var result as number >if (tagis[tyTags.Warriors] + tagis[tyTags.Winged] >= 2) then This should evaluate to 'true', because 1 + 1 >= 2. > if (tagcount[tyTags.AddHW] < 2) then This should evaluate to 'false', because you only have 2 AddHW tags. > else > result = 1 > endif >endif >@valid = result So you should end up with '@valid = 1'. I assume this isn't the result you're seeing? You say this is with a single unit - does this unit have any children? Is the tyTags group marked as 'accrued'? -- Colen McAlister (colen@wolflair.com) Lone Wolf Development www.wolflair.com |
#4 |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
CD isn't working | BobFromMarketing | Army Builder | 1 | September 28th, 2005 12:44 PM |
Validation rule script | esoiset at sbcglobal.net | Army Builder | 8 | March 7th, 2005 10:24 AM |
Validation script question. | Warmonger | Army Builder | 7 | January 30th, 2005 01:24 PM |
i am working on a new ig | aliensister22152 at yahoo | Army Builder | 0 | August 2nd, 2003 12:59 AM |