Making a Dynamic Light


Let's Make a Dynamic Light

First create your map,then have a spot where you want your light to hang and swing around at.

Then find the model you want to use for the light. My example is using the prodigy hanging light
"props/de_prodigy/lighthanging.mdl " , place the model in your map where you want it to hang.
Use the "prop_physics_multiplayer" entity for the model and then you will have to name it
something. Let's say "hang_lamp01" . (I find it good to number them with mulitiple lights in map)

There will be a few more entities needed to make it swing and also give off some light.
Let's start with the
"phys_ballsocket" ,place this at the top of model entity, where model will
look like it attaches to a wall in map. you don't have to name it , but you do have to select the
Entity 1 parameter and then put in the name of your model. There are a few shortcut ways to do
this. you can select the dropdown arrow and pick name from list or click on the eyedropper and
click on the model in the 3d view.....or just type it in. (see image).

Thats it for the hanging and swinging part of the light.
now let's make it give off some light and have the light swing with the light model.

Hit the Entity Tool and select the "light_dynamic" entity. Place it at the bottom of the model
where the light bulb is at in the model. Now you will have to Parent the light_dynamic entity to the
model. Highlight parent parameter and pick the "hang_lamp01" entity. Also make sure the down
angle is selected.In this entity you can select from the different options as which the light will be emitted.
(Color,brightness,inner and outer angles of the light,pitch,distance the light will emit).
You'll have to play with settings to get it the way you want it.(The important part is the parenting).

The next entity is the "point_spotlight" entity. Select entity tool and place the point_spotlight just below
your light_dynamic entity. Then again just like the others Parent it to the model "hang_lamp01".
(using one of the 3 methods discussed earlier)
Make sure to set the angle to down like in the image seen below. Also you can set the length,width & color
of the light.
Under the flags tab of properties window,make sure it's checked for Start On.

Try compiling and see how it works.
Some Images below of how the Entity look set up in Hammer Editor.
First one is Entities apart from each other (so you can see them seperately)

Second image is how the Entites should be aligned so they look right together when in map.

Also last but not least is the nodraw textured brush you see in all images. Put one of these brushes
above your light (on ceiling) and make it into a "func_brush" and name it. This will stop the light
from swinging up into the ceiling and just plain ol' looking stupid in game. It's easy to forget so Don't.