• Please note: In an effort to ensure that all of our users feel welcome on our forums, we’ve updated our forum rules. You can review the updated rules here: http://forums.wolflair.com/showthread.php?t=5528.

    If a fellow Community member is not following the forum rules, please report the post by clicking the Report button (the red yield sign on the left) located on every post. This will notify the moderators directly. If you have any questions about these new rules, please contact support@wolflair.com.

    - The Lone Wolf Development Team

Validation script not working.

Warmonger

Well-known member
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
 
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
 
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
>
>
>
>
>
>
>
>
>





________________________________________________________________
 
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
 
Back
Top