F4llfield Posted March 11, 2023 Share Posted March 11, 2023 (edited) Hi, I want to have a condition that match: ((A AND B) OR (C AND D)) Here is what I wrote so far (but it's not working): Function Name Function Info Comp Value -------------------------------------------------------------------------------------------------GetIsID Actor: 'DLC01Ada' == 1.00 And ( A )GetGlobalValue Global: CompChoice == 0.00 Or ( B )GetIsID Actor: 'DLC04Dixie' == 1.00 And ( C )GetGlobalValue Global: CompChoice == 1.00 And ( D )-------------------------------------------------------------------------------------------------- The first 2 lines works fine. It stop working when I introduce the last 2 lines. I read posts on CK Conditions but I don't get it. Any insight would be appreciated. Edited March 11, 2023 by F4ll0uta Link to comment Share on other sites More sharing options...
hereami Posted March 11, 2023 Share Posted March 11, 2023 (edited) Branching is quite a pain, true. ORs form a single block until last member marked AND concludes it, then a new OR block may start and will AND with previous OR block. ANDs do not form such a block and sequences of them can't be ORed as solid blocks. Recombine, notation AND block members should be cross-ORed by exclusion principle: === OR Block1 GetIsID Actor: 'DLC01Ada' == 1.00 OR ( A ) GetGlobalValue Global: CompChoice == 1.00 AND ( D ) === OR Block2 GetIsID Actor: 'DLC04Dixie' == 1.00 OR ( C ) GetGlobalValue Global: CompChoice == 0.00 AND ( B ) Results in Block1 AND Block2. (True OR False) AND (False OR True) for Ada, (False OR True) AND (True OR False) for Dixie. Other combos will fail. Edited March 11, 2023 by hereami Link to comment Share on other sites More sharing options...
F4llfield Posted March 11, 2023 Author Share Posted March 11, 2023 Branching is quite a pain, true. ORs form a single block until last member marked AND concludes it, then a new OR block may start and will AND with previous OR block. ANDs do not form such a block and sequences of them can't be ORed as solid blocks. Recombine, notation AND block members should be ORed by exclusion principle:=== OR Block1GetIsID Actor: 'DLC01Ada' == 1.00 OR ( A )GetGlobalValue Global: CompChoice == 1.00 AND ( D )=== OR Block2GetIsID Actor: 'DLC04Dixie' == 1.00 OR ( C )GetGlobalValue Global: CompChoice == 0.00 AND ( B ) Results in Block1 AND Block2.(True OR False) AND (False OR True) for Ada, (False OR True) AND (True OR False) for Dixie. Other combos will fail. Do I create a Block simply by adding a blank condition ending with "Or" ? Link to comment Share on other sites More sharing options...
hereami Posted March 11, 2023 Share Posted March 11, 2023 (edited) In the list, consecutive Conditions with OR form a block from top to bottom, first AND below it closes the block and belongs to it. Let's say, 3 ORs followed by AND = solid block of 4 members (e.g. A Or B Or C Or D). Which operator is used at very end of the list in CK - that makes no difference, same as for a list with just one Condition. Edited March 11, 2023 by hereami Link to comment Share on other sites More sharing options...
F4llfield Posted March 12, 2023 Author Share Posted March 12, 2023 Thanks for your reply and info hereami. Link to comment Share on other sites More sharing options...
lee3310 Posted March 12, 2023 Share Posted March 12, 2023 https://www.creationkit.com/index.php?title=ConditionTake a look at the "Complex Conditions" Link to comment Share on other sites More sharing options...
DieFeM Posted March 12, 2023 Share Posted March 12, 2023 https://www.creationkit.com/index.php?title=ConditionTake a look at the "Complex Conditions" I was about to answer the same thing. Is weird that the OP used the exact same expression than the example in this page. o_O Link to comment Share on other sites More sharing options...
hereami Posted March 13, 2023 Share Posted March 13, 2023 Twice the Conditions, twice the taste. Link to comment Share on other sites More sharing options...
F4llfield Posted March 14, 2023 Author Share Posted March 14, 2023 Well, the answer that link is giving was weird for me: A ORC ANDB ORC ANDA ORD ANDB ORD That why I ask :--) Link to comment Share on other sites More sharing options...
DieFeM Posted March 14, 2023 Share Posted March 14, 2023 Basically you need to define all the permutations. ((A AND B) OR (C AND D))Can be represented by the logically equivalent list of Condition Items(A OR C AND B OR C AND A OR D AND B OR D). If I read from left to right, I would express it like this A OR C, and, A OR D, and B OR C, and, B OR D Note that it uses all OR "combinations" from each letter of the first parenthesis, with the letters of the second parenthesis. Thank God we can copy-paste the conditions as needed. Link to comment Share on other sites More sharing options...
Recommended Posts