WiseDoorBreak: Breakable Door
This tutorial was originally created by wisemx. It was originally posted on SDKnuts.net.
Introduction
In this project we are going to create a door that will function they way you would expect and can be destroyed.
Creation
The first thing is to determine the size of the door you need. With Prop doors, (Model doors), I place the door and then build the wall around it. This door allows us a bit more flexibility in that we need only be concerned with the player height/width and the appearance we desire.
Create a brush with the nodraw texture: 4 x 48 x 109 units (The wall is 4 units thick). Now let’s texture our brush based door.
Door faces: wood\wooddoor008a
Door edges: plaster\plasterwall012a
Use the Face Edit tool to apply any textures you like for your door. Some textures, filter with keyword “door”, have door handles and windows, of course these are not functional. You can create your own handle from small brushes, just for appearance. Now select the door and press Ctrl+T then convert your door to func_door_rotating
. Give it a name, and check the Use Opens flag.
Create another brush with the nodraw texture the same size as your door except for the width which will be one unit thicker than the door on both faces. 6 x 48 x 109 units. Tie this brush to func_breakable
and move it so it covers your door. (The door will be inside of it.)
Set these properties:
- Disable Shadows: Yes
- Parent: door1
- Prop Data: None
- Strength: 90
- Material Type: Wood
- Disable Receiving Shadows: Yes
Now set these outputs for the func_breakable
:
My Output | Target Entity | Target Input | Parameter | Delay | Only Once | |
---|---|---|---|---|---|---|
OnBreak | door1 | Kill | 0.00 | No | ||
OnUser1 | door1 | Toggle | 0.00 | No |
This is but one method for creating a door that can be destroyed; I believe this may is best.
When the player presses the Use key our door will either open or close. If the door gets a lot of damage it will break apart and then it will be gone.