Creating a Coded Locked Door

Creating a Coded Locked Door

Re: Creating a Coded Locked Door Posted by Necromancer on Wed Dec 15th 2010 at 6:30am
Necromancer
392 posts
Posted 2010-12-15 6:30am
392 posts 1499 snarkmarks Registered: May 5th 2008
I am wanting to make a door that you must press buttons in a certain order to unlock the door, but when the wrong button is pressed I want the buttons to all reset. (I would like to have a 3-4 button combination)
I do have a prefab that I downloaded before but I am having some difficulty making sense out of it. If I really disected it I may be able to create my own but it would be much more beneficial if someone could explain how to do this step by step.
I know it has to do with the trigger_changetarget but it is confusing as to what is exactly happening with all of the parts.

Any help would be greatly appreciated. Thanks.
Re: Creating a Coded Locked Door Posted by [RDC]Twitch on Mon Apr 11th 2011 at 7:11pm
[RDC]Twitch
99 posts
Posted 2011-04-11 7:11pm
99 posts 1085 snarkmarks Registered: Jun 6th 2009 Location: USA
I am also interested in this. I tried messing with two different prefabs and could never get it to work for me. A prefab with a simple three number code would be great... and instructions regarding how to change the combination.
web
Half-Life, Half-Life 2, and Q3 engine mapping
Re: Creating a Coded Locked Door Posted by Degenatron on Tue Apr 12th 2011 at 3:19pm
Degenatron
64 posts
Posted 2011-04-12 3:19pm
64 posts 1336 snarkmarks Registered: Dec 7th 2004 Occupation: IT Professional Location: USA
In its simplest form, each button would consist of two buttons. We'll call them Good and Bad. Good buttons enter the proper code when pressed in order. Bad buttons reset all of the button. For each "Real" button, there are actually two "Logical" buttons that are invisible.

So, if you want the code to be 1-2-3-4, it would work like this:

1. Button 1 starts as its "Good Button". 2,3, and 4 start as "Bad Buttons"

2. Pressing Button 1 first disables the Button 1 "good button", then enables the button 1 "Bad Button" (pressing 1 again is the wrong code), then disables Button 2 "Bad button" and enables the Button 2 "Good Button". this process is done with a multimanager for EACH BUTTON (button1MM, button2MM, ect.).

3. Repeat until button 4. When the button 4 "Good Button" is pressed it does two things - it resets the keypad and opens the door. It does this by pointing at a mulitmanager, which in turn points at the button reset and the door.

Reseting the keypad:

When a "Bad Button" is pushed, the bad button points to a multimanager which targets the 2,3, and 4 "Bad Buttons" and ENABLES them. It also targets the 2,3, and 4 "Good Buttons" and DISABLES those. Finally, it does the oposite for Button 1, turning its "good button" ON, and it's bad button OFF.

This should be a stand-alone multimanager since you'll use it for both a bad combo AND for the completion of the good combo.

Getting Fancy:

Once you have that basic logic structure down, you can start adding in extras, for example:
  • Add in the "access denied" sound to each "bad button"
  • Add in the "access granted" sound to the Door open multimanager.
  • Finally, add in buttons that light up - Each "Real" button gets a turned into two wall_toggles - one has a dark button face, the other has a lit button face. When a good button is pushed, its multimanager does the toggling, turning the lit button on and the dark button off. The reset MM would set them back.
Hope that helps,
D-Gen
Re: Creating a Coded Locked Door Posted by Degenatron on Tue Apr 12th 2011 at 4:00pm
Degenatron
64 posts
Posted 2011-04-12 4:00pm
64 posts 1336 snarkmarks Registered: Dec 7th 2004 Occupation: IT Professional Location: USA
One MAJOR detail I forgot:

Each multimanager should work through trigger_relay. The trigger_relays will allow you to define the state of the buttons. The multimanager will simply toggle back and forth which will get things out of sequence.

Button ---> Multimanager ---> trigger_relay ---> Enable/ Disable Button

Sorry about that.

D-Gen
Re: Creating a Coded Locked Door Posted by Necromancer on Sat Aug 6th 2011 at 3:02am
Necromancer
392 posts
Posted 2011-08-06 3:02am
392 posts 1499 snarkmarks Registered: May 5th 2008
Thanks. I'll try that out soon and see if I can get it to work.
Re: Creating a Coded Locked Door Posted by Necromancer on Sat Aug 6th 2011 at 3:20am
Necromancer
392 posts
Posted 2011-08-06 3:20am
392 posts 1499 snarkmarks Registered: May 5th 2008
I am still having some confusion though. When you said to disable button 1 good button and make it bad button--- I assume that this means you would make the trigger_relay target button 1 and have a trigger state of: off? Then to make button 2 the good button would you have the first multimanager, (targeted by button 1) target a second trigger_relay to change the trigger state of button 2 to on?
I'm not totally sure how this works.
Is it correct to say that when you say "good button" you mean the trigger_relay should have a trigger state of: on and a "bad button" means a trigger state of:off? (The only option for the flags is "remove on fire")

Also one other question:
How do you make the buttons initially be "bad buttons"? and Are trigger_changetargets ever needed?
I know I have a lot of questions here but the help would be very appreciated. Thanks.