Tutorial: Making Rotating Gears Last edited 9 months ago2024-03-08 15:54:57 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 nonexistent, 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 entities

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:

Key Gear 1 Gear 2
Name Gear1 Gear 2
Global Entity Name (Blank) (Blank)
Render FX Normal Normal
Render Mode Normal Normal
FX Amount (Blank) (Blank)
FX Color 0 0 0 0 0 0
Pitch Yaw Roll 0 0 0 0 0 0
ZHLT Lightflags Default Default
Light Origin Target (Blank) (Blank)
Rotation Speed 20 20
Volume 10 10
Friction 20 20
Fan Sounds No Sound No Sound
WAV Name (Whatever WAV file you want) (Blank)
_minlight (Blank) (Blank)
X Y Z (Blank) (Blank)
Damage inflicted when blocked 500 500

Flags:

Flag Gear 1 Gear 2
Start ON
Reverse Direction
X Axis
Y Axis
Acc/Dcc
Fan Pain
Not Solid
Small Radius
Medium Radius
Large Radius

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.