Discussion in 'Mapping Questions & Discussion' started by Corfix, Oct 17, 2016.
how do i make a door that opens when you press a button
Use a func_button that will trigger a prop/wall to move via func_door. If this doesn't make any sense I can post a vmf of this as an example.
could you give me an example
Example? Well I can show you as an image, but let me draw it
And then on map when you'll shoot at the button brush, door will open
PS: You can name door as you like, but then in func_button in a box, where is "door" text type instead a name of a door
Don't forget to set the door's open direction as "up" if you want it to open upward. It's in the keyvalues along with the door name.
Learning I/O is actually required to make maps. Do so.
i have followed your example but how do you close the door again.
is always open when you press it once
Valve have been kind enough to provide us with a Close output.
so there is No Close output
Same as make an open one, but instead "Open" input you choose "Close" input
oh shit, that's an input. Infinitely sorry.
If you're going to make posts this unhelpful, why bother to post at all?
To close a door, you need to send it a Close input. You can do that any way you want: you can send it from another button, or use the Delay value to close the door after a certain time.
This is a good website to learn the ins and outs (as well as inputs and outputs) of using Hammer to make maps. If you don't want to do to much reading, I would suggest searching YouTube, or, even better, watching Crash's tutorials.
Why doesn't someone make a vmf for @Corfix to look at and study? I would totally do it right now but I am a bit busy and afk.
thanks for the infomation
Because it takes longer to make a BSP than to answer the questions.
It's a bit late, but since he's a beginner, this may still help him.
Included is a VMF with 4 doors. Three are shown here (I'll get to the 4th one later)
Door1 will open once you hit the button and it will automatically close after 3 seconds.
Door2 will open once you hit the button if it is closed and it will close once you hit the button if it is open.
Door3 will open once you hit the green button and close once you hit the red button.
For the hammer part:
The button is set to open door1 when it is damaged (hit by a player)
The door has a delay of 3, so it will close after 3 seconds of being opened.
The other doors have a delay of -1, so those doors will never do anything by themselves.
The button here will "toggle" door2, so it will set the door in the opposite position of what it's in.
For example, if it is open the button will close it and if it is closed the button will open it.
This door has 2 buttons. One that opens it (green ones) and one that closes it (red one).
Finally, we move on to #4, which is slightly more advanced.
Door 4 does the same thing as Door 2, except it lets the user use the +use command (which is disabled by default anyway).
We have "Damage Activates" Checked and use OnPressed instead of OnDamaged since damage will activate it, but so will +use.
To use the command, you first must enable it in console with
and then bind it to a key. EX:
bind O +use
See the video for a better understanding.
bind O +use
super nice Em, this is really useful for lazy hammer logic illiterate peaple like me.
Thanks for the vmf. It help Me better understand how It works
Separate names with a comma.