From cc06b37f47adee85c080f55c0c2740a1da1a3e9c Mon Sep 17 00:00:00 2001 From: johnb432 <58661205+johnb432@users.noreply.github.com> Date: Wed, 14 Feb 2024 10:03:03 +0100 Subject: [PATCH] Removed GVAR(enable), added GVAR(enableFire) back --- addons/cookoff/ACE_Settings.hpp | 3 - addons/cookoff/CfgEden.hpp | 10 +-- addons/cookoff/functions/fnc_cookOff.sqf | 7 +- addons/cookoff/functions/fnc_cookOffBox.sqf | 2 +- .../cookoff/functions/fnc_cookOffEffect.sqf | 2 +- .../functions/fnc_detonateAmmunition.sqf | 2 +- .../fnc_detonateAmmunitionServer.sqf | 1 + addons/cookoff/functions/fnc_engineFire.sqf | 4 +- .../cookoff/functions/fnc_engineFireLocal.sqf | 7 +- .../cookoff/functions/fnc_handleDamageBox.sqf | 2 +- addons/cookoff/initSettings.inc.sqf | 6 +- addons/cookoff/stringtable.xml | 88 ++++++++----------- docs/wiki/framework/cookoff-framework.md | 6 +- 13 files changed, 64 insertions(+), 76 deletions(-) diff --git a/addons/cookoff/ACE_Settings.hpp b/addons/cookoff/ACE_Settings.hpp index f60a5276db..37594bed51 100644 --- a/addons/cookoff/ACE_Settings.hpp +++ b/addons/cookoff/ACE_Settings.hpp @@ -1,7 +1,4 @@ class ACE_Settings { - class GVAR(enable) { - movedToSqf = 1; - }; class GVAR(enableAmmobox) { movedToSQF = 1; }; diff --git a/addons/cookoff/CfgEden.hpp b/addons/cookoff/CfgEden.hpp index 1647bd7a6e..f973ef4026 100644 --- a/addons/cookoff/CfgEden.hpp +++ b/addons/cookoff/CfgEden.hpp @@ -3,15 +3,15 @@ class Cfg3DEN { class AttributeCategories { class ace_attributes { class Attributes { - class GVAR(enable) { - property = QGVAR(enable); + class GVAR(enable) { // setting was previously GVAR(enable), so maintain for backwards compatiblity with missions + property = QGVAR(enable); // same as above control = "Checkbox"; - displayName = CSTRING(enable_name); - tooltip = CSTRING(enable_tooltip); + displayName = CSTRING(enableFire_name); + tooltip = CSTRING(enableFire_tooltip); expression = QUOTE(if (!_value) then {_this setVariable [ARR_3('%s',_value,true)]}); typeName = "BOOL"; condition = "objectVehicle"; - defaultValue = QUOTE(GETMVAR(QGVAR(enable),true)); + defaultValue = QUOTE(GETMVAR(QGVAR(enableFire),true)); }; class GVAR(enableAmmoCookoff) { property = QGVAR(enableAmmoCookoff); diff --git a/addons/cookoff/functions/fnc_cookOff.sqf b/addons/cookoff/functions/fnc_cookOff.sqf index fdd4f2b2db..2674998633 100644 --- a/addons/cookoff/functions/fnc_cookOff.sqf +++ b/addons/cookoff/functions/fnc_cookOff.sqf @@ -27,7 +27,7 @@ */ if (!isServer) exitWith {}; -if (!GVAR(enable) || {GVAR(cookoffDuration) == 0}) exitWith {}; +if (!GVAR(enableFire) || {GVAR(cookoffDuration) == 0}) exitWith {}; params [ "_vehicle", @@ -53,7 +53,7 @@ if (_vehicle isKindOf "CAManBase" || {_vehicle isKindOf "StaticWeapon"}) exitWit if (underwater _vehicle || {private _posASL = getPosWorld _vehicle; surfaceIsWater _posASL && {(_posASL select 2) < 0}}) exitWith {}; // Check if cook-off is disabled on vehicle specifically -if !(_vehicle getVariable [QGVAR(enable), true]) exitWith {}; +if !(_vehicle getVariable [QGVAR(enable), true]) exitWith {}; // QGVAR(enable) is API TRACE_2("cooking off",_vehicle,_intensity); TRACE_9("",_source,_instigator,_delayBetweenSmokeAndFire,_ammoDetonationChance,_detonateAfterCookoff,_fireSource,_canRing,_canJet,_maxIntensity); @@ -104,7 +104,8 @@ if (_delayBetweenSmokeAndFire) then { if ( isNull _vehicle || - !GVAR(enable) || + !GVAR(enableFire) || + {!(_vehicle getVariable [QGVAR(enable), true])} || // QGVAR(enable) is API {_intensity <= 1} || {GVAR(cookoffDuration) == 0} || {underwater _vehicle} || diff --git a/addons/cookoff/functions/fnc_cookOffBox.sqf b/addons/cookoff/functions/fnc_cookOffBox.sqf index 4fbc6b66b5..36613f5a7e 100644 --- a/addons/cookoff/functions/fnc_cookOffBox.sqf +++ b/addons/cookoff/functions/fnc_cookOffBox.sqf @@ -1,7 +1,7 @@ #include "..\script_component.hpp" /* * Author: KoffeinFlummi, commy2, kymckay, johnb43 - * Start a cook-off in the given ammo box. + * Start an ammo cook-off in the given ammo box. * * Arguments: * 0: Ammo box diff --git a/addons/cookoff/functions/fnc_cookOffEffect.sqf b/addons/cookoff/functions/fnc_cookOffEffect.sqf index 6f8bd84e04..0ed27dd669 100644 --- a/addons/cookoff/functions/fnc_cookOffEffect.sqf +++ b/addons/cookoff/functions/fnc_cookOffEffect.sqf @@ -1,7 +1,7 @@ #include "..\script_component.hpp" /* * Author: tcvm - * Spawn cook-off effects. + * Spawn cook-off fire effects. * * Arguments: * 0: Vehicle diff --git a/addons/cookoff/functions/fnc_detonateAmmunition.sqf b/addons/cookoff/functions/fnc_detonateAmmunition.sqf index 1aa66b5b87..ac070a79bb 100644 --- a/addons/cookoff/functions/fnc_detonateAmmunition.sqf +++ b/addons/cookoff/functions/fnc_detonateAmmunition.sqf @@ -1,7 +1,7 @@ #include "..\script_component.hpp" /* * Author: johnb43 - * Starts ammunition detonating from an object. + * Starts detonating ammunition from an object (e.g. vehicle or crate). * * Arguments: * 0: Object diff --git a/addons/cookoff/functions/fnc_detonateAmmunitionServer.sqf b/addons/cookoff/functions/fnc_detonateAmmunitionServer.sqf index 7a5a55ebb5..cb904a89db 100644 --- a/addons/cookoff/functions/fnc_detonateAmmunitionServer.sqf +++ b/addons/cookoff/functions/fnc_detonateAmmunitionServer.sqf @@ -37,6 +37,7 @@ if ( {!([GVAR(enableAmmoCookoff), GVAR(enableAmmobox)] select (_object isKindOf "ReammoBox_F"))} || {!(_object getVariable [QGVAR(enableAmmoCookoff), true])} ) exitWith { + // Box cook-off fire ends after the ammo has detonated (vehicle cook-off fire does not depend on the ammo detonation) if (_object isKindOf "ReammoBox_F") then { [QGVAR(cleanupEffects), _object] call CBA_fnc_globalEvent; diff --git a/addons/cookoff/functions/fnc_engineFire.sqf b/addons/cookoff/functions/fnc_engineFire.sqf index 9b7160531e..eae6014ffd 100644 --- a/addons/cookoff/functions/fnc_engineFire.sqf +++ b/addons/cookoff/functions/fnc_engineFire.sqf @@ -1,6 +1,6 @@ #include "..\script_component.hpp" /* - * Author: KoffeinFlummi, commy2 + * Author: KoffeinFlummi, commy2, johnb43 * Start fire in engine block of a car. * * Arguments: @@ -22,7 +22,7 @@ params ["_vehicle"]; // If already smoking, stop if (_vehicle getVariable [QGVAR(isEngineSmoking), false]) exitWith {}; -_vehicle setVariable [QGVAR(isEngineSmoking), true]; +_vehicle setVariable [QGVAR(isEngineSmoking), true, true]; // Spawn engine fire effects on all connected machines private _jipID = [QGVAR(engineFireLocal), [_vehicle, CBA_missionTime + random [ENGINE_FIRE_TIME / 2, ENGINE_FIRE_TIME, ENGINE_FIRE_TIME / 2 * 3]]] call CBA_fnc_globalEventJIP; diff --git a/addons/cookoff/functions/fnc_engineFireLocal.sqf b/addons/cookoff/functions/fnc_engineFireLocal.sqf index 65d1670ed2..a6afb2f8ef 100644 --- a/addons/cookoff/functions/fnc_engineFireLocal.sqf +++ b/addons/cookoff/functions/fnc_engineFireLocal.sqf @@ -1,6 +1,6 @@ #include "..\script_component.hpp" /* - * Author: KoffeinFlummi, commy2 + * Author: KoffeinFlummi, commy2, johnb43 * Start fire in engine block of a car. * * Arguments: @@ -64,9 +64,10 @@ if (hasInterface) then { deleteVehicle _smoke; - if (isNull _vehicle || !isServer) exitWith {}; + if (!isServer || {isNull _vehicle}) exitWith {}; - _vehicle setVariable [QGVAR(isEngineSmoking), nil]; + // Reset variable, so engine can smoke again in the future + _vehicle setVariable [QGVAR(isEngineSmoking), nil, true]; private _jipID = _vehicle getVariable QGVAR(engineFireJipID); diff --git a/addons/cookoff/functions/fnc_handleDamageBox.sqf b/addons/cookoff/functions/fnc_handleDamageBox.sqf index bf52632fe1..7c6e056628 100644 --- a/addons/cookoff/functions/fnc_handleDamageBox.sqf +++ b/addons/cookoff/functions/fnc_handleDamageBox.sqf @@ -1,6 +1,6 @@ #include "..\script_component.hpp" /* - * Author: KoffeinFlummi, commy2 + * Author: KoffeinFlummi, commy2, johnb43 * Handles all incoming damage for boxes. * * Arguments: diff --git a/addons/cookoff/initSettings.inc.sqf b/addons/cookoff/initSettings.inc.sqf index cfcad8c986..2bb5d38e7a 100644 --- a/addons/cookoff/initSettings.inc.sqf +++ b/addons/cookoff/initSettings.inc.sqf @@ -1,11 +1,11 @@ [ - QGVAR(enable), + QGVAR(enableFire), "CHECKBOX", - [LSTRING(enable_name), LSTRING(enable_tooltip)], + [LSTRING(enableFire_name), LSTRING(enableFire_tooltip)], LSTRING(category_displayName), true, 1, - {[QGVAR(enable), _this] call EFUNC(common,cbaSettings_settingChanged)} + {[QGVAR(enableFire), _this] call EFUNC(common,cbaSettings_settingChanged)} ] call CBA_fnc_addSetting; [ diff --git a/addons/cookoff/stringtable.xml b/addons/cookoff/stringtable.xml index a49955ac2b..f02ab25385 100644 --- a/addons/cookoff/stringtable.xml +++ b/addons/cookoff/stringtable.xml @@ -16,65 +16,23 @@ ACE Cook off ACE Vznícení munice - - Enable vehicle cook-off effects + + Enable vehicle cook-off fire - - Enables vehicle cook-off effects (fire and fire sound, but doesn't include ammunition detonations). - - - Enable ammo box cook-off - Habilitar detonación inducida por calor en las cajas de munición - 弾薬箱の誘爆を有効化 - Durchzündung für Munitionskisten ermöglichen - 탄약 상자 쿡오프 현상 활성화 - Aktywuj samozapłon skrzyń z amunicją - Auto-inflammation des caisses de munitions - Abilita esplosione casse munizioni - 開啟彈藥箱殉爆效果 - 开启弹药箱殉爆效果 - Разрешить детонацию ящиков с боеприпасами - Permitir cozinhar caixas de munição - Povolit vynícení munice v krabicích - - - Enables cooking off of ammo boxes. - Habilita la detonación inducida por calor en las cajas de munición - 弾薬箱が誘爆するようになります。 - Ermöglicht Durchzündung von Munitionskisten. - 탄약 상자에 쿡오프 현상을 적용합니다. - Aktywuje samozapłon skrzyń z amunicją - Permet l'auto-inflammation des caisses de munitions. - Abilita l'esplosione di casse di munizioni distrutte. - 開啟彈藥箱殉爆效果 - 开启弹药箱殉爆效果 - Активирует детонацию ящиков с боеприпасами - Permitir que caixas de munição cozinhem. - Zapíná vznícení munice v krabicích. - - - Enable vehicle ammo cook-off - - - Enables cooking off of vehicle ammunition. Fires ammunition projectiles while vehicle has ammunition remaining. + + Enables vehicle cook-off fire effects.\nThis does NOT include ammunition detonations. - Vehicle cook-off duration multiplier + Vehicle cook-off fire duration multiplier - Multiplier for how long vehicle cook-off lasts.\nSetting to 0 will disable cookoff. - - - Ammo cook-off duration multiplier - - - Multiplier for how long ammunition cook-off lasts, for both vehicles and ammo boxes.\nSetting to 0 will disable ammo cookoff. + Multiplier for how long vehicle cook-off fire lasts.\nSetting to 0 will disable vehicle cook-off fire. - Vehicle cook-off probability multiplier + Vehicle cook-off fire probability multiplier - Multiplier for vehicle cook-off probability. Higher value results in higher cook-off probability.\nSetting to 0 will disable cookoff. + Multiplier for vehicle cook-off fire probability. Higher value results in higher cook-off probability.\nSetting to 0 will disable vehicle cook-off fire. Destroy vehicles after cook-off @@ -99,6 +57,36 @@ Contrôle si les véhicules seront toujours détruits après l'auto-inflammation. Define se os veículos serão sempre destruídos após cozinhamento. + + Enable vehicle ammo cook-off + + + Enables cooking off of vehicle ammunition. Fires ammunition projectiles while vehicle has ammunition remaining.\nThis does NOT include fire effects. + + + Enable ammo box cook-off + Habilitar detonación inducida por calor en las cajas de munición + 弾薬箱の誘爆を有効化 + Durchzündung für Munitionskisten ermöglichen + 탄약 상자 쿡오프 현상 활성화 + Aktywuj samozapłon skrzyń z amunicją + Auto-inflammation des caisses de munitions + Abilita esplosione casse munizioni + 開啟彈藥箱殉爆效果 + 开启弹药箱殉爆效果 + Разрешить детонацию ящиков с боеприпасами + Permitir cozinhar caixas de munição + Povolit vynícení munice v krabicích + + + Enables cooking off of ammo boxes.\nThis does NOT include fire effects. + + + Ammo cook-off duration multiplier + + + Multiplier for how long ammunition cook-off lasts, for both vehicles and ammo boxes.\nSetting to 0 will disable ammo cook-off for both vehicles and ammo boxes. + Enable ammo removal during cook-off 誘爆中の弾薬除去を有効/無効にする diff --git a/docs/wiki/framework/cookoff-framework.md b/docs/wiki/framework/cookoff-framework.md index 6b8f26182c..8129699154 100644 --- a/docs/wiki/framework/cookoff-framework.md +++ b/docs/wiki/framework/cookoff-framework.md @@ -12,9 +12,9 @@ version: patch: 0 --- -## 1. Disabling cook-off for individual vehicles +## 1. Disabling cook-off fire for individual vehicles -Cook-off can be disabled for a specific vehicle. "Cook-off" refers to the fire effects (visual & sounds) that happen when a vehicle is cooking off: +Cook-off fire can be disabled for a specific vehicle (does not affect ammo cook-off): ``` _vehicle setVariable ["ace_cookoff_enable", false, true]; @@ -24,7 +24,7 @@ Mission settings will always apply however, so you can't enable cook-off on a ve ## 2. Disabling ammunition cook-off for individual vehicles and boxes -Ammunition cook-off can be disabled for a specific vehicle or box. "Ammunition cook-off" refers to the ammunition exploding in a burning vehicle: +Ammunition cook-off can be disabled for a specific vehicle or box (does not affect cook-off fire): ``` _vehicleOrBox setVariable ["ace_cookoff_enableAmmoCookoff", false, true];