Jump to content

Demorgan laws and OR() - Don't work


i30817

Recommended Posts

Posted

Demorgan laws don't work with OR

 

IF
!OR(3)
  True()
  True()
  True()
THEN
 RESPONSE #100
 DisplayStringHead(Myself,@8)
END

 

Always displays the string, though it shouln't since

!( A OR B OR C) == !A AND !B AND !C

!True() AND !True() AND !True()

Posted

IE OR() is a little different

 

The way that reads, it's

 

IF

OR(3)

!True()

!True()

!True()

THEN

RESPONSE #100

DisplayStringHead(Myself,@8)

END

 

If you want !True() AND !True() AND !True(), use that, not the OR() block.

Posted

Look up REFACTOR_BAF_TRIGGER if you want to apply DeMorgan's law to BG2 scripting:

 

IF
 !ThisIsNotATrigger()
THEN
...

 

COMPILE ~myfile.baf~
REFACTOR_BAF_TRIGGER ~ThisIsNotATrigger()~ ~OR(3) InParty("Imoen") InArea("AR1000") Global("variable","GLOBAL",5)

 

will turn the NOT (A || B || C) into !A && !B && !C.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...