From af3c95a5a623bb5c61d9011eb19fa9fde879ebfe Mon Sep 17 00:00:00 2001 From: Dart <59131299+DartRuffian@users.noreply.github.com> Date: Thu, 21 Mar 2024 14:20:23 -0500 Subject: [PATCH] Fire - Add ability to disable screams for individual units (#9863) * Disable screams for individual units * Update addons/fire/XEH_postInit.sqf * Changed wording Co-authored-by: johnb432 <58661205+johnb432@users.noreply.github.com> * isGlobal instead of true Co-authored-by: johnb432 <58661205+johnb432@users.noreply.github.com> --------- Co-authored-by: johnb432 <58661205+johnb432@users.noreply.github.com> --- addons/fire/XEH_postInit.sqf | 5 ++--- docs/wiki/framework/fire-framework.md | 9 +++++++++ 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/addons/fire/XEH_postInit.sqf b/addons/fire/XEH_postInit.sqf index 382c06293b..ec40646ca9 100644 --- a/addons/fire/XEH_postInit.sqf +++ b/addons/fire/XEH_postInit.sqf @@ -3,8 +3,8 @@ [QGVAR(burn), FUNC(burn)] call CBA_fnc_addEventHandler; [QGVAR(playScream), { params ["_scream", "_source"]; - // only play sound if enabled in settings - if (GVAR(enableScreams)) then { + // only play sound if enabled in settings and enabled for the unit + if (GVAR(enableScreams) && {_source getVariable [QGVAR(enableScreams), true]}) then { _source say3D _scream; }; }] call CBA_fnc_addEventHandler; @@ -35,4 +35,3 @@ GVAR(fireSources) = [[], nil] call CBA_fnc_hashCreate; }; }] call CBA_fnc_addEventHandler; - diff --git a/docs/wiki/framework/fire-framework.md b/docs/wiki/framework/fire-framework.md index 2236c5a1c8..4f9ecdfdd3 100644 --- a/docs/wiki/framework/fire-framework.md +++ b/docs/wiki/framework/fire-framework.md @@ -37,3 +37,12 @@ Use `CBA_fnc_serverEvent` to use the following features. Events are defined only | Arguments | Type | Optional (default value) ---| --------- | ---- | ------------------------ 0 | Fire source ID | Any | Required + + +## 2. Variables + +Screams can be disabled for an individual unit by setting the `ace_fire_enableScreams` variable on the unit, which can be synced across machines. + +```sqf +_unit setVariable ["ace_fire_enableScreams", false, _isGlobal]; +```