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