Button/door problem

Button/door problem

Re: Button/door problem Posted by Agent_21 on Tue Jul 17th 2007 at 10:48am
Agent_21
19 posts
Posted 2007-07-17 10:48am
Agent_21
member
19 posts 2 snarkmarks Registered: Apr 23rd 2005 Occupation: Mapper Location: United States
I've looked around quite alot for a thread relating to this, but to no avail. I have one button, and I would like for it to open the door the first time you press it, and the second time you press it, close the door. I'm certainly not a mapping "noob", but I have never done something like this before. I am sure it has something to do with a logic entity, but having never used one before, I'm a bit in the dark. Any help or links to something relevant would be greatly appreciated.
Re: Button/door problem Posted by Riven on Tue Jul 17th 2007 at 2:16pm
Riven
1640 posts
Posted 2007-07-17 2:16pm
Riven
Wuch ya look'n at?
super admin
1640 posts 1266 snarkmarks Registered: May 2nd 2005 Occupation: Architect Location: Austin, Texas, USA
There's a nifty little flag and output you can use to open and close the door with one button. If this is a func_door_rotating, you can go into the flags tab and check the "toggle" flag if it isn't already. Then for the related func_button, tell its output to be:

My output named: OnPressed
Targets entities named: <the name you gave your door>
Via this input: toggle
The rest is on your preference, just make sure "Fire once only" is not checked.

That way, if your door spawns closed, a toggle action will make it open, then pressing it again will close it. Since there's only two different states this door can be in, the toggle output is available. This option is also available to the other door entities, like: func_door and prop_door_rotating, and many more.

And the "toggle" feature can be used for the output of other entities as well, namely the "logic" entities!
Blog: www.playingarchitecture.net
LinkedIn: Eric Lancon
Twitter:@Riven202
Re: Button/door problem Posted by hl_world on Tue Jul 17th 2007 at 3:49pm
hl_world
144 posts
Posted 2007-07-17 3:49pm
hl_world
member
144 posts 144 snarkmarks Registered: Jan 30th 2007
Rivens solution should work for you. The Input/Output system in Hammer doesn't require a degree in computer science. All you need is common sense. It's so flexible too, it's basically scripting.