VERC: Doors With Glass Last edited 2 years ago2022-09-29 07:54:32 UTC

Introduction

How do I make a moving door with transparent glass sections? This is a fairly common question. The short answer is, you make two doors (one for the frame and one for the glass) and trigger them to act together. If that's enough for you to go on, great! Otherwise, read on.

Setup

A door with a glass section is obviously composed of two parts: the solid door frame, and one or more sections of transparent glass. These two parts must act together to appear as one object. This is done by making the two parts triggerable only, and then activating them both with one trigger. Further complicating the situation, you can have a rotating door with a glass section, or a normal sliding door with a glass section. Both of these use different concepts. We'll look at the rotating door first.

Rotating Door with Glass

For this example, I've used the FIFTIES_DR8 door texture. I've cut out the window part (which is black in the texture) and replaced it with the GLASSGREEN texture. Below are three pictures showing the sequence of creation.
User posted image
User posted image
User posted image
The first picture is the main solid door frame part. It is a normal func_door_rotating rotating door. Note its origin brush - the greenish textured brush on the lower right of the object. This door is setup just like any other func_door_rotating. The things that need to set for this are Name (targetname) - for this example I've used rdoor1. The rest can be left at the default settings (make sure you click on each one in the entity properties so the default is saved to the .map).

Picture #2 shows the door with the glass section in place. Note its origin brush right beside the glass section. The properties of this should exactly mirror the properties for the normal door, above, with the following additions. The Render Mode (rendermode) should be set to Texture (2), and the FX Amount (renderamt) should be set to 96. This will make the glass section transparent.

Picture #3 in the sequence of three shows the door with its trigger (a trigger_multiple) in place. Walking into the trigger will cause the door to open. Its Target (target) is set to door1, and its Delay before reset (wait) is set to 1.
For more information on the func_door_rotating entity, refer to its description. For more information on creating transparency, see the Glass and Transparency article.

Sliding Door with Glass

The other type of door would be a sliding door. For this example, i've used the OUT_W1DR1 door texture. As above, I've used the GLASSGREEN texture for the glass. Again, below is a sequence of three pictures showing the creation process.
User posted image
User posted image
User posted image
Picture #1 shows the solid door frame. It's a normal func_door. It's modified settings are: the Name (targetname) is set to door1. Its Lip (lip) value is set to 4. This ensures that the door doesn't slide complete into the wall. (Don't forget to set the angle as well.)

Picture #2 shows the glass section of the door in place. As with the rotating example, its setup exactly the same as its solid counterpart, except for the following additions and tweaks. First, setup the rendering modes as was outlined in the rotating door description, above. Next, you need to determine the Lip (lip) value. Since the glass section is not the same width as the frame section, you cannot use the same value for both. Below is a picture (a top view from Worldcraft) of the door in its closed and open state.
User posted image
In the picture above, the object on the left is the door in its closed state, the one on the right the open state. The purple sections are the solid door frame, the red sections are the glass areas. Notice how there is a 16 unit gap between the red (glass) objects. This is how you determine the lip value. Since there is a gap between the glass sections rather than them overlapping, the lip value will be negative. So, for the glass func_door, use a Lip (lip) value of -16.

Picture #3 in the sequence of three shows the trigger in place. As with the rotating door example, this is a trigger_multiple. Its Target (target) is set to door1, and its Delay before reset (wait) is set to 1.
For more information on the func_door entity, refer to its description.

Notes

So, to go over the basic concept once more - Regardless of whether you're using a rotating door or a sliding door, its the same basic principle. You'll have a solid door frame and a glass section. Both of these will have the same name, and both of these will be opened by the player walking through a trigger_multiple that acts as the door's "open" field.

Example

For a more concrete illustration, check out the example map linked below.
This article was originally published on Valve Editing Resource Collective (VERC).
The archived page is available here.
TWHL only publishes archived articles from defunct websites, or with permission. For more information on TWHL's archiving efforts, please visit the TWHL Archiving Project page.

1 Comment

Commented 11 months ago2024-01-13 00:20:03 UTC Comment #105869
I discovered a trick with using User posted image BOUNDINGBOX brush which eliminates the lip math. You make it the same width as the main door and tie it to the glass part. No messing with lip value for the glass door; use the same value as the main door.

You must log in to post a comment. You can login or register a new account.