Creating a Button to Open/Close multiple doors

Creating a Button to Open/Close multiple doors

Re: Creating a Button to Open/Close multiple doors Posted by Livett on Wed Dec 29th 2004 at 10:20pm
Livett
164 posts
Posted 2004-12-29 10:20pm
Livett
member
164 posts 46 snarkmarks Registered: Dec 24th 2004 Occupation: Student Location: England
Can someone please explain to me how to make a switch (same sort of design as an electric chair switch) so that you press use on it and the switch goes down and opens several doors. Then if you press use again the switch goes up and opens all the dors.

I am not a newb so I know how to create the switch and know how to get it to open the doors and close them... I just can't get it so that when you press use on it it goes up/down and opens/closes the doors and I can't get it to rotate like a switch does.

I have searched for ages trying to find how with no luck.
Re: Creating a Button to Open/Close multiple doors Posted by Zeon on Wed Dec 29th 2004 at 10:43pm
Zeon
37 posts
Posted 2004-12-29 10:43pm
Zeon
member
37 posts 14 snarkmarks Registered: Dec 22nd 2004 Location: USA
In situations like this, it's probably easiest to just tier the logic. Have your func_button trigger a logic_relay everytime it's activated....like open_doors_relay and close_doors_relay. Then you can worry about making the button 'just' move down when the doors should be closing...which would entail probably a knife switch rotation. I think there's a model called "prison switch", which is probably what you're looking for.

Anyway, back on track. Push the button, button triggers open_door_relay, open_door_relay outputs to X number of doors to open and also causes the switch to rotate. Make sure to time how long the switch rotation takes, so that you can ignore user input until the doors are fully opened and the switch has fully rotated. After that, repeat the process in reverse for the close_doors_relay.

If it's the rotation you're worried about, it kinda depends on if you're using a model switch, or a brush switch. Either way, though, you'll just have to parent the moving part of the switch to a rotate function. On the flip side, func_buttons inherently slide when pressed, so that might be another solution.
Re: Creating a Button to Open/Close multiple doors Posted by Livett on Wed Dec 29th 2004 at 10:46pm
Livett
164 posts
Posted 2004-12-29 10:46pm
Livett
member
164 posts 46 snarkmarks Registered: Dec 24th 2004 Occupation: Student Location: England
Well the rotating I can sort out now... I am able to make a func_button which opens all doors in it's output, but the only way I can get a switch to close them is a completely different switch, can I make it so when you press use it executes all the open output commands, and then when u press it again it executes all the close output commands?
Re: Creating a Button to Open/Close multiple doors Posted by Zeon on Wed Dec 29th 2004 at 10:51pm
Zeon
37 posts
Posted 2004-12-29 10:51pm
Zeon
member
37 posts 14 snarkmarks Registered: Dec 22nd 2004 Location: USA
Set your doors to "Toggle". Then make sure all the doors are in the same position (logically, closed). Then set the output on your button to Toggle, instead of Open or Close (depending on the circumstance). That way, it'll just take the current state that the door is in, and move it to the opposite state. Make sure to check the box that says "Force Close", so that if someone moves a table in the door jam, it won't screw up the rotation by having one door close while the others open, lol.
Re: Creating a Button to Open/Close multiple doors Posted by Livett on Wed Dec 29th 2004 at 10:52pm
Livett
164 posts
Posted 2004-12-29 10:52pm
Livett
member
164 posts 46 snarkmarks Registered: Dec 24th 2004 Occupation: Student Location: England
Cheers... you were a great help!
Re: Creating a Button to Open/Close multiple doors Posted by uberDingo on Wed Dec 29th 2004 at 11:59pm
uberDingo
72 posts
Posted 2004-12-29 11:59pm
72 posts 17 snarkmarks Registered: Dec 21st 2004
This may be a hack way to do it but Ive found that if I give 4 lights the same name and then I can use one button to turn them all on and off at the same time as well :smile: It works for env_fires as well.. so I assume it would work for doors. I havent had any problems doing this so far ... does anyone know if there's anything wrong with doing it like that?
Re: Creating a Button to Open/Close multiple doors Posted by Livett on Thu Dec 30th 2004 at 12:41am
Livett
164 posts
Posted 2004-12-30 12:41am
Livett
member
164 posts 46 snarkmarks Registered: Dec 24th 2004 Occupation: Student Location: England
Well I am making Alcatraz and at the moment and so far I have 144 prison cells seperated into 3 rooms each with 3 platforms. Half the doors slide open one way, half another. I am using my own method o sorting them all out and I am giving them all different names. Just to be on the safe side.
Re: Creating a Button to Open/Close multiple doors Posted by Leperous on Thu Dec 30th 2004 at 12:59am
Leperous
3382 posts
Posted 2004-12-30 12:59am
Leperous
Creator of SnarkPit!
member
3382 posts 1635 snarkmarks Registered: Aug 21st 2001 Occupation: Lazy student Location: UK
There's no problem with giving entities the same name, no.