Download example file: Download
I'm going to show you a way to make functioning gears for your maps. Whether for aesthetic background detail or a neat effect for a player interactive object, its pretty cool to see them work.
Building the gear
To start you need a cylinder. I used 8 sides but you could increase the side count if you want. The gear I'm going to make is going to be pretty big.
Now to add teeth to the gears. You can do sharp points, which is common in small machinery like clocks where the top land of the gear is nonexistant, or large bit cut teeth whose top land is greater. The top land of a gears tooth is the space given at its end (The point that contacts a connecting gear). I choose to use moderate sized to larger teeth for aesthetic purposes, it looks like the machinery has a lot of power behind it.
Place down a block, making sure that a portion of it sits inside the gear body and that a fair amount protrudes out from it. Then clip the edged off the sides to form your tooth.
Now take and copy that tooth and rotate it to fit on all 4 sides. Then grab all those teeth and copy them as a whole, and hold shift to lock rotation and rotate them 45 degrees and center them on the gear body.
Now you should have a sexy looking gear. Slap some rust or a metal texture on it to make it look cooler.
Now place another block in the center of the gear. Paint it with the origin texture, and then select everything making sure to select your origin painted block last!
Then right click and create entity func_rotating
Now take the gear and make a copy of it and position next to the first gear. You want the second gear to be spaced and both gears to be rotated so they mesh together properly. You may have to play around with this some. You notice that my gear teeth are not touching, this is because when compiled they end up touching during gameplay.
Setting up the entites
Now that you have the gears built and positioned, it's time to program them. I'm going to program these to be on when the map starts, but you can use a multi_manager
to do more neat effects using a button or some other trigger.
Here are the settings I used:
|Key||Gear 1||Gear 2|
|Global Entity Name||(Blank)||(Blank)|
|FX Color||0 0 0||0 0 0|
|Pitch Yaw Roll||0 0 0||0 0 0|
|Light Origin Target||(Blank)||(Blank)|
|Fan Sounds||No Sound||No Sound|
|WAV Name||(Whatever WAV file you want)||(Blank)|
|X Y Z||(Blank)||(Blank)|
|Damage inflicted when blocked||500||500|
|Flag||Gear 1||Gear 2|
A different set of gears I made for a different project.
- The second gear (or every even numbered gear in the chain) has to have the Reverse Direction flag checked.
- If you want your gears upright on the wall make sure to adjust the flags so either X Axis or Y Axis is checked based on the plane those gears set on in the editor. So if your gears are in full profile on the side (x/z) plane in Hammer, check the X Axis flag and check the Y Axis flag if your gears are full profile in the front (y/z) plane.
- Seriously look in to using multi_manager to drive your gears using a button or scripted sequence. It adds a really neat effect when the player can interact with them.