• 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 and unit size

  • Thread starter Thread starter shawn at electricstitch.c
  • Start date Start date
S

shawn at electricstitch.c

Guest
I have a unit w/ 1-3 models.
1 model may be upgraded to a leader.
Each model must take 3 weapon options.

I made the leader a child unit.
weapon options are in conflict group, allowing only 3 options.
weapon options have (base:delta+1)
unit has (lcmp:delta=3-msg=msg1)
(the idea being, you have to have three options, if you don't you will get
an error message.

I made the parent unit (zero) so that a leader can be chosen and also be the
only model. (You get a parent unit w/ zero models and a child unit w/ 1
model, which is the "leader").

The problem I ran into is the (lcmp) for taking 3 options. When the unit is
reduced to zero models (w/ child unit of 1), I get the validation error for
not having 3 weapon options in the parent unit.

I added an option "NoModels" (base:delta+3) and (usiz:max=0). This only
appears when the unit size is zero and effectivly removes the validation
error.

I am wondering if I have gone to too much trouble, is their an easier way of
solving this problem? Is their a way to make armybuilder auto-select the
"NoModels" option when the unit size is zero? (I could hide the option and
the user wouldn't be aware of it and would be ideal). Or is their a way to
make lcmp only valid if the unit size is greater than zero. (something like
(lcmp:delta=3&#>0), I know this doesn't work, but you get the idea.)

All I want is to be able to select zero models and not have the validation
error message appear.

Thanks,
Shawn






------------------------ Yahoo! Groups Sponsor ---------------------~-->
FREE COLLEGE MONEY
CLICK HERE to search
600,000 scholarships!
http://us.click.yahoo.com/ujOgTC/4m7CAA/ySSFAA/IMSolB/TM
---------------------------------------------------------------------~->
 
At 17:30 30/09/2001 -0700, you wrote:
>I have a unit w/ 1-3 models.
>1 model may be upgraded to a leader.
>Each model must take 3 weapon options.
>
>I made the leader a child unit.
>weapon options are in conflict group, allowing only 3 options.
>weapon options have (base:delta+1)
>unit has (lcmp:delta=3-msg=msg1)
>(the idea being, you have to have three options, if you don't you will get
>an error message.
>
>I made the parent unit (zero) so that a leader can be chosen and also be the
>only model. (You get a parent unit w/ zero models and a child unit w/ 1
>model, which is the "leader").
>
>The problem I ran into is the (lcmp) for taking 3 options. When the unit is
>reduced to zero models (w/ child unit of 1), I get the validation error for
>not having 3 weapon options in the parent unit.
>
>I added an option "NoModels" (base:delta+3) and (usiz:max=0). This only
>appears when the unit size is zero and effectivly removes the validation
>error.
>
>I am wondering if I have gone to too much trouble, is their an easier way of
>solving this problem? Is their a way to make armybuilder auto-select the
>"NoModels" option when the unit size is zero? (I could hide the option and
>the user wouldn't be aware of it and would be ideal).

Just attach it with the 'auto' link nature, with the attributes usiz:min=0
and usiz:max=0. Oh, and hide it. Then it will be auto-selected, except when
you've got more than 0 models. :)


--
Colen 'Skrillboy' McAlister, demandred@skrill.org
http://www.skrill.org/, http://www.incompetence-central.co.uk/
1 = 2, for large values of 1.


------------------------ Yahoo! Groups Sponsor ---------------------~-->
FREE COLLEGE MONEY
CLICK HERE to search
600,000 scholarships!
http://us.click.yahoo.com/Pv4pGD/4m7CAA/ySSFAA/IMSolB/TM
---------------------------------------------------------------------~->
 
You can implement the constraint you're looking for with two additional
steps. First, create an option that assigns the unit a type (e.g.
"type:NonZero"). Also include the "usiz:min=1" attribute, which makes the
option only valid when the unit size is at least one model. Attach this
option to each top-level unit. This way, whenever the unit has a size of
1+, it is assigned the "NonZero" type. The second step is to modify the
"lcmp" attribute to use the "-when=" qualifier. Simply specify that the
attribute only applies when the unit has the "NonZero" type.

Hope this helps,
Rob


At 05:30 PM 9/30/2001 -0700, you wrote:
>I have a unit w/ 1-3 models.
>1 model may be upgraded to a leader.
>Each model must take 3 weapon options.
>
>I made the leader a child unit.
>weapon options are in conflict group, allowing only 3 options.
>weapon options have (base:delta+1)
>unit has (lcmp:delta=3-msg=msg1)
>(the idea being, you have to have three options, if you don't you will get
>an error message.
>
>I made the parent unit (zero) so that a leader can be chosen and also be the
>only model. (You get a parent unit w/ zero models and a child unit w/ 1
>model, which is the "leader").
>
>The problem I ran into is the (lcmp) for taking 3 options. When the unit is
>reduced to zero models (w/ child unit of 1), I get the validation error for
>not having 3 weapon options in the parent unit.
>
>I added an option "NoModels" (base:delta+3) and (usiz:max=0). This only
>appears when the unit size is zero and effectivly removes the validation
>error.
>
>I am wondering if I have gone to too much trouble, is their an easier way of
>solving this problem? Is their a way to make armybuilder auto-select the
>"NoModels" option when the unit size is zero? (I could hide the option and
>the user wouldn't be aware of it and would be ideal). Or is their a way to
>make lcmp only valid if the unit size is greater than zero. (something like
>(lcmp:delta=3&#>0), I know this doesn't work, but you get the idea.)
>
>All I want is to be able to select zero models and not have the validation
>error message appear.
>
>Thanks,
>Shawn


---------------------------------------------------------------------------
Rob Bowes (rob@wolflair.com) (650) 726-9689
Lone Wolf Development www.wolflair.com


------------------------ Yahoo! Groups Sponsor ---------------------~-->
FREE COLLEGE MONEY
CLICK HERE to search
600,000 scholarships!
http://us.click.yahoo.com/Pv4pGD/4m7CAA/ySSFAA/IMSolB/TM
---------------------------------------------------------------------~->
 
Back
Top