Tutorial: Fans Last edited 4 years ago2019-04-22 05:01:26 UTC

You are viewing an older revision of this wiki page. The current revision may be more detailed and up-to-date. Click here to see the current revision of this page.
Download attachment

Fans are an obvious application of the func_rotating entity, and combined with various other bits and pieces, you can create some interesting ones for your maps.

Build a Fan

The first thing we need to do is create a fan solid. It's actually pretty easy to get everything aligned and properly angled. Start with a single blade: create a rectangular brush, then clip it to form a flat blade shape (1). Use the transform tool (Ctrl+M) to rotate the blade around its longer axis. To find out which axis that is, look at the window you would like the rotation to be visible in. In the example map, with the fan facing forward, this is the top view (x/y). The axis is the letter not in the view's name. In this case, z. So, rotate the blade about 30? on the z axis (2). Now shift-drag the blade twice, rotate one 120? and the other -120? on their x axes. Then arrange the three blades and place a shaft in the middle (3).
Construction of the fanConstruction of the fan

Make it Go

Now we need to make it spin. Entities that rotate, like our fan, need a point around which they should move. This is called the origin, and you create that point by placing an 'origin brush' into the entity. An origin brush is simply a solid that has the texture called 'origin' on all its faces. So to create one, select the 'origin' texture, and create a block that runs through the axis of rotation. In our case, we want a block that has a centre-point the same as the centre of our shaft when we look at it from the front view. It can be any size, but its front-view centre-point must be in the middle of the shaft. Ctrl-select all the solids, including the origin, right click and select Tie to Entity. Select func_rotating and set the following attributes:

Name: fan
Rotation Speed: 650
Friction: 3
Fan Sounds: Fast Beating

Experiment with the speed, friction and sound settings. On the Flags page, tick X Axis, which sets the axis to rotate around. You can work this out using the same view-name method I've already described. Also tick Acc/Dcc. This makes the fan accelerate and decelerate when it is turned on and off. It combines with the Friction property which is used to work out how fast to slow down / speed up. Experiment with the other properties - most of them are self-explanatory.
The origin brushThe origin brush

The Trigger

We now need to be able to trigger the fan on and off. To do this, create a brush, tie it to a func_button entity, and set its Target to fan. Then, in the flags sheet, set Don't move (which prevents the button from physically moving) and Toggle (which allows the player to switch the target on and off at will) on.

The Push

If you run the map at this point, the fan should work fine. But let's add something more interesting - a push effect that makes it appear as if the fan is creating a lot of wind. This is easy to create. Start by building a block that covers the whole area you want to be affected. Tie this to a trigger_push entity, set its Name to fan, Speed of push to something like 250 and turn the Start Off flag on. The compass needs to be at 180? in the example map so that the push happens in the right direction. Now the player will be pushed away from the fan, whenever the fan is on!

And Some More...

In the example map, I created an ambient_generic entity, also called fan. With a Dynamic Presets value of Fade in, the sound is nicely synchronized with the fan's spin up. If you've set a sound for the fan, this isn't really necessary, but I intended it to sound like the hum of the motor, which I created complete with heat sinks and power lines, just to add interest. By the way, the trigger_push entity can also be used in other directions, for, say, vertical fans and those alien jump-pads.
The finished productThe finished product

2 Comments

Commented 13 years ago2011-03-16 21:48:24 UTC Comment #100483
I made a giant one for a rats map, but when i crouch under something the fan kills me...
Help ?
Commented 12 years ago2011-08-10 11:19:01 UTC Comment #100484
Set the "damage inflicted when blocked" to 0

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