Snarkpit Articles


I was working on a "government agency" map and wanted it to look as good as possible (naturally). Stereotypically these places would have glass. Lots of glass. Including glass doors. So I set about to working on it and it turned out to be harder than I thought...so on the off-chance that you want glass doors too, I thought I'd post my findings.



Two Kinds Of Doors: All glass and partly glass.

The door that's partly glass is a little easier to make. This would be like a metal frame with a glass section in the middle.

1) Create brushes of everything you are going to need. This means a) Frame, b) Glass, c) Door Knob(s).

2) Tie the Frame to a func_door or func_door_rotating. Either will work. The settings here don't really matter, but you'll have to give it a name.

3) Tie the Glass to a func_breakable or a func_breakable_surf. In my opinion the breakable surface looks much better, but then it always does, heh. Try both. Set the Glass's parent to the Frame. Give it a name.

4) Tie the Knob(s) to a func_breakable. Set the Knob(s) parent to the Frame. Give it a name.

5) For each Knob you have, create a phys_convert and name it. phys_convert: "Turns an arbitrary entity into a physically simulated entity. i.e. brush entities will behave like func_physbox, model entities behave like prop_physics". Set the Entity to convert to the Knob it's for.

6) Select the Glass again. Add an output, linked to the OnBreak of the Glass and targetting the phys_convert from step 5. Set Target Input to ConvertTarget. Repeat this for each phys_convert there is.

That's it! There's your partially-glass door!

All Glass Door:
This is the same as above, except instead of a door frame you need to have a brush painted with the Invisible texture that overlaps the Glass a little (like one pixel). It should have all the same door properties. Actually, the flag Passable should be checked. This makes it so that bullets and players can pass right through the door (the glass part will stop them, though).



Now, for the glass, it should have the same Outputs as before, but add an output that destroys the invisible door when the glass is destroyed. Be sure you add a delay...say half a second (the delay is because the knobs are parented to the invisible door, and if the invisible door is destroyed before the knobs are cut loose the knobs are destroyed along with the door). Destroying the invisible door isn't exactly necessary, but cleaning up entities that don't serve any further purpose is a good practice to maintain.

Known bug: the knobs in this case are easy to get stuck on. If there was some way to set their Debris flag to true this would really help, but I know of no such way. The best suggestion I have would be either to choose a shape that the player wouldn't get caught on, or just leave it the way it is.


Post ReplyView Topic
Discussion
0 starsPosted by Sgt. Redneck on Wed Aug 31st 2005 at 4:02am

A little hard to follow steps. Usefull tut. Perhaps more screenshots.
0 starsPosted by boots on Tue Feb 22nd 2005 at 9:50am

Post ReplyView Topic