Glass, you've all seen it in one form or another. Its a good way to detail maps because they make almost all indoor and urban environments look way more interesting than they actually are. If you want it in game, this tutorial will go over the three different types that you may encounter.
To get started, we will need a room with an info_player_start
, a light_environment
, and three "windowframes".
A block room and three window frames -- Awesome I know.
Bullet Proof Glass
Bullet proof glass is the most simple of all. If you're coming from Half-Life 1 mapping, this is now alot easier. You no longer need to manually add the texture
to define it's transparency. Now the transparency is built into the texture. (This tutorial will not cover how that is done)
In one of your frames, create a brush to fit it. Now, open up your textures tab and find a nice glass texture to put on it. For this panel, I have used glass/glasswindow070c
Your indestructable glass panel is now complete. It should render transparent inside hammer as well as in-game all by itself
without any entity work.
HL1 Style Breakable Glass
This is the style of glass that, once prompted to break, will shatter the entire pannel all at the same time
Now, fit another brush to your second window frame. Select the brush, and texture it with glass/glasswindow070c
once more. While it's selected, right click
and Tie to Entity
. Choose the dropdown box and find func_breakable
. Once again, the glass will appear transparent all by itself so you do not have to change the render type/amount.
Important Properties Related to Glass:
- Name : (Whatever you want.) : Name this field if you plan on triggering this glass to break later by an outside trigger.
- Performance Mode : Normal/None/Reduced : This determines the amount of glass that flies through the air as soon as the pannel is 'shattered'.
- parent : (The name of something that moves.) : Name a moving object if you plan on having the glass move with the object.
- Prop Data : Glass.Window : Glass.Window is the most appropriate here. This decides how your window acts.
- Strength : (Any number that's 0 and above. No negatives. Ill use [val]1)[/val] : This is the amount of damage your glass can take before shattering. 0 makes it invincible. (Useful in triggering the glass to break rather than the player shoot and break it.)
- Material Type : Glass : This determines the sound that the 'glass' will make upon being attacked.
- Min Damage to Hurt : (Any number greater than 0) : This allows you to render certain weapons useless agaist your window. For instance if you want it to be destroyed by specifically explosives.
- Only Break on Trigger : Renders all attempts to break the glass useless unless triggered to break.
- Break on Youch : The glass will break when you walk on/touch it.
- Break on Pressure : The glass will break under "strain" by physics or any object massive enough to break it.
- Break Immediately on Physics : If anything involving physics touches the glass, it will break.
- Dont Take Physics Damage : Nothing involving physics will harm the glass.
- Dont Allow Bullet Penetration : Bullets (by default) will pass through this glass to cause damage to things on the other side. This prevents that.
Now, if you've set this up correctly, this glass will break upon taking the amount of damage that you've set as the strength
. My value of 1
will cause the glass to break if hit or shot by anything
. Once the glass breaks, no trace of the glass will be left on the edges of the frame. It breaks off 'cleanly'.
Location Based Glass
This is the type of glass that will break off in chunks and peices rather than the entire thing at a time. This type of glass is sometimes annoying to set up depending on what you want.
Start by fitting the third frame with a brush. This brush should not be intersecting or overlapping with ANY surrounding brushwork or it will mess up. This brush should also be only 1
unit thick as this type of glass does not like anything thicker. This type of glass is also picky as to how it should be textured. Texture all 6 sides to the texture tools/toolsnodraw
. Now, texture specifically
one of the viewable sides of this brush to glass/glasswindowbreak070a
. Note: This is the only texture equipped to break in a peice-style manner. No other textures should work
. It is also important to note that both
sides of this glass will show the texture rather than just the side you textured.
Now, rather than Func_breakable
, choose the dropdown box and set it as a Func_breakable_surf
. The only notable changes from the func_breakable
from earlier is the property name change from strength
, the addition of the surface type
field, and the addition of the fragility
Set Material Type
and Prop Data
as earlier and set the Surface type
. Also, set the Fragility
. The Fragility
field determines how "fragile" the glass is. It decides how much glass will chunk off at a time. The higher the value, the more prone the glass is to shatter all at one time.
Once you shatter this type of glass, there are peices of broken glass stuck to the frame after it is destroyed. This is the 'unclean' breakoff. Also, do not place two of these planes of glass next to eachother without a border. If you do, the broken frame shards of glass will not appear.
Don't place surf glass next to eachother. You should now have an awesomely boring room with 3 panels of glass. ;o
Now, you should know how to create 3 flavors of glass. Use them. As mentioned earlier, they make almost any space more interesting. It does not make this space more interesting. This example map is very lame.
Note that I am not using the same texture used in this tutorial. This is because I can't choose it from my list of textures, how can I make it available?
As a compromise, how can I cut a little hole in the window to make it loook broken.
Awesome tutorial by the way =)
Rejecting func_breakablesurf. Has multiple faces that aren't NODRAW.
but all the faces are nodraw except the front