From ec7351dbbc5b4c7c5046468b96972ef48f605663 Mon Sep 17 00:00:00 2001 From: icomrade Date: Tue, 26 Apr 2016 14:47:52 -0400 Subject: [PATCH] Kill and eject player when their vehicle explodes Previous changes to the destruction effects file broke previous fixes that resolved the world is on fire glitch. I reverted those in this commit. Note: the CH53 is still broken in this commit --- CHANGE LOG 1.0.6.txt | 1 + .../system/BIS_Effects/airdestruction.sqf | 20 +++++++++++-------- .../BIS_Effects/airdestructionstage2.sqf | 4 ++-- .../system/BIS_Effects/secondaries.sqf | 4 ++-- 4 files changed, 17 insertions(+), 12 deletions(-) diff --git a/CHANGE LOG 1.0.6.txt b/CHANGE LOG 1.0.6.txt index 51d233600..53273e7f2 100644 --- a/CHANGE LOG 1.0.6.txt +++ b/CHANGE LOG 1.0.6.txt @@ -81,6 +81,7 @@ [FIXED] Reworked death messages. Fixed messages not always showing, undefined errors and wrong distance bug. Added bled out, killed by zombie, etc. MPHit event handler (fnc_plyrHit) is no longer needed. @ebaydayz [FIXED] Player no longer hears radiation sound when changing clothes. @ebaydayz [FIXED] Ponds and lakes are now detected correctly in player_goFishing. #1678 @ebaydayz +[FIXED] Players are now ejected and killed when their vehicle is destroyed. @icomrade [UPDATED] .hpp files updated in dayz_epoch_b CfgLootPos > CfgBuildingPos. @Uro1 [UPDATED] .bat files updated in Config-Examples @Raziel23x diff --git a/SQF/dayz_code/system/BIS_Effects/airdestruction.sqf b/SQF/dayz_code/system/BIS_Effects/airdestruction.sqf index 02c52a225..277ee6abd 100644 --- a/SQF/dayz_code/system/BIS_Effects/airdestruction.sqf +++ b/SQF/dayz_code/system/BIS_Effects/airdestruction.sqf @@ -5,7 +5,13 @@ _int = (fuel _v)*(8+random 2); _t=time; if (!isDedicated) then { //dw, particle stuff don't need run on dedicated - + if (player in (crew _v)) then { + [] spawn { //kill players when their vehicle explodes since this is too difficult for ArmA on its own + player action ["Eject",vehicle player]; //eject player so I can get their gear + sleep 0.01; //don't use uisleep here + [player, "explosion"] spawn player_death; + }; + }; _fl = "#particlesource" createVehicleLocal getPosATL _v; _fl attachto [_v,[0,0,0],"destructionEffect2"]; _fl setParticleRandom [0.3, [1, 1, 0], [0, 0, 0], 0, 0.3, [0, 0, 0, 0], 0, 0]; @@ -31,9 +37,7 @@ _tv=11; //Remove weapons/ammo to prevent explosion. Script will create its own explosions (doesnt work?) removeallweapons _v; -if((local _v) AND (_v isKindOf"Air") )then{ - _expl=createVehicle["HelicopterExploSmall",(getPosATL _v),[],0,"CAN_COLLIDE"]; -}; +if (local _v) then {_expl=createVehicle ["HelicopterExploSmall", (getPosATL _v), [], 0, "CAN_COLLIDE"];}; if (!isDedicated) then { //dw, particle stuff don't need run on dedicated while {_i <1200 && ((velocity _v select 2)<-20 || (getPosATL _v select 2)>8) && !(alive _v) && !(isnull _v) && (getPosATL _v select 2)>1} do @@ -43,7 +47,7 @@ if (_tv>2) then {_dr=1/_tv} else {_dr=1}; _fl setDropInterval _dr; _sm setDropInterval _dr; _i=_i+1; -uiSleep 0.2; +sleep 0.2; }; }; // end of dedicated check @@ -74,7 +78,7 @@ if (!isDedicated) then { //dw, particle stuff don't need run on dedicated _splash setparticlecircle [2,[0,3,15]]; _splash setDropInterval 0.002; - uiSleep 0.2; + sleep 0.2; deletevehicle _wave;deletevehicle _splash; }; // end of dedicated check /* @@ -113,7 +117,7 @@ else _velz=velocity _v select 2; if (_velz>1) then {_v setvelocity [velocity _v select 0,velocity _v select 1,0]}; _expl = createVehicle ["HelicopterExploBig", [_pos select 0,_pos select 1,(_pos select 2) + 1], [], 0, "CAN_COLLIDE"]; - uiSleep 0.05; + sleep 0.05; /* _wreck=GetText (configFile >> "CfgVehicles" >> (typeof _v) >> "wreck"); if (_wreck!="") then @@ -128,7 +132,7 @@ else deleteVehicle _v; _v =(_wreck) createvehicle _pos; {_x moveincargo _v} foreach _crw; - //uiSleep 0.05; + //sleep 0.05; _v setvelocity _vel; //_v setPos _pos; _v setvectordir (_dir); diff --git a/SQF/dayz_code/system/BIS_Effects/airdestructionstage2.sqf b/SQF/dayz_code/system/BIS_Effects/airdestructionstage2.sqf index 09104c6d6..4fef42c78 100644 --- a/SQF/dayz_code/system/BIS_Effects/airdestructionstage2.sqf +++ b/SQF/dayz_code/system/BIS_Effects/airdestructionstage2.sqf @@ -66,7 +66,7 @@ _dirt setDropInterval 0.05; _dirt setDropInterval _dr; //_shards setDropInterval _dr; - uiSleep (0.25 - (_speed / 1000)); + sleep (0.25 - (_speed / 1000)); _i = _i + 1; }; deleteVehicle _smoke; @@ -84,5 +84,5 @@ if (local _v) then ["Burn", _v, _int, _t] call BIS_Effects_globalEvent; [_v,_int,false] spawn BIS_Effects_Secondaries; }; -uiSleep 0.5; +sleep 0.5; _v setvelocity [0,0,-0.01]; diff --git a/SQF/dayz_code/system/BIS_Effects/secondaries.sqf b/SQF/dayz_code/system/BIS_Effects/secondaries.sqf index 084d8f8f1..974e015c3 100644 --- a/SQF/dayz_code/system/BIS_Effects/secondaries.sqf +++ b/SQF/dayz_code/system/BIS_Effects/secondaries.sqf @@ -21,7 +21,7 @@ while {_int>1} do }; { - uiSleep _x; + sleep _x; if((_lifecheck&&(alive _v))||(isnull _v)||(((getposASL _v)select 2)<0))exitwith{}; - "SmallSecondary" createvehicle(_v modelToWorld _effect2pos); + createVehicle ["SmallSecondary", (_v modelToWorld _effect2pos), [], 0, "CAN_COLLIDE"]; }foreach(_list); \ No newline at end of file