Door creation: Difference between revisions
mNo edit summary |
mNo edit summary |
||
Line 18: | Line 18: | ||
== Turning the Brush Into the Door == | == Turning the Brush Into the Door == | ||
To turn the brush into a functioning door, select it and press {{key|ctrl}}+{{key|T}}. If you want a door that moves in a specified direction, select {{ent|func_door}} then scroll down to the '''Move Direction''' property and set the value you want, or select up or down from the small dropdown. For a more traditional style door, select {{ent|func_door_rotating}}. To make a <code>func_door_rotating</code> rotate around a different point | To turn the brush into a functioning door, select it and press {{key|ctrl}}+{{key|T}}. If you want a door that moves in a specified direction, select {{ent|func_door}} then scroll down to the '''Move Direction''' property and set the value you want, or select up or down from the small dropdown. For a more traditional style door, select {{ent|func_door_rotating}}. To make a <code>func_door_rotating</code> rotate around a different point than the center, drag the origin helper in the 2D view or the blue sphere in the 3D view to the point you want it to rotate around. | ||
[[Image:Door_brush_4.png|800px]] | [[Image:Door_brush_4.png|800px]] | ||
== Making a Button for Your Door == | == Making a Button for Your Door == | ||
If you want your door to be toggleable, you need to create a {{ent|func_button}}, or other entity that can activate and send an output, and set it to toggle the door open and close state. If you want a <code>func_door_rotating</code> to move when the player <code>+USE</code>es on the door, and also be able to open and close multiple times, you will have to create a button that moves with the door. First, name the door something like <code>door1</code>. Then create a brush that envelops the door and tie it to a <code>func_button</code>. Set the texture to something like a <code>tools/toolsinvisible</code> and set the collision to not solid. Then, set its parent to the name you gave the door. When the door moves, so will it. Scroll down and set its reset time to 0. Then, go to the output tab. Create a new output and set it to this: | |||
:{| {{OutputsTable}} | :{| {{OutputsTable}} | ||
| [[Image:Io11.png]] || | | [[Image:Io11.png]] || OnPressed || door1 || Toggle || || 0.00 || No | ||
|} <br> | |} <br/> | ||
That should enable the door to be used multiple times. | |||
If you are using a <code>func_door</code>, it is better to use a {{ent|trigger_multiple}} to automatically open and close the door when you approach it. | |||
Create a brush with the {{note|in progress editing please excuse}} | |||
== Avoiding Graphical Bugs == | |||
When using a <code>func_door</code>, if it is the same width as the wall and moves into it, it will appear to phase in and out if the textures are different. The best way to avoid this is to scale down the width of the door and also to make a slot in the wall for where the door will slide into. This issue is not always present in <code>func_door_rotating</code> as it does not completely submerge into the wall, unless specified, so it is not as important in that case but should still be taken into account. | |||
[[Image:Door_brush_10|800px]] | |||
== Making Double Doors == | == Making Double Doors == |
Revision as of 20:59, 7 September 2022

In this tutorial, you will learn how to create a functioning brush-based door.
Brush or Point Based?
It is important to know the difference between a "brush-based" and a "point-based" door. For starters, brush-based doors are, obviously, created from a brush that is tied to an entity. You generally have more control over how the door is shaped and how it looks compared to a point-based door. Point-based doors, however, can have functioning opening hardware, such as handles, push bars, and keypads. They are, however, restricted to a select few models that may not be present in more modern titles, such as Portal 2.
Making the Doorway

To create a brush-based door, make a wall with a gap that the player can move through. See dimensions for sizing. To make a gap in the wall, use the Clipping Tool to create a separated section, then make a hole at the bottom of that section. Make sure to put a brush underneath the doorway or there will be a leak.

Creating the Brush Door
To create the actual door, create a brush that fills the hole in the doorway. It is recommended to make the door have a different texture to make it stand out against the wall.
Turning the Brush Into the Door
To turn the brush into a functioning door, select it and press ctrl+T. If you want a door that moves in a specified direction, select func_door then scroll down to the Move Direction property and set the value you want, or select up or down from the small dropdown. For a more traditional style door, select func_door_rotating. To make a func_door_rotating
rotate around a different point than the center, drag the origin helper in the 2D view or the blue sphere in the 3D view to the point you want it to rotate around.
Making a Button for Your Door
If you want your door to be toggleable, you need to create a func_button, or other entity that can activate and send an output, and set it to toggle the door open and close state. If you want a func_door_rotating
to move when the player +USE
es on the door, and also be able to open and close multiple times, you will have to create a button that moves with the door. First, name the door something like door1
. Then create a brush that envelops the door and tie it to a func_button
. Set the texture to something like a tools/toolsinvisible
and set the collision to not solid. Then, set its parent to the name you gave the door. When the door moves, so will it. Scroll down and set its reset time to 0. Then, go to the output tab. Create a new output and set it to this:
That should enable the door to be used multiple times.
If you are using a func_door
, it is better to use a trigger_multiple to automatically open and close the door when you approach it.
Create a brush with the

Avoiding Graphical Bugs
When using a func_door
, if it is the same width as the wall and moves into it, it will appear to phase in and out if the textures are different. The best way to avoid this is to scale down the width of the door and also to make a slot in the wall for where the door will slide into. This issue is not always present in func_door_rotating
as it does not completely submerge into the wall, unless specified, so it is not as important in that case but should still be taken into account.
Making Double Doors
To make two func_door
s or func_door_rotating
s open and close together, it is necessary to use a combination of Outputs and logic_relays. First, make two doors through the process stated above and name them accordingly (e.g., door1
and door2
). Second, add two logic_relay's somewhere near the doors (the location is not important, but it helps for organizational reasons to keep them close) and name them as well (e.g., door1_relay
and door2_relay
). Third, open the properties of the first door, go to the 'Outputs' tab, and add an output similar to the following:
Do this for the other door too, but change the Target Entity to door1
. What these outputs do is open one door when another one is opened (whether that be done via Touch, Toggle, a button, etc.). At this point, you could save and compile to test the doors out if you wanted, but they would only be able to open each other, not close each other. That is where the logic_relay's come in.
Now normally, you would think that you could repeat the process for closing the doors via Outputs (i.e., having one door be closed by the other), but such is not the case. If you try it out for yourself, you will find that the game crashes as soon as you go to close one of the doors. So, to work around this little bug, you need to introduce a logic_relay
for each door. If you've followed the above process so far, you should already have the two relays placed and named. Now, open the properties of the first door and add an output similar to this: :
door2_relay
. Next, open the properties for the first relay and add an output like so: :
My Output | Target Entity | Target Input | Parameter | Delay | Only Once |
---|
door1
. Now save and compile, and you should have a working set of double doors. <be> To help you understand this concept of Outputs and logic_relay's better, here is a little diagram for the above example: Player opens
door1
-->The opening of door1
triggers door2
to open via the Output of door1
Player opens door2
-->The opening of door2
triggers door1
to open via the Output of door2
Player closes door1
-->The closing of door1
triggers door1_relay
-->The triggering of door1_relay
triggers door2
to close
Player closes door2
-->The closing of door2
triggers door2_relay
-->The triggering of door2_relay
triggers door1
to close
My Output | Target Entity | Target Input | Parameter | Delay | Only Once |
---|