ACE3/addons/cookoff/functions/fnc_smoke.sqf
johnb432 c44a1e7ea7
Cookoff - Mini-Rewrite (#9758)
* Cook-off improvements

* More changes

* Update fnc_getVehicleAmmo.sqf

* Better engine fire placement

* Update fnc_detonateAmmunition.sqf

* Update XEH_postInit.sqf

* Update fnc_getVehicleAmmo.sqf

* Update events-framework.md

* Various improvements

* Separate effect handling

* Tweaks

* Update XEH_postInit.sqf

* Prevent double ammo detonation

* Fixed objects not being able to cook-off again

* Added incendiary rounds as source of box cookoff

* Converted enable setting to bool

* Fixed brackets

* Update fnc_cookOff.sqf

* Update CfgEden.hpp

* Removed GVAR(enable), added GVAR(enableFire) back

* Update initSettings.inc.sqf

* Update events-framework.md

* Update addons/cookoff/functions/fnc_cookOffEffect.sqf

* Restructured, redid API events

* Fix effect for JIP, minor optimisations

* Removed `cbaSettings_settingChanged`

* Renamed variables, tweaked string table entries

* Update fire damage #9991

* Capitalize comments again

* Fix cookoff for very short durations and fix effect removal being too quick
2024-06-05 12:36:39 -07:00

45 lines
1.1 KiB
Plaintext

#include "..\script_component.hpp"
/*
* Author: tcvm
* Starts vehicle barrel smoke effect.
*
* Arguments:
* 0: Vehicle <OBJECT>
* 1: Selections for smoke to come out of <ARRAY>
*
* Return Value:
* None
*
* Example:
* [vehicle player, ["commander_turret"]] call ace_cookoff_fnc_smoke
*
* Public: No
*/
params ["_vehicle", "_selections"];
private _positionBarrelEnd = getText ([_vehicle, [0]] call CBA_fnc_getTurret >> "gunBeg");
// Smoke out of cannon and hatches
private _smokeBarrel = "#particlesource" createVehicleLocal [0, 0, 0];
_smokeBarrel setParticleClass "MediumDestructionSmoke";
_smokeBarrel attachTo [_vehicle, [0, 0, 0], _positionBarrelEnd];
private _effects = [_smokeBarrel];
{
private _position = if (_x != "#noselection") then {
_vehicle selectionPosition _x
} else {
[0, -2, 0]
};
private _smoke = "#particlesource" createVehicleLocal [0, 0, 0];
_smoke setParticleClass "ObjectDestructionSmoke1_2Smallx";
_smoke attachTo [_vehicle, _position];
_effects pushBack _smoke;
} forEach _selections;
_vehicle setVariable [QGVAR(effects), _effects];