feat(naval-weapons): improve ASM missile exhaust effects
- Use the vanilla CruiseMissile smoke effect. - Position the emitter using the fire_beg and fire_end memory points. - Generalize the function for future ASM missiles.
This commit is contained in:
@@ -0,0 +1,85 @@
|
||||
params [
|
||||
"_unit",
|
||||
"_weapon",
|
||||
"_muzzle",
|
||||
"_mode",
|
||||
"_ammo",
|
||||
"_magazine",
|
||||
"_projectile"
|
||||
];
|
||||
|
||||
private _ammoConfig = configFile >> "CfgAmmo" >> _ammo;
|
||||
if (
|
||||
isNull _projectile ||
|
||||
{!isClass _ammoConfig} ||
|
||||
{getNumber (_ammoConfig >> "braf_asm") != 1}
|
||||
) exitWith {};
|
||||
|
||||
[_projectile] spawn
|
||||
{
|
||||
params ["_projectile"];
|
||||
|
||||
sleep 1.5;
|
||||
if (isNull _projectile) exitWith {};
|
||||
|
||||
private _fireBeg = _projectile selectionPosition ["fire_beg", "Memory"];
|
||||
private _fireEnd = _projectile selectionPosition ["fire_end", "Memory"];
|
||||
private _fireDirectionModel = _fireBeg vectorFromTo _fireEnd;
|
||||
|
||||
if (vectorMagnitude _fireDirectionModel < 0.01) exitWith {};
|
||||
|
||||
private _fireDirectionWorld = _projectile vectorModelToWorld _fireDirectionModel;
|
||||
private _smoke = "#particlesource" createVehicleLocal [0, 0, 0];
|
||||
if (isNull _smoke) exitWith {};
|
||||
|
||||
_smoke setParticleParams
|
||||
[
|
||||
["\A3\data_f\ParticleEffects\Universal\Universal", 16, 12, 8, 0],
|
||||
"",
|
||||
"Billboard",
|
||||
1,
|
||||
0.6,
|
||||
"fire_beg",
|
||||
_fireDirectionWorld vectorMultiply 2,
|
||||
0,
|
||||
0,
|
||||
1.2,
|
||||
0.5,
|
||||
[2, 6, 8.8],
|
||||
[
|
||||
[0.5, 0.5, 0.5, 0.1],
|
||||
[0.6, 0.6, 0.6, 0.06],
|
||||
[0.7, 0.7, 0.7, 0.04],
|
||||
[0.8, 0.8, 0.8, 0.005],
|
||||
[0.9, 0.9, 0.9, 0.003]
|
||||
],
|
||||
[5],
|
||||
0.1,
|
||||
0.1,
|
||||
"",
|
||||
"",
|
||||
_projectile
|
||||
];
|
||||
_smoke setParticleRandom
|
||||
[
|
||||
0.1,
|
||||
[0.3, 0.3, 0.3],
|
||||
[0.25, 0.25, 0.25],
|
||||
20,
|
||||
0.15,
|
||||
[0, 0, 0, 0],
|
||||
0,
|
||||
0
|
||||
];
|
||||
_smoke setDropInterval 0.003;
|
||||
_smoke attachTo [_projectile, [0, 0, 0]];
|
||||
|
||||
private _endTime = time + 2;
|
||||
waitUntil
|
||||
{
|
||||
sleep 0.01;
|
||||
isNull _projectile || {time >= _endTime}
|
||||
};
|
||||
|
||||
deleteVehicle _smoke;
|
||||
};
|
||||
Reference in New Issue
Block a user