OFPEC Forum

Editors Depot - Mission Editing and Scripting => ArmA - Editing/Scripting General => Topic started by: Hoop on 07 Sep 2007, 22:36:55

Title: Black Hawk Down
Post by: Hoop on 07 Sep 2007, 22:36:55
I would like to have it to where a Black Hawk helicopter reaches a Waypoint then once he reaches it i would like for it tail rotor to fail and spin out using this script how do i do this ?

Code: [Select]
; ****************************************************************
; Script file for Armed Assault
; Created by: TODO: Author Name
; ****************************************************************

; 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.001), ((_v select 1) / 1.001), -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 > 2: goto "loop"

?alive _heli: _heli setDammage 0.8; _heli setFuel 0
?!alive _heli: exit

?!_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"
Title: Re: Black Hawk Down
Post by: Mandoble on 08 Sep 2007, 00:31:53
save the script (that text) as tailrotor.sqs in your mission folder. The, in the waypoint activation field put
Code: [Select]
[yourchoppername] exec "tailrotor.sqs"

But before that, change all cl_fire by \ca\data\cl_fired and all cl_basic by \ca\data\cl_basic.
Title: Re: Black Hawk Down
Post by: Hoop on 08 Sep 2007, 01:16:02
Ok but do you know the engine position for the tail rotor on the black hawk ?
Title: Re: Black Hawk Down
Post by: Mandoble on 08 Sep 2007, 01:24:38
A bit try and error cannot be so hard.
Title: Re: Black Hawk Down
Post by: Hoop on 08 Sep 2007, 04:05:14
im a n00b wen it comes to scripting so what numbers do i edit ?
Title: Re: Black Hawk Down
Post by: hoz on 08 Sep 2007, 06:12:53
Code: [Select]
_enginePos = [0, -3, 1]
You need to play with these numbers.  :)
Title: Re: Black Hawk Down
Post by: Mandoble on 08 Sep 2007, 10:13:54
and the neaming of them is:
_enginePos = [left-right, backward-forward, down-up]

for example [1, -6, 2] means 1m to the right of the chopper center, 6 meters back and 2 over chopper's center.
Title: Re: Black Hawk Down
Post by: Hoop on 08 Sep 2007, 23:58:42
Ok thank you i will try it out :)
Title: Re: Black Hawk Down
Post by: Hoop on 09 Sep 2007, 00:52:42
Ive tried and tried but i cant seem to find the corect measurements could someone give me a little help but if not i understand thank you
Title: Re: Black Hawk Down
Post by: JasonO on 09 Sep 2007, 18:16:21
Well the first number will be 0 since the engine isnt left or right of the aircraft, its centered. The 2nd number will be positive to go forward from the center of the aircraft, which probably isnt what you want, or a negative number for the position to be behind the center of the object. The third number is the height above center, if its negative it will be below.
Title: Re: Black Hawk Down
Post by: Ironman on 08 Dec 2008, 09:34:00
Has anyone found out the correct position of the tail rotor?
Title: Re: Black Hawk Down
Post by: Planck on 08 Dec 2008, 14:46:36
Not really, but, looking quickly in O2 I estimate it is approximately (0,-9.6,2)

That would be centered in X, -9.6 in Y and 2 above in Z........approx.


Planck
Title: Re: Black Hawk Down
Post by: Luke on 09 Dec 2008, 22:01:44
Try messing with modeltoworld values, and then placing particles at those points.

Then tweak accordingly.

Luke
Title: Re: Black Hawk Down
Post by: johnnyboy on 10 Dec 2008, 06:28:54
I just tried it out, and this worked well for me:

Code: [Select]
_enginePos = [0, -6.6, .55]
Of course you must also replace this text as Mandoble stated in the second post:

Quote
But before that, change all cl_fire to \ca\data\cl_fired and all cl_basic to \ca\data\cl_basic.