PC [Idea] Trap Disabling Failsafe - Logic Gates?

temery2383

Skeletron Prime
I came across a really neat idea for a mod, and it included a concept for traps with "failsafes" that activate if the wrong wire is cut to disable them (*cue Mission Impossible theme*), or something to that effect. My first thought was that it might be possible with some sort of logic gate setup, but given that Terraria uses a pulse-based wiring system, I'm not quite sure how that would work. Any thoughts?
 
Something like this?
2fuKLKi.png
Nk8Ve62.png

That faulty gate kinda acts as a sort of signal based NOT gate. Triggering the red input will stop the next input on blue from triggering an output on green. for every activation of the dummy engine, the red wire disables the gate, then with a 1 step delay the blue wire triggers it. If you cut the red wire, it wont get disabled anymore.
 
Something like this?
2fuKLKi.png
Nk8Ve62.png

That faulty gate kinda acts as a sort of signal based NOT gate. Triggering the red input will stop the next input on blue from triggering an output on green. for every activation of the dummy engine, the red wire disables the gate, then with a 1 step delay the blue wire triggers it. If you cut the red wire, it wont get disabled anymore.
I don't think that's quite it, but I might just be misunderstanding you. Could you explain a little more about how that works? I'm not very familiar with the mechanics of faulty gates.

It sounds to me like the traps simply keep going when the wire is cut; I think the initial idea was more of a secondary trap output that punishes players for disarming the trap incorrectly, like in action movies where snipping the wrong wire of the ticking time bomb kills everyone anyway. Here's the original wording from the person who came up with the mod idea, if that helps my explanation:
failsafes that go off if the player cuts the wrong wire trying to turn off the traps
bombs that go off if the player doesn't properly disarm them

Also, just to clarify, the idea mentioned including a debuff similar to Creative Shock from the Old One's Army event so that players wouldn't be able to simply break the traps themselves. Wouldn't want to make it that easy lol. `;)
 
It sounds to me like the traps simply keep going when the wire is cut;
The trap will only activate when the red wire is cut. You could of course wire this up to something else as well, like explosives.

Could you explain a little more about how that works?
Here's a play-by-play of what's going on:
0. The dummy engine outputs a signal once every frame.
1. The red wire gets tripped.
2. The red wire switches the lamp on the faulty gate ON and changes the lamp on the not faulty logic gate.
3. The state of the not faulty gate has changed, so it outputs a signal on blue.
4. The blue wire switches the lamp on the faulty gate OFF and hits the faulty lamp.
5. The faulty lamp of the faulty gate was hit, but the only other lamp is OFF, so it generates a signal with a 0% chance.
6. Nothing happens.

But when the red wire is broken:
1. The red wire gets tripped.
2. The red wire switches changes the lamp on the not faulty logic gate. (The one on the faulty gate got disconnected.)
3. The state of the not faulty gate has changed, so it outputs a signal on blue.
4. The blue wire switches the lamp on the faulty gate ON and hits the faulty lamp.
5. The faulty lamp of the faulty gate was hit, and the only other lamp is ON, so it generates a signal with a 100% chance.
6. The green wire gets triggered, it resets the lamp on the faulty gate to OFF and activates the trap.

You can find out more about the operation of logic gates here: https://forums.terraria.org/index.p...operations-smoke-and-how-to-prevent-it.44020/

Including this in a generated structure would be a bit though though. You need to put the engine somewhere off screen, otherwise the player could just disable that... I think it would be a lot easier to just look for broken wires whit a bit of custom code.
 
The trap will only activate when the red wire is cut. You could of course wire this up to something else as well, like explosives.


Here's a play-by-play of what's going on:
0. The dummy engine outputs a signal once every frame.
1. The red wire gets tripped.
2. The red wire switches the lamp on the faulty gate ON and changes the lamp on the not faulty logic gate.
3. The state of the not faulty gate has changed, so it outputs a signal on blue.
4. The blue wire switches the lamp on the faulty gate OFF and hits the faulty lamp.
5. The faulty lamp of the faulty gate was hit, but the only other lamp is OFF, so it generates a signal with a 0% chance.
6. Nothing happens.

But when the red wire is broken:
1. The red wire gets tripped.
2. The red wire switches changes the lamp on the not faulty logic gate. (The one on the faulty gate got disconnected.)
3. The state of the not faulty gate has changed, so it outputs a signal on blue.
4. The blue wire switches the lamp on the faulty gate ON and hits the faulty lamp.
5. The faulty lamp of the faulty gate was hit, and the only other lamp is ON, so it generates a signal with a 100% chance.
6. The green wire gets triggered, it resets the lamp on the faulty gate to OFF and activates the trap.

You can find out more about the operation of logic gates here: https://forums.terraria.org/index.p...operations-smoke-and-how-to-prevent-it.44020/
Okay, thank you! It makes a bit more sense now.
Including this in a generated structure would be a bit though though. You need to put the engine somewhere off screen, otherwise the player could just disable that...
There was something about a "control room" type of area within the structure, so perhaps the total shutoff could be in there.
I think it would be a lot easier to just look for broken wires whit a bit of custom code.
That's very true. I was mostly just trying to find a proof of concept solution to help with brainstorming.

Here's my own idea (in the last picture I had the wire removed from the explosives simply so they wouldn't blow up in the test):
Capture 2018-05-27 19_41_01.png
Capture 2018-05-27 19_42_34.png
Capture 2018-05-27 19_45_32.png
Capture 2018-05-27 19_49_27.png

Basically, the timer gives an output to both lamps of the XOR gate, keeping the gate from activating the explosives. When the trap is disabled, the timer still gives a signal to one of the lamps, causing the gate to activate. The timer, explosive wire and second output would be inaccessible from the vicinity of the trap, maybe with a shutoff in the control room like was mentioned. It's a fairly simple solution, but it's functional.
 
Okay, thank you! It makes a bit more sense now.

There was something about a "control room" type of area within the structure, so perhaps the total shutoff could be in there.

That's very true. I was mostly just trying to find a proof of concept solution to help with brainstorming.

Here's my own idea (in the last picture I had the wire removed from the explosives simply so they wouldn't blow up in the test):
View attachment 201468 View attachment 201469 View attachment 201470 View attachment 201471
Basically, the timer gives an output to both lamps of the XOR gate, keeping the gate from activating the explosives. When the trap is disabled, the timer still gives a signal to one of the lamps, causing the gate to activate. The timer, explosive wire and second output would be inaccessible from the vicinity of the trap, maybe with a shutoff in the control room like was mentioned. It's a fairly simple solution, but it's functional.
You could actually use both wire to trigger separate batches of traps. Then the explosives are triggered when the player tries to disable either one.
JM1lb0w.png

It's pretty straight forward, but I could imagine some people might fall for it. :D
 
You could actually use both wire to trigger separate batches of traps. Then the explosives are triggered when the player tries to disable either one.
JM1lb0w.png

It's pretty straight forward, but I could imagine some people might fall for it. :D


You could put walls behind remove the explosives so it's hard to see
 
Back
Top Bottom