• 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

Testing multiples of a type within a single unit

  • Thread starter Thread starter mach_5 at rocketmail.com
  • Start date Start date
M

mach_5 at rocketmail.com

Guest
I'm trying to test for multiples of a specific type within a unit, ie. I'd
like to generate a validation error if the type has been assigned more
than once. There is a 'typecount' form for the cost attribute, so I know
it should be possible to count types within a unit, but I don't see any
attributes that would allow me to generate an error based on that.

Any ideas?

Thanks,
Mark

=====
Warhammer Club - Vancouver, BC
http://www.WCP-Vancouver.com

__________________________________
Do you Yahoo!?
The New Yahoo! Search - Faster. Easier. Bingo.
http://search.yahoo.com

------------------------ Yahoo! Groups Sponsor ---------------------~-->
Get A Free Psychic Reading!
Your Online Answer To Life's Important Questions.
http://us.click.yahoo.com/cjB9SD/od7FAA/uetFAA/IMSolB/TM
---------------------------------------------------------------------~->

To unsubscribe from this group, email

armybuilder-unsubscribe@yahoogroups.com

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
 
At 09:25 AM 5/1/2003 -0700, you wrote:
>I'm trying to test for multiples of a specific type within a unit, ie. I'd
>like to generate a validation error if the type has been assigned more
>than once. There is a 'typecount' form for the cost attribute, so I know
>it should be possible to count types within a unit, but I don't see any
>attributes that would allow me to generate an error based on that.
>
>Any ideas?

what is your rule trying to do? Different rules have different parameters,
so depending on what you're trying to achieve, this may or may not be possible.

I can't think of anything that allows you to say "if there are 2 types of
type 'X' assigned, display an error"... where and how are the types
assigned? If they're only going to come from 2 different sources, have the
first source assign type1 and the second source assign type2. Then you can
make sure no unit has both type1 and type2 at the same time.

Let me know,


--
Colen McAlister (colen@wolflair.com)
Lone Wolf Development www.wolflair.com


------------------------ Yahoo! Groups Sponsor ---------------------~-->
Get A Free Psychic Reading!
Your Online Answer To Life's Important Questions.
http://us.click.yahoo.com/cjB9SD/od7FAA/uetFAA/IMSolB/TM
---------------------------------------------------------------------~->

To unsubscribe from this group, email

armybuilder-unsubscribe@yahoogroups.com

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
 
Unfortunately, it's both from the same source. I've got a unit that can
take up to three options (out of lets say 12). The unit can have any 3 it
wants, but they can't be the same.

Now, to make things easy (or at least less cluttered), I've put the ten
options into tables, so the user simply has to click each table over to
the option he wants and he's done. The problem with this of course is
that it allows the user to select an option three times (once for each
table).

I didn't think there was a way of limiting the number of times an option
is taken within a unit so I'm trying to figure out a way to do it with
types.

Thanks,
Mark

> what is your rule trying to do? Different rules have different
> parameters,
> so depending on what you're trying to achieve, this may or may not be
> possible.
>
> I can't think of anything that allows you to say "if there are 2 types
> of
> type 'X' assigned, display an error"... where and how are the types
> assigned? If they're only going to come from 2 different sources, have
> the
> first source assign type1 and the second source assign type2. Then you
> can
> make sure no unit has both type1 and type2 at the same time.



=====
Warhammer Club - Vancouver, BC
http://www.WCP-Vancouver.com

__________________________________
Do you Yahoo!?
The New Yahoo! Search - Faster. Easier. Bingo.
http://search.yahoo.com

------------------------ Yahoo! Groups Sponsor ---------------------~-->
Make Money Online Auctions! Make $500.00 or We Will Give You Thirty Dollars for Trying!
http://us.click.yahoo.com/KXUxcA/fNtFAA/uetFAA/IMSolB/TM
---------------------------------------------------------------------~->

To unsubscribe from this group, email

armybuilder-unsubscribe@yahoogroups.com

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
 
At 04:40 PM 5/1/2003 -0700, you wrote:
>Unfortunately, it's both from the same source. I've got a unit that can
>take up to three options (out of lets say 12). The unit can have any 3 it
>wants, but they can't be the same.
>
>Now, to make things easy (or at least less cluttered), I've put the ten
>options into tables, so the user simply has to click each table over to
>the option he wants and he's done. The problem with this of course is
>that it allows the user to select an option three times (once for each
>table).
>
>I didn't think there was a way of limiting the number of times an option
>is taken within a unit so I'm trying to figure out a way to do it with
>types.

After a long discussion involving complex mathematics here at Lone Wolf HQ,
we have discerned a solution to your problem. It involves using three
hidden stats.

Let's say you have 10 possible options in your three tables - opt1, opt2,
opt3, opt4, opt5, etc etc etc. opt1 should set stat1 to the value '1' (note
that it sets the stat value, not adds to it). opt2 should set stat1 to the
value 2. Opt3 should set stat1 to the value 3. And so on, until opt10 sets
stat1 to the value 10.

You'll also need 5 option categories. Table1 should be category 1; Table2
should be category 3; Table3 should be category 5. (Categories 1 through 5
should be placed such that options from category 1 should be evaluated
before options from all other categories, category 2 should be evaluated
next, etc.)

Now make two other options. Option Calc1 should be priority 2, so it is
evaluated after Table1, but before Table2. Calc1 should set the value of
Stat2 to Stat1. Similarly, option Calc2 should be priority 4, so it is
evaluated after Table2, but before Table3. Calc2 should set the value of
Stat3 to Stat1.

In case it isn't entirely clear what this will do, let's go through the
sequence of what happens.

At the start, stat1, stat2 and stat3 are all 0. Table 1 has option 1
selected, table 2 option 7 and table 3 option 1.

Table1 is evaluated first. Option1 sets stat1 to 1.
stat1 = 1
stat2 = 0
stat3 = 0

Now Calc1 sets stat2 to stat1.
stat1 = 1
stat2 = 1
stat3 = 0

Now table2 is evaluated. Option7 sets stat1 to 7.
stat1 = 7
stat2 = 1
stat3 = 0

Now calc2 sets stat3 to stat1.
stat1 = 7
stat2 = 1
stat3 = 7

Finally table3 is evaluated. Option1 sets stat1 to 1.
stat1 = 1
stat2 = 1
stat3 = 7

Now all you have to do is use lcmp to compare the stats. If any two stats
are the same, and they are not zero, then an option has been selected
multiple times and you should show a validation error.

Hope this helps. This email was brought to you by the number 12 and the
letter 's'.


--
Colen McAlister (colen@wolflair.com)
Lone Wolf Development www.wolflair.com


------------------------ Yahoo! Groups Sponsor ---------------------~-->
Make Money Online Auctions! Make $500.00 or We Will Give You Thirty Dollars for Trying!
http://us.click.yahoo.com/KXUxcA/fNtFAA/uetFAA/IMSolB/TM
---------------------------------------------------------------------~->

To unsubscribe from this group, email

armybuilder-unsubscribe@yahoogroups.com

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
 
Good answer! That's a whole lot more complicated than I would have liked,
but you gotta do what you gotta do.

Mark

--- Colen McAlister <colen@wolflair.com> wrote:
> At 04:40 PM 5/1/2003 -0700, you wrote:
> >Unfortunately, it's both from the same source. I've got a unit that
> can
> >take up to three options (out of lets say 12). The unit can have any 3
> it
> >wants, but they can't be the same.
> >
> >Now, to make things easy (or at least less cluttered), I've put the ten
> >options into tables, so the user simply has to click each table over to
> >the option he wants and he's done. The problem with this of course is
> >that it allows the user to select an option three times (once for each
> >table).
> >
> >I didn't think there was a way of limiting the number of times an
> option
> >is taken within a unit so I'm trying to figure out a way to do it with
> >types.
>
> After a long discussion involving complex mathematics here at Lone Wolf
> HQ,
> we have discerned a solution to your problem. It involves using three
> hidden stats.
>
> Let's say you have 10 possible options in your three tables - opt1,
> opt2,
> opt3, opt4, opt5, etc etc etc. opt1 should set stat1 to the value '1'
> (note
> that it sets the stat value, not adds to it). opt2 should set stat1 to
> the
> value 2. Opt3 should set stat1 to the value 3. And so on, until opt10
> sets
> stat1 to the value 10.
>
> You'll also need 5 option categories. Table1 should be category 1;
> Table2
> should be category 3; Table3 should be category 5. (Categories 1 through
> 5
> should be placed such that options from category 1 should be evaluated
> before options from all other categories, category 2 should be evaluated
>
> next, etc.)
>
> Now make two other options. Option Calc1 should be priority 2, so it is
> evaluated after Table1, but before Table2. Calc1 should set the value of
>
> Stat2 to Stat1. Similarly, option Calc2 should be priority 4, so it is
> evaluated after Table2, but before Table3. Calc2 should set the value of
>
> Stat3 to Stat1.
>
> In case it isn't entirely clear what this will do, let's go through the
> sequence of what happens.
>
> At the start, stat1, stat2 and stat3 are all 0. Table 1 has option 1
> selected, table 2 option 7 and table 3 option 1.
>
> Table1 is evaluated first. Option1 sets stat1 to 1.
> stat1 = 1
> stat2 = 0
> stat3 = 0
>
> Now Calc1 sets stat2 to stat1.
> stat1 = 1
> stat2 = 1
> stat3 = 0
>
> Now table2 is evaluated. Option7 sets stat1 to 7.
> stat1 = 7
> stat2 = 1
> stat3 = 0
>
> Now calc2 sets stat3 to stat1.
> stat1 = 7
> stat2 = 1
> stat3 = 7
>
> Finally table3 is evaluated. Option1 sets stat1 to 1.
> stat1 = 1
> stat2 = 1
> stat3 = 7
>
> Now all you have to do is use lcmp to compare the stats. If any two
> stats
> are the same, and they are not zero, then an option has been selected
> multiple times and you should show a validation error.
>
> Hope this helps. This email was brought to you by the number 12 and the
> letter 's'.
>
>
> --
> Colen McAlister (colen@wolflair.com)
> Lone Wolf Development
> www.wolflair.com
>
>
>
> To unsubscribe from this group, email
>
> armybuilder-unsubscribe@yahoogroups.com
>
> Your use of Yahoo! Groups is subject to
> http://docs.yahoo.com/info/terms/
>
>


=====
Warhammer Club - Vancouver, BC
http://www.WCP-Vancouver.com

__________________________________
Do you Yahoo!?
The New Yahoo! Search - Faster. Easier. Bingo.
http://search.yahoo.com

------------------------ Yahoo! Groups Sponsor ---------------------~-->
Rent DVDs Online - Over 14,500 titles.
No Late Fees & Free Shipping.
Try Netflix for FREE!
http://us.click.yahoo.com/YoVfrB/XP.FAA/uetFAA/IMSolB/TM
---------------------------------------------------------------------~->

To unsubscribe from this group, email

armybuilder-unsubscribe@yahoogroups.com

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
 
Okay, I've got each of the options assigning a different value to the
first of three stats. The three tables are in three different priority
categories (1,3,and 5), and there are two calc options set to priority 2
and 4. Everything is working fine except the validation. I'm using the
following external unit attribute:

lcmp:expr1[>|>=|=|<=|<]expr2{-msg=msg}{#when}{#mode}{#legal}

but it doesn't say how I can determine if two expressions are not equal to
each other, and the couple I tried haven't worked (ie, !(stat1=stat2),
(stat1<>stat2), and (stat1!=stat2)). Any suggestions?

Thanks again for your help... this is so close to working!
Mark


--- Colen McAlister <colen@wolflair.com> wrote:
> At 04:40 PM 5/1/2003 -0700, you wrote:
> >Unfortunately, it's both from the same source. I've got a unit that
> can
> >take up to three options (out of lets say 12). The unit can have any 3
> it
> >wants, but they can't be the same.
> >
> >Now, to make things easy (or at least less cluttered), I've put the ten
> >options into tables, so the user simply has to click each table over to
> >the option he wants and he's done. The problem with this of course is
> >that it allows the user to select an option three times (once for each
> >table).
> >
> >I didn't think there was a way of limiting the number of times an
> option
> >is taken within a unit so I'm trying to figure out a way to do it with
> >types.
>
> After a long discussion involving complex mathematics here at Lone Wolf
> HQ,
> we have discerned a solution to your problem. It involves using three
> hidden stats.
>
> Let's say you have 10 possible options in your three tables - opt1,
> opt2,
> opt3, opt4, opt5, etc etc etc. opt1 should set stat1 to the value '1'
> (note
> that it sets the stat value, not adds to it). opt2 should set stat1 to
> the
> value 2. Opt3 should set stat1 to the value 3. And so on, until opt10
> sets
> stat1 to the value 10.
>
> You'll also need 5 option categories. Table1 should be category 1;
> Table2
> should be category 3; Table3 should be category 5. (Categories 1 through
> 5
> should be placed such that options from category 1 should be evaluated
> before options from all other categories, category 2 should be evaluated
>
> next, etc.)
>
> Now make two other options. Option Calc1 should be priority 2, so it is
> evaluated after Table1, but before Table2. Calc1 should set the value of
>
> Stat2 to Stat1. Similarly, option Calc2 should be priority 4, so it is
> evaluated after Table2, but before Table3. Calc2 should set the value of
>
> Stat3 to Stat1.
>
> In case it isn't entirely clear what this will do, let's go through the
> sequence of what happens.
>
> At the start, stat1, stat2 and stat3 are all 0. Table 1 has option 1
> selected, table 2 option 7 and table 3 option 1.
>
> Table1 is evaluated first. Option1 sets stat1 to 1.
> stat1 = 1
> stat2 = 0
> stat3 = 0
>
> Now Calc1 sets stat2 to stat1.
> stat1 = 1
> stat2 = 1
> stat3 = 0
>
> Now table2 is evaluated. Option7 sets stat1 to 7.
> stat1 = 7
> stat2 = 1
> stat3 = 0
>
> Now calc2 sets stat3 to stat1.
> stat1 = 7
> stat2 = 1
> stat3 = 7
>
> Finally table3 is evaluated. Option1 sets stat1 to 1.
> stat1 = 1
> stat2 = 1
> stat3 = 7
>
> Now all you have to do is use lcmp to compare the stats. If any two
> stats
> are the same, and they are not zero, then an option has been selected
> multiple times and you should show a validation error.
>
> Hope this helps. This email was brought to you by the number 12 and the
> letter 's'.
>
>
> --
> Colen McAlister (colen@wolflair.com)
> Lone Wolf Development
> www.wolflair.com
>
>
>
> To unsubscribe from this group, email
>
> armybuilder-unsubscribe@yahoogroups.com
>
> Your use of Yahoo! Groups is subject to
> http://docs.yahoo.com/info/terms/
>
>


=====
Warhammer Club - Vancouver, BC
http://www.WCP-Vancouver.com

__________________________________
Do you Yahoo!?
The New Yahoo! Search - Faster. Easier. Bingo.
http://search.yahoo.com

------------------------ Yahoo! Groups Sponsor ---------------------~-->
Rent DVDs Online - Over 14,500 titles.
No Late Fees & Free Shipping.
Try Netflix for FREE!
http://us.click.yahoo.com/YoVfrB/XP.FAA/uetFAA/IMSolB/TM
---------------------------------------------------------------------~->

To unsubscribe from this group, email

armybuilder-unsubscribe@yahoogroups.com

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
 
At 10:33 AM 5/6/2003 -0700, you wrote:
>Okay, I've got each of the options assigning a different value to the
>first of three stats. The three tables are in three different priority
>categories (1,3,and 5), and there are two calc options set to priority 2
>and 4. Everything is working fine except the validation. I'm using the
>following external unit attribute:
>
>lcmp:expr1[>|>=|=|<=|<]expr2{-msg=msg}{#when}{#mode}{#legal}
>
>but it doesn't say how I can determine if two expressions are not equal to
>each other, and the couple I tried haven't worked (ie, !(stat1=stat2),
>(stat1<>stat2), and (stat1!=stat2)). Any suggestions?

Hmm... it appears there is no way to determine if two expressions are *not*
equal. Oops. :/

You can achieve the same result you want by using an option with uexp, like
this:

uexp:(stat1=stat2)|(stat1=stat3)|(stat2=stat3)

I.e. the option will be legal if any one of the stats is equal to another.
So, create an option with that 'uexp' attribute, add 'hide' and
'type:DupChoice' (or similar) attributes to it, and assign that option to
the unit with the table options (make sure it's given a nature of 'auto',
and also that it has a lower priority than any of categories 1-5). Then the
unit can just test for the presence of type 'DupChoice' and, if it appears,
display a validation message.


--
Colen McAlister (colen@wolflair.com)
Lone Wolf Development www.wolflair.com


------------------------ Yahoo! Groups Sponsor ---------------------~-->
Get A Free Psychic Reading!
Your Online Answer To Life's Important Questions.
http://us.click.yahoo.com/cjB9SD/od7FAA/uetFAA/IMSolB/TM
---------------------------------------------------------------------~->

To unsubscribe from this group, email

armybuilder-unsubscribe@yahoogroups.com

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
 
Back
Top