mirror of
https://github.com/EpochModTeam/DayZ-Epoch.git
synced 2025-12-13 19:52:38 +03:00
Fix parachute bug
Thx @ch0c
This commit is contained in:
@@ -3,9 +3,9 @@ uiSleep 0.01;
|
|||||||
|
|
||||||
//--- HALO -------------------------------------------------------------------------------------------------------------------------------------
|
//--- HALO -------------------------------------------------------------------------------------------------------------------------------------
|
||||||
if (typename _this == typename objnull) then {
|
if (typename _this == typename objnull) then {
|
||||||
|
|
||||||
_unit = _this;
|
_unit = _this;
|
||||||
|
|
||||||
//--- Eject!
|
//--- Eject!
|
||||||
waituntil {(vehicle _unit) iskindof "ParachuteBase" || !isnil {_unit getvariable "bis_fnc_halo_now"}};
|
waituntil {(vehicle _unit) iskindof "ParachuteBase" || !isnil {_unit getvariable "bis_fnc_halo_now"}};
|
||||||
if (!local _unit) exitwith {};
|
if (!local _unit) exitwith {};
|
||||||
@@ -14,7 +14,7 @@ if (typename _this == typename objnull) then {
|
|||||||
_parachute = vehicle _unit;
|
_parachute = vehicle _unit;
|
||||||
if (_parachute != _unit) then {
|
if (_parachute != _unit) then {
|
||||||
deletevehicle _parachute;
|
deletevehicle _parachute;
|
||||||
};
|
};
|
||||||
|
|
||||||
//--- Init
|
//--- Init
|
||||||
_dir = ([[0,0,0],velocity _unit] call bis_fnc_dirto);
|
_dir = ([[0,0,0],velocity _unit] call bis_fnc_dirto);
|
||||||
@@ -54,7 +54,7 @@ if (typename _this == typename objnull) then {
|
|||||||
/* 17 */ "",
|
/* 17 */ "",
|
||||||
/* 18 */ player
|
/* 18 */ player
|
||||||
];
|
];
|
||||||
bis_fnc_halo_clouds = "#particlesource" createVehicleLocal _pos;
|
bis_fnc_halo_clouds = "#particlesource" createVehicleLocal _pos;
|
||||||
bis_fnc_halo_clouds setParticleParams _parray;
|
bis_fnc_halo_clouds setParticleParams _parray;
|
||||||
bis_fnc_halo_clouds setParticleRandom [0, [100, 100, 0], [0, 0, 0], 0, 0, [0, 0, 0, 0], 0, 1];
|
bis_fnc_halo_clouds setParticleRandom [0, [100, 100, 0], [0, 0, 0], 0, 0, [0, 0, 0, 0], 0, 1];
|
||||||
bis_fnc_halo_clouds setParticleCircle [00, [00, 00, 00]];
|
bis_fnc_halo_clouds setParticleCircle [00, [00, 00, 00]];
|
||||||
@@ -65,7 +65,7 @@ if (typename _this == typename objnull) then {
|
|||||||
bis_fnc_halo_ppRadialBlur = ppeffectcreate ["RadialBlur",464];
|
bis_fnc_halo_ppRadialBlur = ppeffectcreate ["RadialBlur",464];
|
||||||
bis_fnc_halo_ppRadialBlur ppEffectAdjust [0.01,0.01,0.3,0.3];
|
bis_fnc_halo_ppRadialBlur ppEffectAdjust [0.01,0.01,0.3,0.3];
|
||||||
bis_fnc_halo_ppRadialBlur ppEffectCommit 0.01;
|
bis_fnc_halo_ppRadialBlur ppEffectCommit 0.01;
|
||||||
bis_fnc_halo_ppRadialBlur ppEffectEnable true ;
|
bis_fnc_halo_ppRadialBlur ppEffectEnable true ;
|
||||||
bis_fnc_halo_soundLoop = time;
|
bis_fnc_halo_soundLoop = time;
|
||||||
playsound "BIS_HALO_Flapping";
|
playsound "BIS_HALO_Flapping";
|
||||||
|
|
||||||
@@ -111,11 +111,11 @@ if (typename _this == typename objnull) then {
|
|||||||
[] spawn {
|
[] spawn {
|
||||||
_time = time - 0.1;
|
_time = time - 0.1;
|
||||||
while {alive player && vehicle player == player && isnil {player getvariable "bis_fnc_halo_terminate"} && (([player] call FNC_GetPos) select 2) > DZE_HaloOpenChuteHeight} do {
|
while {alive player && vehicle player == player && isnil {player getvariable "bis_fnc_halo_terminate"} && (([player] call FNC_GetPos) select 2) > DZE_HaloOpenChuteHeight} do {
|
||||||
|
|
||||||
//--- FPS counter
|
//--- FPS counter
|
||||||
_fpsCoef = ((time - _time) * 60) / acctime; //Script is optimized for 60 FPS
|
_fpsCoef = ((time - _time) * 60) / acctime; //Script is optimized for 60 FPS
|
||||||
_time = time;
|
_time = time;
|
||||||
|
|
||||||
bis_fnc_halo_velLimit = 0.2 * _fpsCoef;
|
bis_fnc_halo_velLimit = 0.2 * _fpsCoef;
|
||||||
bis_fnc_halo_velAdd = 0.03 * _fpsCoef;
|
bis_fnc_halo_velAdd = 0.03 * _fpsCoef;
|
||||||
bis_fnc_halo_dirLimit = 1 * _fpsCoef;
|
bis_fnc_halo_dirLimit = 1 * _fpsCoef;
|
||||||
@@ -165,7 +165,7 @@ if (typename _this == typename objnull) then {
|
|||||||
bis_fnc_halo_ppRadialBlur ppEffectAdjust [0.02,0.02,0.3 - (bis_fnc_halo_vel/7)/_fpsCoef,0.3 - (bis_fnc_halo_vel/7)/_fpsCoef];
|
bis_fnc_halo_ppRadialBlur ppEffectAdjust [0.02,0.02,0.3 - (bis_fnc_halo_vel/7)/_fpsCoef,0.3 - (bis_fnc_halo_vel/7)/_fpsCoef];
|
||||||
bis_fnc_halo_ppRadialBlur ppEffectCommit 0.01;
|
bis_fnc_halo_ppRadialBlur ppEffectCommit 0.01;
|
||||||
*/
|
*/
|
||||||
if (DZE_HaloAltitudeMeter && !isNil "Dayz_loginCompleted") then {
|
if (DZE_HaloAltitudeMeter && {!isNil "Dayz_loginCompleted"}) then {
|
||||||
titleText [
|
titleText [
|
||||||
format [
|
format [
|
||||||
localize "str_halo_altitude_speed",
|
localize "str_halo_altitude_speed",
|
||||||
@@ -174,7 +174,7 @@ if (typename _this == typename objnull) then {
|
|||||||
],"PLAIN DOWN",0.01
|
],"PLAIN DOWN",0.01
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
uiSleep 0.01;
|
uiSleep 0.01;
|
||||||
};
|
};
|
||||||
//--- End
|
//--- End
|
||||||
@@ -199,7 +199,7 @@ if (typename _this == typename objnull) then {
|
|||||||
player switchmove "adthppnemstpsraswrfldnon_1";
|
player switchmove "adthppnemstpsraswrfldnon_1";
|
||||||
player setvelocity [0,0,0];
|
player setvelocity [0,0,0];
|
||||||
} else {
|
} else {
|
||||||
if (DZE_HaloOpenChuteHeight > -1 && isNil "bis_fnc_halo_para_dirAbs") then {
|
if (DZE_HaloOpenChuteHeight > -1 && {isNil "bis_fnc_halo_para_dirAbs"}) then {
|
||||||
//Auto open chute
|
//Auto open chute
|
||||||
[player] spawn BIS_fnc_Halo;
|
[player] spawn BIS_fnc_Halo;
|
||||||
};
|
};
|
||||||
@@ -244,10 +244,10 @@ if (typename _this == typename []) then {
|
|||||||
_unit spawn bis_fnc_halo;
|
_unit spawn bis_fnc_halo;
|
||||||
};
|
};
|
||||||
//-------------
|
//-------------
|
||||||
|
|
||||||
_para = objnull;
|
_para = objnull;
|
||||||
_vel = [];
|
_vel = [];
|
||||||
_unit allowDamage false; //Prevent glitch death when opening chute
|
_unit allowDamage false; //Prevent glitch death when opening chute
|
||||||
_paraPosition1 = [_unit] call FNC_GetPos;
|
_paraPosition1 = [_unit] call FNC_GetPos;
|
||||||
_para = createVehicle ["ParachuteWest", _paraPosition1, [], 0, "CAN_COLLIDE"];
|
_para = createVehicle ["ParachuteWest", _paraPosition1, [], 0, "CAN_COLLIDE"];
|
||||||
//_para = "BIS_Steerable_Parachute" createVehicle position _unit;
|
//_para = "BIS_Steerable_Parachute" createVehicle position _unit;
|
||||||
@@ -345,6 +345,17 @@ if (typename _this == typename []) then {
|
|||||||
(-bis_fnc_halo_para_vel * 75) + 0.5*(sin (time * 180)),
|
(-bis_fnc_halo_para_vel * 75) + 0.5*(sin (time * 180)),
|
||||||
(+bis_fnc_halo_para_dir * 25) + 0.5*(cos (time * 180))
|
(+bis_fnc_halo_para_dir * 25) + 0.5*(cos (time * 180))
|
||||||
] call bis_fnc_setpitchbank;
|
] call bis_fnc_setpitchbank;
|
||||||
|
|
||||||
|
_para = vehicle player;
|
||||||
|
_speed = abs speed _para;
|
||||||
|
if ((_para != player) && {_speed > 13}) then {
|
||||||
|
_velocity = velocity _para;
|
||||||
|
_y = 0.8;
|
||||||
|
if (_speed > 20) then {_y = 0.1;};
|
||||||
|
_drop = [(_velocity select 0) * _y, (_velocity select 1) * _y, (_velocity select 2) * 1.1];
|
||||||
|
_para SetVelocity _drop;
|
||||||
|
};
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
bis_fnc_halo_para_mousemoving_eh = (finddisplay 46) displayaddeventhandler ["mousemoving","_this call bis_fnc_halo_para_loop;"];
|
bis_fnc_halo_para_mousemoving_eh = (finddisplay 46) displayaddeventhandler ["mousemoving","_this call bis_fnc_halo_para_loop;"];
|
||||||
|
|||||||
Reference in New Issue
Block a user