PC Need help with logic gates!

oren706

Terrarian
Hello everybody! I'm trying to get a little bit into wiring and logic gates in terraria and need some help. Reddit told me this is the place to ask about those things.

Note: Playing tmodloader, not vanilla.

Here is what I'm trying to make- I built a place with number of rooms and lanterns. I want to make it so when I flip a "Main switch" everything will turn on and off as well as each lantern having its own separate switch.

If the main switch is "On" and I flip a private switch then the respective lantern should turn off but if I flip the main switch again for "Off" only the lanterns that are on should turn off and vice versa.

To put it in other words I want the main switch to turns ALL lanterns off or on no matter what the current state is and a private switch that will turn a single lantern on and off regardless of the main switch current state
 
So, this is very similar to the "reset switch" problem, where you want to put something into a specific state. But instead of one specific state, you toggle between two different state. So just take the lamp on the reset switch gate, and toggle it every time the main lever gets triggered.

Capture 2021-12-10 18_08_46.png
Capture 2021-12-10 18_08_50.png

(I'm not sure why the wires are so wavy in the picture...)

One slight problem with this, is that if you, say, switch off all light manually, and then flip the main switch, it will try to turn everything off again, so nothing happens. you have to hit the main switch again, to get everything to turn on. That's a bit weird, but not a huge problem I suppose.
 
So, this is very similar to the "reset switch" problem, where you want to put something into a specific state. But instead of one specific state, you toggle between two different state. So just take the lamp on the reset switch gate, and toggle it every time the main lever gets triggered.

View attachment 350563 View attachment 350564
(I'm not sure why the wires are so wavy in the picture...)

One slight problem with this, is that if you, say, switch off all light manually, and then flip the main switch, it will try to turn everything off again, so nothing happens. you have to hit the main switch again, to get everything to turn on. That's a bit weird, but not a huge problem I suppose.
Thank you so much for the help! Will try!
 
Back
Top Bottom