MrZig 0 Posted February 18, 2004 Hi, I have made a tail rotor script and it looks like it's done! I wish there was an explosion "sound" when the helicopter hit the ground, so I made a sound effect and made it play, but I have nowhere to host it so you'll have to make one yourself if you want it Thanks to Vektorbrossen, (SP?) I was able to implement his random crew killing into my script, I take no credit for that, and I forget who made that fire script that I used, but I also take no credit for that, as I hate drop commands Anyways, here you go: Exec with [heli,true,4] exec "rotor.sqs" Heli being the heli, true is if you want random kills or not, and 4 is max number of kills <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">;;----------------------------------------- ;;[heli,true,2] exec "rotor.sqs" _heli = _this select 0 _ox = 0 _oy = -9.5 _h = 0 _size = 2 ;;----------------------------------------- _speedX = velocity _heli select 0 _speedY = velocity _heli select 1 _driver = driver _heli _heli setfuel 0 _random = true _maxkills = 4 ?count _this == 2: _random = _this select 1; _maxkills = 4 ?count _this == 3: _random = _this select 1; _maxkills = _this select 2 _driver sidechat "Mayday! Mayday! This is Rescue 1, our Blackhawk is going down! I repeat, our Blackhawk is going down! Requesting backup! Mayday!" #loop ~0.001 _param=(random 3)*_size ?(_param>1.5):_param=random 2.5 ?(_param<0.95):_param=0.95+_param ?(_size<1):_param=random 0.75 ? (speed _heli)>15:_param=_param/2 _heli setvelocity [_speedX,_speedY,-14] _height = getpos _heli select 2 _dir = getdir _heli _heli setdir (_dir) +5.5 ?getpos _heli select 2 <= 1 : goto "loop2" drop ["cl_basic", "", "Billboard", 1, 3*_param, [_ox+ random (0.25*_size) - random (0.25*_size) ,_oy+ random (0.25*_size) - random (0.25*_size) ,_h], [random 0.3-random 0.3, random 0.3-random 0.3,random 0.3], 1, 0.004, 0.004, 0.1, [random (1.25*_size), random (1.5*_size),random ( 2*_size),random (2.5*_size)], [[0.1,0.05,0,0.4],[0.05,0.025,0,0.25],[0,0,0,0.1],[0,0,0,0]], [0,1,0], 0.5, 0.05, "", "", _heli] goto "loop" #loop2 _dir = getdir _heli _heli setvelocity [0,0,-10] _heli setdir (_dir) +5.5 #explo _c = 50 _size = [2, 5] _size1 = [2, 15] _lifetime = 3 _step = 360 / _c _i = 0 #11 _Explosion = GetPos _heli _cx = _Explosion select 0 _cy = _Explosion select 1 _cz = _Explosion select 2 _vel = [sin(_i * _step)*(random 15-random 15), cos(_i * _step)*(random 15-random 15), random 20] _vel1 = [sin(_i * _step)*7.5, cos(_i * _step)*7.5,random 5-random 15] ?_cz<1:drop ["cl_basic", "", "Billboard", _lifetime, _lifetime, [_cx, _cy, 0.5], _vel, 0, 1, 0.157, 0.001, [5,7.5,10,15], [[0.05,0.025,0,0.3],[0.05,0.025,0,0.3],[0,0,0,0.3],[0,0,0,0.1]],  [0], 0.1, 0.2, "", "", ""];_debri="FxExploGround2" camcreate [(getpos _heli select 0)+random 1-random 1,(getpos _heli select 1)+random 1-random 1,_cz];_debri setvelocity [random 25-random 25, random 25-random 25, random 50];_debriA="FxExploGround1" camcreate [(getpos _heli select 0)+random 1-random 1,(getpos _heli select 1)+random 1-random 1,_cz];_debriA setvelocity [random 25-random 25, random 25-random 25, random 25] ?_cz>=1:drop ["cl_basic", "", "Billboard", _lifetime, _lifetime, [0,0,0], _vel1, 0, 0.2, 0.157, 0.001, [5,7.5,10,15], [[0.05,0.025,0,0.3],[0.05,0.025,0,0.3],[0,0,0,0.3],[0,0,0,0.1]], [0], 0.1, 0.2, "", "", _heli];_debri="FxExploGround2" camcreate [(getpos _heli select 0)+random 1-random 1,(getpos _heli select 1)+random 1-random 1,_cz];_debri setvelocity [random 25-random 25, random 25-random 25, random 50];_debriA="FxExploGround1" camcreate [(getpos _heli select 0)+random 1-random 1,(getpos _heli select 1)+random 1-random 1,_cz];_debriA setvelocity [random 25-random 25, random 25-random 25, random 25] _i = _i + 1 ?(_i < _c) : goto "11" #crew ?!_random: goto "run" _crew = crew _heli _c = count _crew _i = 0 _kills = 0 #crew2 _unit = _crew select _i ?random 1 > 0.8 && _unit != player: _unit setdammage  (random 1) ?random 1 > 0.8 && _unit != player && _kills < _maxkills: _unit setdammage 1; _kills = _kills + 1 _i = _i + 1 ?_i < _c: goto "crew2" #run _crew = crew _heli ?!Alive _heli : exit _heli setdammage .95 {unassignvehicle _X} foreach _crew {_X setbehaviour "aware"} foreach _crew ?player in _crew : titletext ["Is everyone OK!?","plain"] exit Share this post Link to post Share on other sites
aook002 0 Posted February 19, 2004 Hi Mr Zig, Just checked out your script. Seems good  <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">;;----------------------------------------- ;;[heli,true,2] exec "rotor.sqs" _heli = _this select 0 _ox = 0 _oy = -9.5 _h = 0 _size = 2 ;;----------------------------------------- _speedX = velocity _heli select 0 _speedY = velocity _heli select 1 _driver = driver _heli _heli setfuel 0 _random = true _maxkills = 4 ?count _this == 2: _random = _this select 1; _maxkills = 4 ?count _this == 3: _random = _this select 1; _maxkills = _this select 2 _driver sidechat "Mayday! Mayday! This is Rescue 1, our Blackhawk is going down! I repeat, our Blackhawk is going down! Requesting backup! Mayday!" #loop _param=(random 3)*_size ?(_param>1.5):_param=random 2.5 ?(_param<0.95):_param=0.95+_param ?(_size<1):_param=random 0.75 ? (speed _heli)>15:_param=_param/2 _heli setvelocity [_speedX,_speedY,-14] _height = getpos _heli select 2 _dir = getdir _heli _heli setdir (_dir) +5.5 ~0.001 ?getpos _heli select 2 <= 1 : goto "loop2" drop ["cl_basic", "", "Billboard", 1, 3*_param, [_ox+ random (0.25*_size) - random (0.25*_size) ,_oy+ random (0.25*_size) - random (0.25*_size) ,_h], [random 0.3-random 0.3, random 0.3-random 0.3,random 0.3], 1, 0.004, 0.004, 0.1, [random (1.25*_size), random (1.5*_size),random ( 2*_size),random (2.5*_size)], [[0.1,0.05,0,0.4],[0.05,0.025,0,0.25],[0,0,0,0.1],[0,0,0,0]], [0,1,0], 0.5, 0.05, "", "", _heli] goto "loop" #loop2 _dir = getdir _heli _heli setvelocity [0,0,-10] _heli setdir (_dir) +5.5 #explo _c = 50 _size = [2, 5] _size1 = [2, 15] _lifetime = 3 _step = 360 / _c _i = 0 #11 _Explosion = GetPos _heli _cx = _Explosion select 0 _cy = _Explosion select 1 _cz = _Explosion select 2 _vel = [sin(_i * _step)*(random 15-random 15), cos(_i * _step)*(random 15-random 15), random 20] _vel1 = [sin(_i * _step)*7.5, cos(_i * _step)*7.5,random 5-random 15] ?_cz<1:drop ["cl_basic", "", "Billboard", _lifetime, _lifetime, [_cx, _cy, 0.5], _vel, 0, 1, 0.157, 0.001, [5,7.5,10,15], [[0.05,0.025,0,0.3],[0.05,0.025,0,0.3],[0,0,0,0.3],[0,0,0,0.1]],  [0], 0.1, 0.2, "", "", ""];_debri="FxExploGround2" camcreate [(getpos _heli select 0)+random 1-random 1,(getpos _heli select 1)+random 1-random 1,_cz];_debri setvelocity [random 25-random 25, random 25-random 25, random 50];_debriA="FxExploGround1" camcreate [(getpos _heli select 0)+random 1-random 1,(getpos _heli select 1)+random 1-random 1,_cz];_debriA setvelocity [random 25-random 25, random 25-random 25, random 25] ?_cz>=1:drop ["cl_basic", "", "Billboard", _lifetime, _lifetime, [0,0,0], _vel1, 0, 0.2, 0.157, 0.001, [5,7.5,10,15], [[0.05,0.025,0,0.3],[0.05,0.025,0,0.3],[0,0,0,0.3],[0,0,0,0.1]], [0], 0.1, 0.2, "", "", _heli];_debri="FxExploGround2" camcreate [(getpos _heli select 0)+random 1-random 1,(getpos _heli select 1)+random 1-random 1,_cz];_debri setvelocity [random 25-random 25, random 25-random 25, random 50];_debriA="FxExploGround1" camcreate [(getpos _heli select 0)+random 1-random 1,(getpos _heli select 1)+random 1-random 1,_cz];_debriA setvelocity [random 25-random 25, random 25-random 25, random 25] _i = _i + 1 ?(_i < _c) : goto "11" #crew ?!_random: goto "run" _crew = crew _heli _c = count _crew _i = 0 _kills = 0 #crew2 _unit = _crew select _i ?random 1 > 0.8 && _unit != player: _unit setdammage  (random 1) ?random 1 > 0.8 && _unit != player && _kills < _maxkills: _unit setdammage 1; _kills = _kills + 1 _i = _i + 1 ?_i < _c: goto "crew2" #run _heli setfuel 0 ?!Alive _heli : exit {_X setbehaviour "aware"} foreach _crew _heli setdammage .94 ~12.5 _heli setdamage 1 ~3 _driver sidechat "Is everyone OK!?" exit I changed a few things... 1)Changed the #run section to: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">#run _heli setfuel 0 ?!Alive _heli : exit {_X setbehaviour "aware"} foreach _crew _heli setdammage .94 ~12.5 _heli setdamage 1 ~3 _driver sidechat "Is everyone OK!?" I changed the setfuel to 0 as when the heli had crashed it started its engines and went to repair  and I also gave a time wait command so that you have to run like HELL from the chopper before it blows up and also the "are you ok bit didn't work, so I made the driver say are you ok. But this will probably only work when random kills are turned off. I also changed the setdamage to .94. Just thought you might like to know. Aook  Share this post Link to post Share on other sites
drow 0 Posted February 19, 2004 I made a cool chopper getting shot down sound effect that i cut together from the big chopper crash scene in "We were soldiers" Its pretty good for simulating being shot down by small arms fire, you hear the bullets hit, then the rotar fails, then you hear lots of creeking and whatnot, then you just time it so the crash happens at the right time with the crash sound. Share this post Link to post Share on other sites
r1c0cH3T 0 Posted February 19, 2004 Send over the sound file, if you want it to be hosted. Share this post Link to post Share on other sites
aook002 0 Posted February 19, 2004 @ drow Would you be able to send me the file? If so could you send it to: michael1.owen@btinternet.com Thanks Aook Share this post Link to post Share on other sites
MrZig 0 Posted February 19, 2004 aook, weird about the ai taking off, I have no idea what caused that, usually you can't start the engines at .9 damage.. Oh well. I had it a random number before the heli exploded, but I thought it would be unrealistic, if the helicopter is going to explode it's going to explode when it hits the ground (un-likley in a tail rotor failure, it isn't just dropping). And the setfuel 1 at the bottom is in case it gets hit by like a law it will explode.. Then again that could be unrealistic. It's all a matter of what the user wants for his/her missions. Hope you enjoyed/enjoy the script Share this post Link to post Share on other sites
drow 0 Posted February 20, 2004 yea sure you can have the sound file, i will just upload it and PM you the link. Share this post Link to post Share on other sites
Baphomet 0 Posted February 20, 2004 What's the impact like? How fast does the helo spin? I modified the ECP one so that you could fight the torque a little bit so it wasn't spinning at mach 10 once you got too close to the ground... I also wanted the engine to be running up until when it hit the ground, however my efforts proved to have funny results since the chopper would bounce off the ground as soon as the engine would die. My ideal "hollywood" tail rotor script failure would render the chopper harmless to enemy ai so you could actually crash land instead of getting peppered by a shilka/vulcan etc. I tried doing this but it wasn't reliable since you had to change the pilot's status and not the chopper's, so there were bugs where the pilot wouldn't be noticed sometimes, after the fact. enabling a soldier to quickly jump out of the chopper as soon as it hits the deck so they can high tail it out of there would also be a good feature. Anyhow. Looks interesting. I'd like to hear that crash sound. Share this post Link to post Share on other sites
aook002 0 Posted February 21, 2004 @Mr Zig So is my version of the script ok, with those few changes? Do you know why the driver of the chopper didnt say are you ok? About the heli exploding when it gets hit by a law, i dont really want it to explode, as i'm making a hostage rescue mission and i dont want the hostage to die when it gets hit  Also I think the way you have to run like hell is good, adds a bit more action  @Drow Thanks for saying I can have the sound file  @MrZig I think ill just add a little speech to the end of the script  <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">#run _heli setfuel 0 ?!Alive _heli : exit {_X setbehaviour "aware"} foreach _crew _heli setdammage .94 _driver sidechat "GET OUTTA THERE! IT'S GONNA BLOW!" ~12.5 _heli setdamage 1 ~3 _driver sidechat "Is everyone OK!?" Is there anyway to get the chopper crew to move away from the heli, instead of just getting out? Nite nite....Aook  (yawn) Share this post Link to post Share on other sites
snipman 0 Posted December 20, 2005 Man this script is awesome and old...... If Zig or anyone who knows this script... theres one bug i found with this script when used with the BAS Soar Blackhawks.... When it crashes and the crew gets out and the PILOT tries to start the engine . it makes like a million engine start sounds all at one time.... its laggy and annoying!!! Can anyone test this out and see if they can fix the problem!! Share this post Link to post Share on other sites
Trapper 0 Posted December 21, 2005 I changed a few things...1)Changed the #run section to: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">#run _heli setfuel 0 ?!Alive _heli : exit {_X setbehaviour "aware"} foreach _crew _heli setdammage .94 ~12.5 _heli setdamage 1 ~3 _driver sidechat "Is everyone OK!?" I changed the setfuel to 0 as when the heli had crashed it started its engines and went to repair and I also gave a time wait command so that you have to run like HELL from the chopper before it blows up and also the "are you ok bit didn't work, so I made the driver say are you ok. But this will probably only work when random kills are turned off. I also changed the setdamage to .94. Just thought you might like to know. Aook Removing the fuel should help. Share this post Link to post Share on other sites