OFPEC Forum
Editors Depot - Mission Editing and Scripting => ArmA - Editing/Scripting General => Topic started 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 ?
; ****************************************************************
; 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"
-
save the script (that text) as tailrotor.sqs in your mission folder. The, in the waypoint activation field put
[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.
-
Ok but do you know the engine position for the tail rotor on the black hawk ?
-
A bit try and error cannot be so hard.
-
im a n00b wen it comes to scripting so what numbers do i edit ?
-
_enginePos = [0, -3, 1]
You need to play with these numbers. :)
-
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.
-
Ok thank you i will try it out :)
-
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
-
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.
-
Has anyone found out the correct position of the tail rotor?
-
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
-
Try messing with modeltoworld values, and then placing particles at those points.
Then tweak accordingly.
Luke
-
I just tried it out, and this worked well for me:
_enginePos = [0, -6.6, .55]
Of course you must also replace this text as Mandoble stated in the second post:
But before that, change all cl_fire to \ca\data\cl_fired and all cl_basic to \ca\data\cl_basic.