Tutorial: Making Rotating Gears Last edited 4 months ago2020-04-07 04:44:39 UTC

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.
User posted image
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.
User posted image
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.
User posted image
Now you should have a sexy looking gear. Slap some rust or a metal texture on it to make it look cooler.
User posted image
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.
User posted image
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.
User posted image

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:

Class info:

KeyGear 1Gear 2
NameGear1Gear 2
Global Entity Name(Blank)(Blank)
Render FXNormalNormal
Render ModeNormalNormal
FX Amount(Blank)(Blank)
FX Color0 0 00 0 0
Pitch Yaw Roll0 0 00 0 0
ZHLT LightflagsDefaultDefault
Light Origin Target(Blank)(Blank)
Rotation Speed2020
Volume1010
Friction2020
Fan SoundsNo SoundNo Sound
WAV Name(Whatever WAV file you want)(Blank)
_minlight(Blank)(Blank)
X Y Z(Blank)(Blank)
Damage inflicted when blocked500500

Flags:

FlagGear 1Gear 2
Start ONCheckedChecked
Reverse DirectionUncheckedChecked
X AxisUncheckedUnchecked
Y AxisUncheckedUnchecked
Acc/DccUncheckedUnchecked
Fan PainUncheckedUnchecked
Not SolidUncheckedUnchecked
Small RadiusUncheckedUnchecked
Medium RadiusCheckedUnchecked
Large RadiusUncheckedUnchecked

Video demonstration

A different set of gears I made for a different project.

Additional notes

Comments

You must log in to post a comment. You can login or register a new account.