WiseLighthouse: Light House
This tutorial was originally created by wisemx. It was originally posted on SDKnuts.net.
This isn’t difficult at all and it’s not going to be a step by step tutorial because you should be able to download the file at the bottom of this page and load the source vmf in Hammer then use this example for your own purposes.
The lighthouse model used in this tutorial is only for appearance and it’s actually two SDK prop_static
entities with the following World models:
- models\props_wasteland\lighthouse_fresnel_light_base.mdl
- models\props_wasteland\lighthouse_fresnel_light.mdl
The two models placed over each other give the appearance of the center light assembly from a lighthouse. Only one property needs to be changed, for the model that is the fake light change Collisions to Not Solid. You can also do this for the light base if players will not be around it.
Now we’ll put our rotating spot lights in there.
First create a small block with the brush tool and tie it to entity func_rotating
.
- Name: LightBase
- Parent: Blank - Do not parent this!
- Origin: Give it the orientation you need, for this example it’s “-25.07 23.5 -590”
- Pitch Yaw Roll: 0 0 0
- Disable Shadows: No
- Max Rotating Speed: 100
- Friction: 20
- Rotating WAV Sound: None, we’ll use external sound
- Flags: Start on
For the sound we’ll use an ambient_generic
and place it where it’s needed, where the player will be.
- Sound Name: npc/roller/mine/rmine_moveslow_loop1.wav
- Adjust the Flags for your needs, the only one checked for this example is Play Everywhere, but that’s because the example map is small.
Now create two point_spotlight
entities, these are the lights and to save on system resources we’re going to turn off dynamic lighting for these.
- Parent: LightBase
- Pitch Yaw Roll: “19 358 0” and “15 170 0” in this example, a slight downward angle.
- Spotlight Legnth: 500
- Spotlight Width: 50
- Color: “250 248 143”
- Flags: Start on, No Dynamic Light
Place your two point_spotlight
s at each end of the func_rotating
and you’re done.