triggering a fan

If you're looking for mapping help or you reckon you're a mapping guru, post your questions / solutions here

Moderator: Moderators

Post Reply
User avatar
MxPxpunk
Lance Corporal
Posts: 20
Joined: Fri Sep 12, 2003 4:12 pm

triggering a fan

Post by MxPxpunk »

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."
User avatar
bdbodger
Moderator
Posts: 2596
Joined: Tue Feb 25, 2003 7:34 am
Location: canada
Contact:

Post by bdbodger »

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
User avatar
MxPxpunk
Lance Corporal
Posts: 20
Joined: Fri Sep 12, 2003 4:12 pm

Post by MxPxpunk »

its all clear except for the trigger multiple where on the helicopter do i put it. oh and where do i put the script text in the .scr file, after level waittill spawn?
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."
TheStorm
Captain
Posts: 233
Joined: Mon Oct 07, 2002 7:45 am
Location: Gavle, Sweden
Contact:

Post by TheStorm »

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.

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!
TMT admin, visit www.modtheater.com
HITP Lead Mapper
Member of Electronic Arts MOHteam
User avatar
MxPxpunk
Lance Corporal
Posts: 20
Joined: Fri Sep 12, 2003 4:12 pm

Post by MxPxpunk »

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."
TheStorm
Captain
Posts: 233
Joined: Mon Oct 07, 2002 7:45 am
Location: Gavle, Sweden
Contact:

Post by TheStorm »

Give it a different target name and then just add it to the script

$myfan rotatey local.i
$myfan1 rotatex local.i
TMT admin, visit www.modtheater.com
HITP Lead Mapper
Member of Electronic Arts MOHteam
Post Reply