From d946170831bb3b62e4eaa24ec061b09215d70b7b Mon Sep 17 00:00:00 2001 From: IndigoFox Date: Sat, 10 Feb 2024 20:48:36 -0800 Subject: [PATCH] skip large blue spark on objects --- .../fn_playLocalEffectsForObject.sqf | 86 ++++++++++--------- 1 file changed, 46 insertions(+), 40 deletions(-) diff --git a/framework/emp/functions/fn_playLocalEffectsForObject.sqf b/framework/emp/functions/fn_playLocalEffectsForObject.sqf index 32bafaa..8f31886 100644 --- a/framework/emp/functions/fn_playLocalEffectsForObject.sqf +++ b/framework/emp/functions/fn_playLocalEffectsForObject.sqf @@ -8,7 +8,7 @@ if (!hasInterface) exitWith {}; params [["_object", objNull, [objNull]]]; if (isNull _object) exitWith {}; -// if player is within object view distance of the object, flicker the lights +// flicker the lights private _flickerHandle = [_object] spawn { params ["_object"]; for "_i" from 1 to 3 do { @@ -23,51 +23,57 @@ private _flickerHandle = [_object] spawn { _object setVariable [QGVAR(flickerHandle), _flickerHandle]; -// sound -private _spark_sound = selectRandom (keys GVAR(zapSounds)); -private _sparkSoundData = GVAR(zapSounds) get _spark_sound; -playSound3D [_sparkSoundData get "filename", _object, false, getPosASL _object, _sparkSoundData get "volume", _sparkSoundData get "pitch", 75, 0, true]; +[{scriptDone (_this getVariable QGVAR(flickerHandle));}, { + private _object = _this; -// particle effect -private _e_static = "#particlesource" createVehicleLocal (getPosATL _object); -_e_static setParticleCircle [1, [0, 0, 0]]; -_e_static setParticleRandom [0.2, [1.5,1.5,0], [0.175, 0.175, 0], 0.15, 0.2, [0, 0, 0, 1], 1, 0]; -_e_static setParticleParams [["\A3\data_f\blesk1", 1, 0, 1], "", "SpaceObject", 1, 0.05, [0, 0, 0], [0, 0, 0], 0, 10, 7.9,0, [0.01, 0.02, 0.01], [[1, 1, 0.1, 1], [1, 1, 1, 1]], [0.025], 1, 0, "", "", _object,0,false,-1,[[100,100,100,1],[0,0,1,0.01]]]; -_e_static setDropInterval 0.025; + // sound + // private _spark_sound = selectRandom (keys GVAR(zapSounds)); + // private _sparkSoundData = GVAR(zapSounds) get _spark_sound; + // playSound3D [_sparkSoundData get "filename", _object, false, getPosASL _object, _sparkSoundData get "volume", _sparkSoundData get "pitch", 75, 0, true]; -[{deleteVehicle _this;}, _e_static, 1] call CBA_fnc_waitAndExecute; + // // particle effect, large blue spark + // private _e_static = "#particlesource" createVehicleLocal (getPosATL _object); + // _e_static setParticleCircle [1, [0, 0, 0]]; + // _e_static setParticleRandom [0.2, [1.5,1.5,0], [0.175, 0.175, 0], 0.15, 0.2, [0, 0, 0, 1], 1, 0]; + // _e_static setParticleParams [["\A3\data_f\blesk1", 1, 0, 1], "", "SpaceObject", 1, 0.05, [0, 0, 0], [0, 0, 0], 0, 10, 7.9,0, [0.01, 0.02, 0.01], [[1, 1, 0.1, 1], [1, 1, 1, 1]], [0.025], 1, 0, "", "", _object,0,false,-1,[[100,100,100,1],[0,0,1,0.01]]]; + // _e_static setDropInterval 0.025; + + // [{deleteVehicle _this;}, _e_static, 1] call CBA_fnc_waitAndExecute; -// play additional spark -_bbr = boundingBoxReal vehicle _object; -_p1 = _bbr select 0; -_p2 = _bbr select 1; -_maxHeight = abs ((_p2 select 2) - (_p1 select 2)); + // play additional spark + _bbr = boundingBoxReal vehicle _object; + _p1 = _bbr select 0; + _p2 = _bbr select 1; + _maxHeight = abs ((_p2 select 2) - (_p1 select 2)); -//_spark_poz_rel = [getPos _lamp select 0,getPos _lamp select 1,_maxHeight-0.5]; -private _spark_poz_rel = (_maxHeight/2)-0.45; + //_spark_poz_rel = [getPos _lamp select 0,getPos _lamp select 1,_maxHeight-0.5]; + private _spark_poz_rel = (_maxHeight/2)-0.45; -private _spark_type = ["white","orange"] call BIS_fnc_selectRandom; -private _drop = 0.001+(random 0.05); -private _scantei_spark = "#particlesource" createVehicleLocal (getPosATL _object); + private _spark_type = ["white","orange"] call BIS_fnc_selectRandom; + private _drop = 0.001+(random 0.05); + private _scantei_spark = "#particlesource" createVehicleLocal (getPosATL _object); -if (_spark_type=="orange") then -{ - _scantei_spark setParticleCircle [0, [0, 0, 0]]; - _scantei_spark setParticleRandom [1, [0.1, 0.1, 0.1], [0, 0, 0], 0, 0.25, [0, 0, 0, 0], 0, 0]; - _scantei_spark setParticleParams [["\A3\data_f\proxies\muzzle_flash\muzzle_flash_silencer.p3d", 1, 0, 1], "", "SpaceObject", 1, 1, [0, 0,_spark_poz_rel], [0, 0, 0], 0, 15, 7.9, 0, [0.5,0.5,0.05], [[1, 1, 1, 1], [1, 1, 1, 1], [1, 1, 1, 0]], [0.08], 1, 0, "", "", _object,0,true,0.3,[[1,1,1,1]]]; - _scantei_spark setDropInterval _drop; -} else -{ - //hint "alb"; - _scantei_spark setParticleCircle [0, [0, 0, 0]]; - _scantei_spark setParticleRandom [1, [0.05, 0.05, 0.1], [5, 5, 3], 0, 0.0025, [0, 0, 0, 0], 0, 0]; - _scantei_spark setParticleParams [["\A3\data_f\proxies\muzzle_flash\muzzle_flash_silencer.p3d", 1, 0, 1], "", "SpaceObject", 1, 1, [0, 0,_spark_poz_rel], [0, 0, 0], 0, 20, 7.9, 0, [0.5,0.5,0.05], [[1, 1, 1, 1], [1, 1, 1, 1], [1, 1, 1, 0]], [0.08], 1, 0, "", "", _object,0,true,0.3,[[5,5,3,1]]]; - _scantei_spark setDropInterval 0.001; -}; + if (_spark_type=="orange") then + { + _scantei_spark setParticleCircle [0, [0, 0, 0]]; + _scantei_spark setParticleRandom [1, [0.1, 0.1, 0.1], [0, 0, 0], 0, 0.25, [0, 0, 0, 0], 0, 0]; + _scantei_spark setParticleParams [["\A3\data_f\proxies\muzzle_flash\muzzle_flash_silencer.p3d", 1, 0, 1], "", "SpaceObject", 1, 1, [0, 0,_spark_poz_rel], [0, 0, 0], 0, 15, 7.9, 0, [0.5,0.5,0.05], [[1, 1, 1, 1], [1, 1, 1, 1], [1, 1, 1, 0]], [0.08], 1, 0, "", "", _object,0,true,0.3,[[1,1,1,1]]]; + _scantei_spark setDropInterval _drop; + } else + { + //hint "alb"; + _scantei_spark setParticleCircle [0, [0, 0, 0]]; + _scantei_spark setParticleRandom [1, [0.05, 0.05, 0.1], [5, 5, 3], 0, 0.0025, [0, 0, 0, 0], 0, 0]; + _scantei_spark setParticleParams [["\A3\data_f\proxies\muzzle_flash\muzzle_flash_silencer.p3d", 1, 0, 1], "", "SpaceObject", 1, 1, [0, 0,_spark_poz_rel], [0, 0, 0], 0, 20, 7.9, 0, [0.5,0.5,0.05], [[1, 1, 1, 1], [1, 1, 1, 1], [1, 1, 1, 0]], [0.08], 1, 0, "", "", _object,0,true,0.3,[[5,5,3,1]]]; + _scantei_spark setDropInterval 0.001; + }; + + private _spark_sound = selectRandom (keys GVAR(zapSounds)); + private _sparkSoundData = GVAR(zapSounds) get _spark_sound; + playSound3D [_sparkSoundData get "filename", _object, false, getPosASL _object, _sparkSoundData get "volume", _sparkSoundData get "pitch", 75, 0, true]; + + [{deleteVehicle _this;}, _scantei_spark, 0.4 + (random 0.7)] call CBA_fnc_waitAndExecute; +}, _object] call CBA_fnc_waitUntilAndExecute; -private _spark_sound = selectRandom (keys GVAR(zapSounds)); -private _sparkSoundData = GVAR(zapSounds) get _spark_sound; -playSound3D [_sparkSoundData get "filename", _object, false, getPosASL _object, _sparkSoundData get "volume", _sparkSoundData get "pitch", 75, 0, true]; -[{deleteVehicle _this;}, _scantei_spark, 0.4 + (random 0.7)] call CBA_fnc_waitAndExecute; \ No newline at end of file