|Name of gadget||OR gate|
|Section||Logic & Processing|
|Number of Tweak pages||1|
|Last updated||22 Feb 2019|
This gadget analyses two or more signals and produces a positive (true) signal if ANY of them is true. You would use this to activate something when any one of a selection of conditions needs to be true for an action to happen. You can add up to 10 conditions to this gadget (see tips below if you need more). For example if you had a crazy broomstick-basketball game with three hoops on each side, you could use an OR gate (along with other logic) to check whether the ball had gone through any one of the hoops and trigger a triumphant “Score!” event.
Example Tutorial (adapted from Media Molecule)
- Place 2 trigger zones overlapping each other so you have two zones and an area where both zones intersect
- Place a light
- Place a puppet
- Place an OR gate
- Connect the detected outputs on each of the trigger zones to the OR gate inputs A and B
- Connect the result of the OR gate to the power port of the light.
- In test mode possess your puppet and walk into the trigger zones and the overlapping area.
- You will notice the light comes on in every instance.
- Change the OR gate for an AND gate or an XOR gate to see the differences in these logic gadgets (for AND, the light will only come on in the overlapping area; for XOR, the light will come on with the puppet in either zone on its own but not the overlapping area).
- No. Of Ports
Select how many inputs you are comparing here. The ports are activated in strict sequence from top to bottom, A to J.
Wire your inputs into each port. An active port with no input will default to a “false” signal, though this is unimportant because one extra “false” signal won’t change the operation of the OR gate. (This is not the case for AND gates!)
This will produce a signal of true (1) if ANY of the attached inputs is true (1). It produces a signal of false (0) only when ALL of the inputs are false (0).
This is where you can turn the gadget on/off.
If you need to detect more than 10 conditions, you could use multiple OR gates together, each one detecting up to 10 signals, then each one outputting to another OR gate which would output true if any one of the umpteen original conditions is true. By nesting OR gates, any number of conditions can be checked.
However… You should also consider using some tags and a trigger zone gadget instead. Use the completion of each condition to activate a tag and then use the trigger zone to determine whether any one tag is switched on – just give all these tags the same name. And remember not to use that tag name for any other tags not related to this conditional test!