Logic bricks & expressions


The above image are the logic bricks that I have created. How can I “order” the expression to take place when both of the sensors get activated and not only 1 of them ?

p.s. duplicate thread me on http://blender.stackexchange.com/questions/40511/is-this-example-of-expressions-correct

  1. Your expression is wrong “if ((cor_exhibit_door == stol_exhibit_door), True, False)” or “cor_exhibit_door == stol_exhibit_door”.
  2. If you only want to activate the expression if are bot sensors active then you can add the names of the sensors to the expression. “if (Near AND E AND (cor_exhibit_door == stol_exhibit_door), True, False)” or “Near AND E AND (cor_exhibit_door == stol_exhibit_door)”

Oh damn, I put the wrong image. I ve been using “if ((cor_exhibit_door == stol_exhibit_door), True, True)” though but it is also wrong.
I get why your suggestions is correct. So my 2nd expression is no longer needed right? Cause I’ll have True/False.
About your 2nd suggestion, I am gonna check it out and return if I find a problem. Many thanks!

Hmm, it does not work. Tested with some properties also. If I set (… True, True) in E1 then it does set the new scene so the mistake is not in the Expresssion since it sends a True pulse when the E1 is False. It somehow fails to see the sensors getting activated or maybe there is something wrong in my logic. Are you sure this is how I name the sensors and now with something more complicated?
It doesn’t send me any wrong messages in the console either so it is hard to detect where I am failing.

Edit: Yeah the name of the sensors are cool based to http://www.tutorialsforblender3d.com/LogicBricks/Controllers/Expression/Expression_Controller_Examples.html

I am 100% sure that this works.
Check the naming of the variables and sensors also they are case sensitive. Also the AND must be upper case. Also check if the name of the sensor don’t have a space in it.
You need a second expression, because how you want to trigger the second actuator without it?
(… True, True) I definitely wrong. Because it will trigger the actuator even the two strings are not equal.

Here my test file. In state 2 is the second way without the if conditional.

The expression string is not Python, it is a little mini language.

You do not need an “if”. It is syntactical incorrect (check your console for output).

The expression results in an Boolean value as is. In your case either “cor_exhibit_door == stol_exhibit_door” alternative: “cor_exhibit_door = stol_exhibit_door”

AND/OR can be lower case and
True, False can be true false.

When the expression evaluates to True all connected actuators will be activated, otherwise deactivated.
The controller evaluates each time the controller gets triggered (check the level triggering flags at your sensors).

I just copy pasted what you sent me + corrected a typo I had made and it worked. Many many thanks!