triggering a fan
Moderator: Moderators
triggering a fan
I was wondering if there was a way to make a one time use of a trigger to start a fan, i am using it as a helicopter blade and i already know how to make a fan. i am using the non-scripted way and im not sure if i can do it with out a script. my first attempts were unseccessful because it stop the already spinning blades. how do i start the map with them not moving but still be able to turn them on? i targeted both propelers and added a trigger for both but i cant figure out how to make it work.
IMPATIENCE with society
BE WHAT they want you to be
IMPATIENCE, "There is no future here"
"I'm not lazy, I just don't care."
BE WHAT they want you to be
IMPATIENCE, "There is no future here"
"I'm not lazy, I just don't care."
You will need to do it with script . Make a trigger_multiple give it the Key: setthread Value: mythread . In your level script put this thread
mythread:
self remove // removes the trigger
$myfan rotatey 360 // set rotation speed here
end
you can even get them to start slow and then speed up
mythread:
self remove // removes the trigger
$myfan rotatey 90 // set rotation speed here
wait 5
$myfan rotatey 180
wait 3
$myfan rotatey 360
end
mythread:
self remove // removes the trigger
$myfan rotatey 360 // set rotation speed here
end
you can even get them to start slow and then speed up
mythread:
self remove // removes the trigger
$myfan rotatey 90 // set rotation speed here
wait 5
$myfan rotatey 180
wait 3
$myfan rotatey 360
end
If you want to turn it off and on use a trigger_use, place the trigger where you want the player to press use....maybe where the pilot are supposed to sit. Give the trigger key/value setthread/mythread and key/value targetname/yourtriggername
Then some where in the begining of your level scr file add this
level.helibladespinn = 0
then this should be the mythread and I've used somthing similar to bdbodger.
I have not checked the code for spelling errors and stuff, it should basically work!
Then some where in the begining of your level scr file add this
level.helibladespinn = 0
then this should be the mythread and I've used somthing similar to bdbodger.
Code: Select all
mythread:
$yourtriggername nottriggerable
if (level.helibladespinn == 0)
{
$myfan loopsound yoursound // if you have a sound or else skip this
for (local.i=10;local.i < 360;local.i = local.i +10)
{
$myfan rotatey local.i
wait 0.2 // Adjust this so it increases speed in the rate you want
}
level.helibladespinn = 1
}
else
{
for (local.i=360 ;local.i > 0;local.i = local.i - 10)
{
$myfan rotatey local.i
wait 0.2 // Adjust this so it decreases speed in the rate you want
}
level.helibladespinn = 0
$myfan stopsound
}
$yourtriggername triggerable
end
I have not checked the code for spelling errors and stuff, it should basically work!
ok cool, thanks. for the rear propeller of the chopper, it rotates on x, should i have a sepparate trigger/thread or shoud i have two targets for the one trigger and just add the script for the first propeller but change the targetname and rotatey to rotatex.
IMPATIENCE with society
BE WHAT they want you to be
IMPATIENCE, "There is no future here"
"I'm not lazy, I just don't care."
BE WHAT they want you to be
IMPATIENCE, "There is no future here"
"I'm not lazy, I just don't care."