Jump to content

CK and conditions


Recommended Posts

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 by F4ll0uta
Link to comment
Share on other sites

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 by hereami
Link to comment
Share on other sites

 

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 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.

 

 

Do I create a Block simply by adding a blank condition ending with "Or" ?

Link to comment
Share on other sites

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 by hereami
Link to comment
Share on other sites

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

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...