Jump to content
Sign in to follow this  
mattxr

Tail Rotor Script

Recommended Posts

I need a Tail Rotor Script urgently for a cutscene.. and is there any way i can have the camera positioned inside a cockpit when the script runs so i dont get an outside view.

i checked ofpec for the script but it wasnt there and i cant find one any where else..

smile_o.gif

Share this post


Link to post
Share on other sites

Try this to start with, didn't test it, but it should work (hopefuly)

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">

;tailfails.sqs

;Arguments:

;Unit with tailrotor faillure

;Descend speed in m/s (use negative values)

;Horizontal speed in m/s

;Example:

;[helo1,-2,5]exec"tailfails.sqs"

;

_unit = _this select 0

_descendvel = _this select 1

_horvel = _this select 2

_dir = getDir _unit

;Decrease steps to rotate faster

_steps = 150.0

_delta = 360 / _steps

#turnaround

_i = 0

#rotate

_dir = _dir + _delta

_vel = [_horvel*sin(_dir),_horvel*cos(_dir),_descendvel]

_unit setVelocity _vel

_unit setDir _dir

_i = _i + 1

~0.01

?(damage _unit > 0.5): exit

?_i < _steps:goto "rotate"

goto "turnaround"

BTW, were you really able to access ofpec forums??

Share this post


Link to post
Share on other sites

wow that works great [amazing infact].. except when the heli reaches the ground its still spinning lol rofl.gif

nah never got onto there fourms..

Share this post


Link to post
Share on other sites

Yeah, to stop the spin the current condition is

?(damage _unit > 0.5): exit

But if the diving speed is too low, the helicopter will not get damage after reaching the ground. You may add a full revolution counter (every time the script reaches #turnaround label) and after some of them (and if altitude is < 2m), set its fuel to 0 and stop the rotations.

Share this post


Link to post
Share on other sites
Yeah, to stop the spin the current condition is

?(damage _unit > 0.5): exit

But if the diving speed is too low, the helicopter will not get damage after reaching the ground. You may add a full revolution counter (every time the script reaches #turnaround label) and after some of them (and if altitude is < 2m), set its fuel to 0 and stop the rotations.

how would i add that in... smile_o.gif

Share this post


Link to post
Share on other sites

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">

;tailfails.sqs

;Arguments:

;Unit with tailrotor faillure

;Descend speed in m/s (use negative values)

;Horizontal speed in m/s (negative if backward movement)

;Minimum number of 360 deg turns if still flying (1m above ground or more)

;Example:

;[helo1,-2,5,15]exec"tailfails.sqs"

;

_unit = _this select 0

_descendvel = _this select 1

_horvel = _this select 2

_numturns = _this select 3

_dir = getDir _unit

;Decrease steps to rotate faster

_steps = 150.0

_delta = 360 / _steps

_turns = 0

#turnaround

_i = 0

#rotate

_dir = _dir + _delta

_vel = [_horvel*sin(_dir),_horvel*cos(_dir),_descendvel]

_unit setVelocity _vel

_unit setDir _dir

_i = _i + 1

~0.01

?(damage _unit > 0.5): exit

?_i < _steps:goto "rotate"

_turns = _turns + 1

? (_turns < _numturns) && ((getPos _unit select 2)>1.0):goto "turnaround"

_unit setFuel 0

exit

Probably later I'll test a more advanced version of this crappy script.

Share this post


Link to post
Share on other sites

Its alright, now for the creating of the cutscene.. again smile_o.gif

Share this post


Link to post
Share on other sites

Much much better this way biggrin_o.gif :

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">

;tailfails.sqs

;Arguments:

;Unit with tailrotor faillure

;Descend speed in m/s (use negative values)

;Horizontal speed in m/s (negative if backward movement)

;Minimum number of 360 deg turns if still flying (1m above ground or more)

;Internal camera true/false

;Tail smoke trail true/false

;tail distance from heli center

;tail altitude from heli center

;

;Example using an AH1 attack chopper named heli1:

;[heli1,-2,5,20,false,true,6,1.5]exec"tailfails.sqs"

;

_unit = _this select 0

_descendvel = _this select 1

_horvel = _this select 2

_numturns = _this select 3

_camera = _this select 4

_smoke = _this select 5

_taildist = _this select 6

_tailalt = _this select 7

?_camera: _unit switchCamera "INTERNAL"

_dir = getDir _unit

;Decrease steps to rotate faster

_steps = 120.0

_delta = 360 / _steps

_turns = 0

#turnaround

_i = 0

#rotate

_dir = _dir + _delta

_vel = [_horvel*sin(_dir),_horvel*cos(_dir),_descendvel]

_unit setVelocity _vel

_unit setDir _dir

_i = _i + 1

_possmoke = [(getPos _unit select 0)+sin(_dir+180)*_taildist,(getPos _unit select 1)+cos(_dir+180)*_taildist,(getPos _unit select 2)+_tailalt]

?_smoke:drop["cl_basic","","Billboard",100,1,_possmoke,[0,0,0],0,20,20,0.05,[1,1.5,2,3],[[1,1,1,0.6],[0.8,0.8,0.8,0.5],[0,0,0,0.4],[0,0,0,0]],[0,1,0,1],0,0,"","",""]

~0.01

?(damage _unit > 0.5): exit

?_i < _steps:goto "rotate"

_turns = _turns + 1

? (_turns > _numturns) || ((getPos _unit select 2)<1.0):_unit setFuel 0

?isEngineOn _unit:goto "turnaround"

exit

Share this post


Link to post
Share on other sites

thx mandoble your a star yay.gif although i dont see the smoke

lol the cutscene looks good now lol a rebel fires a rpg at the blackhawk coursing 0.1 dammage or more which sets of the tail rotor failer which then goes to the pilots view and then blacks out close to the ground thats when your mission starts to escape the crash site and local milisha smile_o.gif

Share this post


Link to post
Share on other sites

You cannot see the smoke from inside, the smoke is generated at the indicated distance from the center of the heli and the indicated altitude from the center. Try this with an AH1:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">[heli1,-2,5,20,false,true,6,1.5]exec"tailfails.sqs"

Place yourself outside and near the chopper.

Share this post


Link to post
Share on other sites

nah still cant, but thx to you my Intro is complete.. smoke would make the 3 seconds you see the heli look good but thats why i wanted inside veiw for lol tounge2.gif

Share this post


Link to post
Share on other sites

Mandoble your a god.. check out this video of that part of the intro i made with your script, its good thx too you becuase the mission is your the pilot lol..

Share this post


Link to post
Share on other sites
Quote[/b] ]BTW, were you really able to access ofpec forums??

Mandoble - well the forums were down but the depot did

still work lately. wink_o.gif

~S~ CD

Share this post


Link to post
Share on other sites
have no idea, i got it set to true lol

Not quite clear screenshot, but it is there ...

tailfails.JPG

Perhaps it cannot be seen in darkness...

Share this post


Link to post
Share on other sites

;tailfails.sqs

;Arguments:

;Unit with tailrotor faillure

;Descend speed in m/s (use negative values)

;Horizontal speed in m/s (negative if backward movement)

;Minimum number of 360 deg turns if still flying (1m above ground or more)

;Internal camera true/false

;Tail smoke trail true/false

;tail distance from heli center

;tail altitude from heli center

;

;Example using an AH1 attack chopper named heli1:

;[heli1,-2,5,20,false,true,6,1.5]exec"tailfails.sqs"

;

_unit = _this select 0

_descendvel = _this select 1

_horvel = _this select 2

_numturns = _this select 3

_camera = _this select 4

_smoke = _this select 5

_taildist = _this select 6

_tailalt = _this select 7

?_camera: _unit switchCamera "INTERNAL"

_dir = getDir _unit

;Decrease steps to rotate faster

_steps = 120.0

_delta = 360 / _steps

_turns = 0

#turnaround

_i = 0

#rotate

_dir = _dir + _delta

_vel = [_horvel*sin(_dir),_horvel*cos(_dir),_descendvel]

_unit setVelocity _vel

_unit setDir _dir

_i = _i + 1

_possmoke = [(getPos _unit select 0)+sin(_dir+180)*_taildist,(getPos _unit select 1)+cos(_dir+180)*_taildist,(getPos _unit select 2)+_tailalt]

?_smoke:drop["cl_basic","","Billboard",100,1,_possmoke,[0,0,0],0,20,

20,0.05,[1,1.5,2,3],[[1,1,1,0.6],[0.8,0.8,0.8,0.5],[0,0,0,0.4],[0,0,0,0]],[0,1,0,1],0,0,&q

uot;","",""]

~0.01

?(damage _unit > 0.5): exit

?_i < _steps:goto "rotate"

_turns = _turns + 1

? (_turns > _numturns) || ((getPos _unit select 2)<1.0):_unit setFuel 0

?isEngineOn _unit:goto "turnaround"

exit

Hi! I have a question about the smoke effects that you have in your script....Would it be possible to make the effects bigger? I've been playing with the dialog_drop.intro mission that shows what the code in game. I've tried to copy and paste the code to your script and I come up with an error, or the smoke effects don't show. The script as shown works just fine...I just want to make the chopper have the cl_fire effect with some black, but I'm new in this area...Example...I'd like to have the chopper turn in to a big flaming ball of fire, and smoke with a long smoke trail behind it. Here is the code snipet that I made using the tool from OFPEC, and this it the mission/tutorial I guess?

http://www.ofpec.com/OFPResources/scripts/dialog_drop.intro.zip

------------------------------------------------------------------------------------------

["cl_fire","","Billboard",0.01,2.15231,[9696.86,3963.32,0],[

16.9231,-23.0769,3.8147e-006],0,0.538616,1,0,[16.1538,12.3077],[[1,1,1,1],[1,1,1,1],[1,1,1

,1],[1,1,1,1]],[0,1,0,1],0,0,"","",""]

I tried to copy and paste this in to your script, and then tried to add each set of numbers, but I'm not sure about this code in your script:

?_smoke:drop["cl_basic","","Billboard",100,1,_possmoke,[0,0,0],0,20,

20,0.05,[1,1.5,2,3],[[1,1,1,0.6],[0.8,0.8,0.8,0.5],[0,0,0,0.4],[0,0,0,0]],[0,1,0,1],0,0,&a

mp;q

uot;","",""]

Any help with this would be much appreciated....

Share this post


Link to post
Share on other sites

The current line is:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">?_smoke:drop["cl_basic","","Billboard",100,1,_possmoke,[0,0,0],0,20,20,0.05,[1,1.5,2,3],[[1,1,1,0.6],[0.8,0.8,0.8,0.5],[0,0,0,0.4],[0,0,0,0]],[0,1,0,1],0,0,"","",""]

What is """ in yours? A copy/paste bug?

To use your cl_fire you should at least place it at _possmoke initial position:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">

["cl_fire","","Billboard",0.01,2.15231,_possmoke,[16.9231,-23.0769,3.8147e-006],0,0.538616,1,0,[16.1538,12.3077],[[1,1,1,1],[1,1,1,1],[1,1,1,1],[1,1,1,1]],[0,1,0,1],0,0,"","",""]

Also, the velocity vector of your drop is a bit weird [16.9231,-23.0769,3.8147e-006]

a particle moving quite fast to the East and to the South, and going down like a meteorit.

The size is also too big [16.1538,12.3077], 16m first transitioning to 12m.

Share this post


Link to post
Share on other sites

Here's one I remember being pretty nice:

Quote[/b] ]; tail-rotor fail script by Vektorboson

; SYNTAX

; [CHOPPER, <RANDOMKILLS, MAXKILLS>] exec "effects\tailrotor.sqs"

; CHOPPER is the helicopter

; RANDOMKILLS is either true or false (random people are killed)

; MAXKILLS is maximum of randomkills

_heli = _this select 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

; Position of helicopter engine (adjust this for different helicopters! )

_enginePos = [0, -3, 1]

drop ["cl_fire", "", "Billboard", 1, 1, _enginePos, [0,-3,1], 0, 1, 1, 0.001, [1,5], [[1,1,1,1],[1,1,1,0]], [0], 0.1, 0.2, "", "", _heli]

~0.05

drop ["cl_fire", "", "Billboard", 1, 1, _enginePos, [0,-3,1], 0, 1, 1, 0.001, [1,5], [[1,1,1,1],[1,1,1,0]], [0], 0.1, 0.2, "", "", _heli]

~0.02

drop ["cl_fire", "", "Billboard", 1, 1, _enginePos, [0,-3,1], 0, 1, 1, 0.001, [1,5], [[1,1,1,1],[1,1,1,0]], [0], 0.1, 0.2, "", "", _heli]

_AddDir = 0.1

~(random 1)

#loop

_dir = getDir _heli

?_AddDir < 5: _AddDir = _AddDir + 0.05

_heli setDir (_dir + _AddDir)

_v = Velocity _heli

_heli setVelocity [((_v select 0) / 1.0001), ((_v select 1) / 1.0001), -5]

drop ["cl_basic", "", "Billboard", 7, 7, _enginePos, [0,0,0], 0, 1, 1, 0.001, [1,5], [[0,0,0,0],[0,0,0,0.7],[0,0,0,0]], [0], 0.1, 0.2, "", "", _heli]

~0.01

?getPos _heli select 2 < 10: _heli setFuel 0

?getPos _heli select 2 > 2: goto "loop"

?alive _heli: _heli setDammage 0.8

?!alive _heli: exit

_v = Velocity _heli

_heli setVelocity [((_v select 0) / 1.001), ((_v select 1) / 1.001), -5]

?!_random: exit

; now the randomkills

_crew = crew _heli

_c = count _crew

_i = 0

_kills = 0

#crew

_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 "crew"

Share this post


Link to post
Share on other sites

Yes, must have copied something eles somehow....sorry about that...

I tried the code you set up, and it worked......well lets just say that FX editor I told you about looked totally different than what I saw in game lol. It looked sooo not right, but with this basic setup, and your answer to my question I'll be able to play with it.

I'm new in the scripting area like I said, and I just wanted to make different types of effects. Will this script also work on planes? I haven't tried that yet. I haven't found a good plane crash script like your heli script. I'm just tired of searching for planes to test to see if they can crash land. It would open up more doors for different types of missions.

Thank you for your help. I'll practice with this script and post a good pic, or movie when I get it .... well .... right. lol

**edit**

No it doesn't work on planes.... They just spin like a flatspin.

Share this post


Link to post
Share on other sites
**edit**

No it doesn't work on planes.... They just spin like a flatspin.

Planes dont have Tail rotors thats why tounge2.gif

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×