FAKK2 Editing
/ home / game - view / fakked.ritual.com / tutorial05

Ok, in today's tutorial I will go over how to make a fan rotate in your level. By the end of this tutorial you should feel comfortable about trying out many other script commands to make much more interesting machinery, etc, than simple fans.

The above image when clicked will display a larger version of my desktop. You will see I have FAKK2 running my tutorial05 level. In the foreground is the script I had to write to make the fan rotate. First off, let me list the pieces required to make a functional fan.

1.      A fan object constructed out of patches (curves) or brushes

2.      That same object to be turned into a script object

3.      After it is turned into a script object, you need to assign it a targetname that will allow you to control it through script commands

4.      A script file with the same name as your level.

5.      Last, copy the below code into a blank document window to save as your script file.

start: //start of script file

thread fan_rotates //call and execute this thread below

waitForPlayer //wait for the player to be ready

///////////////////

fan_rotates: //A label for the chunk of script code that will be executed

///////////////////

$fan rotateY 30 //"$fan" equals the name of the entity I wish to control through script commands

//"rotateY" is the script command that is being applied to the "$fan" entity

//"30" is the speed in which the rotation occurs

///////////////////

//terminate execution of the "fan_rotates" thread

///////////////////

//end of script file

I'm going to be lazy and hope you read the first tutorial, which dealt with the basics of FAKK2 scripting rather than explain all the pieces here. It is also commented so hopefully it is self-explanatory. However, if you have questions don't hesitate to e-mail me.

Note: you may be wondering how the fan actually looks like a fan blade when in the editor all the pieces are rectangular blocks. The texture applied is actually a shader which determines which areas of the fan blade to render and not render. Thus, the rectangular brush actually has parts that render invisible due to the shader and gives it the fan blade shape.

-BrushBoy