• 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

lcmp and base odd behavior?

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

shawn at electricstitch.c

Guest
The following didn't work for me. I found a solution, but I thought it was
odd. First what I attempted:

Unit Alpha can have a child 'Unit Beta'. Unit Alpha can only have child
"Unit Beta' if it possess 'Item Beta'.

My thought was to do this:
Option Beta: base:beta+1
Item Beta: base:beta-1
Unit Alpha: lcmp:beta=1-msg=nobeta

beta is defualt 0.

I figured Item Beta and Option beta would cancel each other out, equaling 0.
If option beta is taken alone, then lcmp:beta=1 would kick in.

I got odd results. (I forget exactly, it took a lot of trial and error to
figure out a way to make it work).

What I had to do was this:

Option Beta: base:beta+5
Item Beta: base:beta=(-5)
Unit Alpha: lcmp:beta<1-msg=nobeta

I thought this was odd, but it actually works!?

I also note that when I debug the hidden stats, it shows beta=0 regardless
of if option beta is taken. (shouldn't taking Option Beta alone cause debug
to show beta=5?) If I take Item beta, it debugs as beta-5 (I expected this).
and when I take option beta w/ Item beta it debugs at beta=0 (expected). I
had figured that lcmp:beta=5 would have been appropriate, but this causes
Item Beta (alone) to error instead of Option Beta (alone).

I admit, I am still learning the ropes here. but this just seems odd to
me... I also hope my explanation made sense.

Thanks,
-Shawn


------------------------ Yahoo! Groups Sponsor ---------------------~-->
Get your FREE credit report with a FREE CreditCheck
Monitoring Service trial
http://us.click.yahoo.com/M8mxkD/bQ8CAA/ySSFAA/IMSolB/TM
---------------------------------------------------------------------~->
 
There are two issues here. First, I'm not sure why you are using a stat to
track whether an option should be available for selection. If I understand
correctly, you could much more easily solve this with a simple
"type:BetaOK" attribute on the item and a "utyp:BetaOK" on the option. If
the option is required when the item is taken, you can either use the
"uadd" attribute on the item or you can define a "must" attribute on the
parent unit that requires selection of the child unit only "when" the
assigned type is present. So if the item is selected, the type is assigned,
which means the option must be selected.

The second issue is that I believe you have the "lcmp" attribute inverted
in its meaning. The attribute verifies that the stat comparison
relationship is complied with. If it is NOT complied with, THEN the
validation error is triggered. This means that "lcmp:beta=1" will trigger
an error any time that "beta" is NOT equal to 1. From your description it
appears that you are assuming the error will be reported if "beta" DOES
equal 1, which is exactly the opposite from how it works.

Another important detail to keep in mind is the bounds specified for stats.
Within the definition file, each stat has a bounding range specified. Make
sure that you don't inadvertently expect a stat to go outside of that
bounding range, because it won't. For example, if the range has a minimum
of 0 and a maximum of 100, subtracting 5 from a starting value of 0 will
yield a result of 0 (the minimum). This can be very confusing, since it's
controlled in the definition file and everything in the data files will
look great, but AB will appear to be generating incorrect results. Even
though it is generating the exact results you told it to. :-)

If I have misunderstood anything, please clarify for me. Otherwise, I hope
this helps out a bit. :-)

Thanks, Rob


At 03:12 AM 8/23/2001 -0700, you wrote:
>The following didn't work for me. I found a solution, but I thought it was
>odd. First what I attempted:
>
>Unit Alpha can have a child 'Unit Beta'. Unit Alpha can only have child
>"Unit Beta' if it possess 'Item Beta'.
>
>My thought was to do this:
>Option Beta: base:beta+1
>Item Beta: base:beta-1
>Unit Alpha: lcmp:beta=1-msg=nobeta
>
>beta is defualt 0.
>
>I figured Item Beta and Option beta would cancel each other out, equaling 0.
>If option beta is taken alone, then lcmp:beta=1 would kick in.
>
>I got odd results. (I forget exactly, it took a lot of trial and error to
>figure out a way to make it work).
>
>What I had to do was this:
>
>Option Beta: base:beta+5
>Item Beta: base:beta=(-5)
>Unit Alpha: lcmp:beta<1-msg=nobeta
>
>I thought this was odd, but it actually works!?
>
>I also note that when I debug the hidden stats, it shows beta=0 regardless
>of if option beta is taken. (shouldn't taking Option Beta alone cause debug
>to show beta=5?) If I take Item beta, it debugs as beta-5 (I expected this).
>and when I take option beta w/ Item beta it debugs at beta=0 (expected). I
>had figured that lcmp:beta=5 would have been appropriate, but this causes
>Item Beta (alone) to error instead of Option Beta (alone).
>
>I admit, I am still learning the ropes here. but this just seems odd to
>me... I also hope my explanation made sense.
>
>Thanks,
>-Shawn


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


------------------------ Yahoo! Groups Sponsor ---------------------~-->
Get your FREE credit report with a FREE CreditCheck
Monitoring Service trial
http://us.click.yahoo.com/M8mxkD/bQ8CAA/ySSFAA/IMSolB/TM
---------------------------------------------------------------------~->
 
> "type:BetaOK" attribute on the item and a "utyp:BetaOK" on the option. If
> the option is required when the item is taken, you can either use the
> "uadd" attribute on the item or you can define a "must" attribute on the
> parent unit that requires selection of the child unit only "when" the
> assigned type is present. So if the item is selected, the type is
assigned,
> which means the option must be selected.

I used uadd and it did exactly what I wanted. Thanks Rob. No need for
validation now!!

-Shawn


------------------------ Yahoo! Groups Sponsor ---------------------~-->
Get your FREE credit report with a FREE CreditCheck
Monitoring Service trial
http://us.click.yahoo.com/M8mxkD/bQ8CAA/ySSFAA/IMSolB/TM
---------------------------------------------------------------------~->
 
Back
Top