Results 1 to 5 of 5

Thread: The not keyword

  1. #1
    Harbinger of... saliva Member alpaca's Avatar
    Join Date
    Aug 2003
    Location
    Germany
    Posts
    2,767

    Default The not keyword

    Hey Carl, I found a new problem in vanilla today that needs fixing (as I put it into my tutorial, it reads like this):

    Quote Originally Posted by alpaca
    Be careful when using not. It apparently doesn't work with some conditions that use a logic token (like I_CompareCounter counter = 1).
    If you want to negate these, manually negate the token, so "not condition = 1" would become "condition !=1", "not condition >= 1" would become "condition < 1" and so on.
    I found that using "I_CompareCounter = 1" and "not I_CompareCounter = 1" yields the exact same results. I'm not sure if that's true for all logic_token keywords, but to be sure, they should be changed.

    The problem is that CA uses this kind of syntax with some vanilla triggers, for example:
    Code:
    ;------------------------------------------
    Trigger battle3Dread
        WhenToTest PostBattle
    
        Condition GeneralNumKillsInBattle > 8
              and not Trait BattleChivalry > 0
    
        Affects BattleDread  1  Chance  50 
        Affects Bloodthirsty  1  Chance  10 
        Affects Brave  1  Chance  20
    So I thought I'd just tell you to have a look for that
    Last edited by alpaca; 03-28-2007 at 16:56.

  2. #2
    Senior Member Senior Member Carl's Avatar
    Join Date
    Dec 2006
    Posts
    1,461

    Default Re: The not keyword

    It definetly works with the example yopu gave in the code tags. Also the anti-trait fixes actually rely on the not code working rigt in relation to traits.

    On the other hand, thanks for the warnings about it not working in every case, I didn't know that and it would explain a few oddball things I noticed.

    Thanks.
    Find my ProblemFixer Purehere.

    This ProblemFixer fixes the following: 2-Hander bug, Pike Bug, Shield Bug, Chasing Routers, Cav not Charging, Formation Keeping Improved, Trait Bugs, and Ancillary Bugs.

    BETA Testers needed for the current version of RebuildProblemFixer. Thread here

  3. #3
    Harbinger of... saliva Member alpaca's Avatar
    Join Date
    Aug 2003
    Location
    Germany
    Posts
    2,767

    Default Re: The not keyword

    That's fine if it works for your keywords. I'd just change the logic token in the future instead of negating the whole thing to be on the safe side

    The only thing I can definitely say it doesn't work with is I_CompareCounter because that's the only one i tested properly.

  4. #4
    Senior Member Senior Member Carl's Avatar
    Join Date
    Dec 2006
    Posts
    1,461

    Default Re: The not keyword

    That's fine if it works for your keywords. I'd just change the logic token in the future instead of negating the whole thing to be on the safe side
    Of course, thats why i'm Glad of the warning. I was just pointing out that in the case of some things, we can't do it without the not tag.

    I think (don't quote me on this though), that any condition that starts with "I" is unaffected as I don't think a couple of lines relating to:

    Code:
    and not IsFactionLeader
    AND

    Code:
    and not IsFactionHeir
    are not working right. A few others too I suspect.
    Find my ProblemFixer Purehere.

    This ProblemFixer fixes the following: 2-Hander bug, Pike Bug, Shield Bug, Chasing Routers, Cav not Charging, Formation Keeping Improved, Trait Bugs, and Ancillary Bugs.

    BETA Testers needed for the current version of RebuildProblemFixer. Thread here

  5. #5
    Harbinger of... saliva Member alpaca's Avatar
    Join Date
    Aug 2003
    Location
    Germany
    Posts
    2,767

    Default Re: The not keyword

    The problem only ever applies to keywords using logic tokens as parameters (i.e. something like "=", "!=", "<", etc.)
    It definitely should work with the other keywords.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Single Sign On provided by vBSSO