hi there all
I was wondering if you guys could again point me in the right direction / correct me /help
i have a dc3 flying along a waypoint and have a trigger that it is activated by the dc3 with the following in the activation field
res = [plane1, group leader1, 0.5]execVM"ejectgroup.sqf"
this works fantastic, however when i try to execute the following scripts(para lz by Raptorsaurus)
to get the para's to land within a a dz i get an error
i have changed the scripts as Mr peanut suggested but i get an error message that comes something to with "atan ...."
this is what i have in my mission folder
init.sqs
[] exec "Para_LZ\para_init.sqs"
exit
para_init.sqs
SetObjPosObj = compile preProcessFile "Para_LZ\Functions\SetObjPosObj.sqf"
RandPos = compile preProcessFile "Para_LZ\Functions\RandPos.sqf"
IncVeltoTarg = compile preProcessFile "Para_LZ\Functions\IncVeltoTarg.sqf"
DirOfMove = compile preProcessFile "Para_LZ\Functions\DirOfMove.sqf"
SetSpd = compile preProcessFile "Para_LZ\Functions\SetSpd.sqf"
DisOverGnd = compile preProcessFile "Para_LZ\Functions\DisOverGnd.sqf"
ObjElevObj = compile preProcessFile "Para_LZ\Functions\ObjElevObj.sqf"
GetPosOffset = compile preProcessFile "Para_LZ\Functions\GetPosOffset.sqf"
getAlt = compile preProcessFile "Para_LZ\Functions\getAlt.sqf"
exit
para_LZ
;****************************************************************************
; para_LZ Script by Raptorsaurus
; v1.2
;
; Helps control where paratroopers land
;
;****************************************************************************
; this script requires the following functions (included in the {Para_LZ\Functions} folder):
;SetObjPosObj.sqf
;RandPos.sqf
;IncVeltoTarg.sqf
;DirOfMove.sqf
;SetSpd.sqf
;DisOverGnd.sqf
;ObjElevObj.sqf
;GetPosOffset.sqf
;getAlt.sqf
;call the script using this in the initfield of paratrooper, or from script or
;in activation field of trigger or waypoint
;[man, pos, mindis, maxdis, releaseAlt] exec "Para_LZ\para_LZ.sqs"
;further explaination after the code
_unit = _this select 0
_pos = _this select 1
_dismin = _this select 2
_dismax = _this select 3
_alt = _this select 4
;************************** USER ADJUSTABLE PARAMETERS ***********************************
;array of all parachute types (so script can test for parachute deployment, you can add new parachutes to this list if you know the "typOf" name.)
_parachutes = ["ParachuteWest", "ParachuteEast", "ParachuteC", "ParachuteG"]
;maximum glide ratio of parachute (the horizontal distance vs. vertical drop, so if it moves 6 m forward for each 1 m drop its glide ratio is 6)
_grate = 6
;*********************************************************************************************************
;wait for parachute to be deployed
@ typeOf (vehicle _unit) in _parachutes || ! alive _unit
? (! alive _unit) : goto "end"
_para = vehicle _unit
_typ = typeOf _para
;wait for full deployment and vertical slowdown
~2
@ ((velocity _para select 2) < 5) || ! alive _unit
? (! alive _unit) : goto "end"
_LZ = "logic" createVehicle ([_pos, 0, _dismin, _dismax, -180, 180, 0, 0, 1] call RandPos)
_LZ setPos [getPos _LZ select 0, getPos _LZ select 1, _alt]
_FT= "logic" createVehicle [0,0,0]
_reset = false
_lim = 30
_tinc = 1
_ainc = 20
_smax = 50
_smin = 25
_smod = 20
_ASLi = ( ([_para] call getAlt) select 0)
_DISi = [_para, _LZ] call DisOverGnd
_ang = atan (1 / _grate)
_zoff = (([_LZ, _para] call GetPosOffset) select 2) - (_DISi * tan _ang)
? (_zoff < 0) : _zoff = 0
[_LZ, _FT, 0, 0, _zoff] call SetObjPosObj
#loop
setAccTime 1
_para setVelocity ( ([_para, _FT, _tinc, _ainc, _smod] call IncVeltoTarg) select 0 )
? (speed _para > _smax) : _para setVelocity ([_para, _smax, true] call SetSpd)
? (speed _para < _smin) : _para setVelocity ([_para, _smin, true] call SetSpd)
? ( ([_LZ, _para] call ObjElevObj) > _lim ) : goto "calcang"
~.01
_para setDir ([_para] call DirOfMove)
? (alive _unit) && (typeOf _para == _typ) && ((getPos _unit select 2) > _alt) : goto "loop"
@ (! alive _unit) || (typeOf _para != _typ)
? (alive _unit) : _unit setDir _dir
#end
deleteVehicle _LZ
deleteVehicle _FT
exit
#calcang
_ASLf = ( ([_para] call getAlt) select 0 )
_DISf = [_para, _LZ] call DisOverGnd
_actGR = (_DISi - _DISf) / (_ASLi - _ASLf)
_GRcor = _grate / _actGR
_reqGR = (_DISf / (([_LZ, _para] call GetPosOffset) select 2)) * _GRcor
_ang = atan (1 / _reqGR)
_zoff = ((([_LZ, _para] call GetPosOffset) select 2) - (_DISf * tan _ang))
? (_zoff < 0) : _zoff = 0
_ASLi = ( ([_para] call getAlt) select 0)
_DISi = [_para, _LZ] call DisOverGnd
_grate = _actGR
[_LZ, _FT, 0, 0, _zoff] call SetObjPosObj
_reset = true
_tinc = 5
? (_lim < 80) : _lim = _lim + 5
? (_lim > 60) : _smax = 10; _smin = 5; _smod = 10
goto "loop"
exit
;Parameter Explaination
;[man, pos, mindis, maxdis, releaseAlt] exec "Para_LZ\para_LZ.sqs"
;man - this it the unit who's parachute will be directed to the LZ
;pos - this is the position of the LZ it can be a 2 or 3 dim position ( [x, y, z] or [x , y] ) or
; it can be a reference object or marker. For an object as reference use: (getPos objectname)
; for marker reference use: (getMarkerPos "markername")
;mindis - this is the minimum distance the unit will land from the target area; he WILL not ever
; land closer than this distance, so this can be used to prevent him from landing in the
; midst of hostiles if the target area is in the center of hostile territory
;maxdis - this is the maximum distance the unit will land from the target area; he will rarely land
; further away than this (unless the LZ is upwind from the DZ).
;releaseAlt - this is the altitude at which the script releases control of the chute, it will fall
; naturally once this altitude is reached. I generally use a value between 1 and 5. If
; you use 0 the unit could be killed or injured because even though his veritcal velocity
; is slow, his forward velocity might be high enough to cause damage.
;
;Example:
;[player, (getMarkerPos "LZ"), 20, 75, 3] exec "Para_LZ\para_LZ.sqs"
;This will make the player (once his chute deploys), land in a random spot at least 20 m from the
;marker named "LZ" but no further than 75 m from the LZ. When the player is 3 m above the ground
;the script will release control over to the parachute and it will drift according to the OFP engine
;for the last 3 m.
i attach the zip file of the orginal scripts
please could some one enlighten me on how to fix this