Post by MrOzymandias on Aug 26, 2020 17:10:08 GMT 1
Logic Tutorial: Secure Door
Airlock Style Door
I'll start with a two-way door that limits user access by team affiliation. It's a pretty secure system. The objects in the image are spread out for visibility. This is a cross-section -- the finished product is a door in a solid wall.
Thanks to an AND box and some negates, the inside door (blue) will not open if the outside door (red) is open. Since only blue team members can open these doors, an enemy player can't simply force the inside door shut by standing on the outside door's button (but blue team players can do that). The only way for a red team player to slip into that airlock is to charge in at the same time a blue team player opens the outside door. Luckily, there's an additional layer of protection here in the form of a trigger field and fire box: the enemy player's presence will not only seal the inside door, preventing blue team members from accidentally letting in enemies, but it will also trigger a modified fire box to incinerate the airlock. Unfortunately, any blue team members caught in the airlock at the same time as a red team member probably won't survive -- that's called taking one for the team.
Door with Lock
Want a cheap and easy fix that dates back as far as 2012? Look no further than the door with lock. The idea's simple: build your two-way door, but place a switch (or in 2012, a pressure plate-toggle-negate combo) on the side you want kept secure. It's preferable, but not required, to wire this switch to something so that it actually does something -- in this case, the switch runs to an AND box, acting as a locking mechanism ("deadbolt").
While I doubt I really need to put up a demonstration, I'll still do so. In order to keep this post at a decent length, I reduced the images to thumbnails. That's why their quality is ridiculously low. Here you go:
Now, a locking mechanism is great. But want something with a little more pizazz? Try this out:
Yep, that's a bomb wired to an AND box. Press the pressure plate when that switch is "on" and ... the door opens. But if you press that pressure plate when the switch is "off," the door won't open ... and you'll blow up, too, as insult to injury.
Door with Permutation Lock
All right, so you've heard of combination locks. Well, this is the same thing but with a more proper name. A true combination lock will accept the right key presses in any order; but a permutation lock will accept the right key presses only when given in the correct order. Waaay back in the early days, a certain well-known logician ("logic coder," he called himself ... or herself, let's keep him her the person unidentifiable) put a lot of time into trying to build a permutation lock ("combination lock," most called it) to no avail. Seriously, it got to the point where a certain developer outright said that permutation locks were impossible, to which that logician said self-resetting permutation locks were impossible. It wasn't till BerickCook came around that these systems became a thing (nope, not keeping that mad scientist anonymous --- he cool). Well, as the below system illustrates, simple self-resetting permutation locks are ridiculously simple -- and yes, these boxes existed back then (save the switches). Yep, we were total pros back then ... totally knew what we were doing.
So I won't get too much into it. As long as you understand that AND boxes only send out power when all their inputs send power, and that time triggers send out power for a set duration, it's pretty easy to see just why order matters here and why the system is self-resetting after a certain amount of time. Yep, we were total pros back in the day. But in our defense, it wasn't till mid-to-late-2012 that time triggers got both a duration and a delay setting instead of just delay (or was is duration? I forget). In this system, the player has to pull a wall switch to unlock the door *after* pressing all the buttons in the right order. This has a caveat, though: there's another switch inside the sealed-off area that can disable this system altogether, rendering the door un-openable from the outside. Oh, and as what may be a step too far, there's a bomb that'll get set off if you press the buttons in the wrong order ... or take too long between pressing button 4 and pulling the switch ... or pull the switch when the lock is disabled from the inside. No matter what, the bomb goes off once that last time trigger stops putting out power while that switch is still pulled ... you can probably call that a feature, though -- it could kill intruders as they charge after you through that door. Right? Besides, the bomb only goes off if that door's shut, so ... it works.
Trapdoor
This isn't actually part of the "secure door" tutorial. I just wanted to show off my trapdoor. It opens if you step on it (hence the "trap") or if you bang your head on it (while, say, jumping on a trampoline below it). I threw in a time trigger so that the door won't close and kill you as you pass through that finicky (well, glitchy) trigger field.