From 48a198fea4f68fd096a2fc651601069bafff4255 Mon Sep 17 00:00:00 2001 From: Glowbal Date: Mon, 12 Sep 2016 19:09:11 +0200 Subject: [PATCH 1/4] Add support for disabling cookoff for individual vehicles --- addons/cookoff/XEH_postInit.sqf | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/addons/cookoff/XEH_postInit.sqf b/addons/cookoff/XEH_postInit.sqf index 411f9d5a78..05ffac52a7 100644 --- a/addons/cookoff/XEH_postInit.sqf +++ b/addons/cookoff/XEH_postInit.sqf @@ -22,7 +22,7 @@ GVAR(cacheTankDuplicates) = call CBA_fnc_createNamespace; }; _vehicle addEventHandler ["HandleDamage", { - if (GVAR(enable)) then { + if ((_this select 0) getVariable [QGVAR(enable),GVAR(enable)]) then { ["tank", _this] call FUNC(handleDamage); }; }]; @@ -30,7 +30,7 @@ GVAR(cacheTankDuplicates) = call CBA_fnc_createNamespace; ["Wheeled_APC_F", "init", { (_this select 0) addEventHandler ["HandleDamage", { - if (GVAR(enable)) then { + if ((_this select 0) getVariable [QGVAR(enable),GVAR(enable)]) then { ["tank", _this] call FUNC(handleDamage); }; }]; @@ -38,7 +38,7 @@ GVAR(cacheTankDuplicates) = call CBA_fnc_createNamespace; ["Car", "init", { (_this select 0) addEventHandler ["HandleDamage", { - if (GVAR(enable)) then { + if ((_this select 0) getVariable [QGVAR(enable),GVAR(enable)]) then { ["car", _this] call FUNC(handleDamage); }; }]; @@ -46,14 +46,14 @@ GVAR(cacheTankDuplicates) = call CBA_fnc_createNamespace; // secondary explosions ["AllVehicles", "killed", { - if (GVAR(enable)) then { + if ((_this select 0) getVariable [QGVAR(enable),GVAR(enable)]) then { (_this select 0) call FUNC(secondaryExplosions); }; }, nil, ["Man"]] call CBA_fnc_addClassEventHandler; // blow off turret effect ["Tank", "killed", { - if (GVAR(enable)) then { + if ((_this select 0) getVariable [QGVAR(enable),GVAR(enable)]) then { (_this select 0) call FUNC(blowOffTurret); }; }] call CBA_fnc_addClassEventHandler; From 5134c16dd0244674514cf39f6a713e0edaaf9fdf Mon Sep 17 00:00:00 2001 From: Glowbal Date: Mon, 12 Sep 2016 19:16:37 +0200 Subject: [PATCH 2/4] Add cookoff documentation --- docs/wiki/framework/cookoff-framework.md | 29 ++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 docs/wiki/framework/cookoff-framework.md diff --git a/docs/wiki/framework/cookoff-framework.md b/docs/wiki/framework/cookoff-framework.md new file mode 100644 index 0000000000..2c8f0948af --- /dev/null +++ b/docs/wiki/framework/cookoff-framework.md @@ -0,0 +1,29 @@ +--- +layout: wiki +title: Cook Off Framework +description: Explains the Cook off system for developers & mission makers. +group: framework +order: 5 +parent: wiki +mod: ace +version: + major: 3 + minor: 7 + patch: 0 +--- + +## 1. Disabling / Enabling Cook off for individual vehicles + +You can dynamically enable and/or disable vehicle cook off for individual vehicles by using `setVariable`: + +``` +VEHICLE setVariable ["ace_cookoff_enable", true, true]; +``` + +The above will enable cook off for that specific vehicle, no matter the mission settings. + +Likewise, cook off can also be disabled for a specific vehicle: + +``` +VEHICLE setVariable ["ace_cookoff_enable", false, true]; +``` From 3d1837474735e8b12ee5e30df1f2d82720be0ddf Mon Sep 17 00:00:00 2001 From: commy2 Date: Sat, 17 Sep 2016 17:47:29 +0200 Subject: [PATCH 3/4] add object 3den setting for disabling cook off effects --- addons/cookoff/CfgEden.hpp | 21 +++++++++++++++++++++ addons/cookoff/config.cpp | 1 + 2 files changed, 22 insertions(+) create mode 100644 addons/cookoff/CfgEden.hpp diff --git a/addons/cookoff/CfgEden.hpp b/addons/cookoff/CfgEden.hpp new file mode 100644 index 0000000000..d5b72ab157 --- /dev/null +++ b/addons/cookoff/CfgEden.hpp @@ -0,0 +1,21 @@ + +class Cfg3DEN { + class Object { + class AttributeCategories { + class ace_attributes { + class Attributes { + class GVAR(enable) { + property = QGVAR(enable); + control = "CheckboxInverted"; + displayName = CSTRING(enable_name); + tooltip = CSTRING(enable_tooltip); + expression = QUOTE(if !(_value) then {_this setVariable [ARR_3('%s',_value,true)];};); + typeName = "BOOL"; + condition = "objectVehicle"; + defaultValue = "(true)"; // fix pbo project preprocessing bug + }; + }; + }; + }; + }; +}; diff --git a/addons/cookoff/config.cpp b/addons/cookoff/config.cpp index 902f02740d..cc89a2d917 100644 --- a/addons/cookoff/config.cpp +++ b/addons/cookoff/config.cpp @@ -15,6 +15,7 @@ class CfgPatches { }; #include "ACE_Settings.hpp" +#include "CfgEden.hpp" #include "CfgEventHandlers.hpp" #include "CfgCloudlets.hpp" From e02516e5b516d40c1a1ec5d3f6a026a0ff7e6c65 Mon Sep 17 00:00:00 2001 From: commy2 Date: Sat, 17 Sep 2016 18:08:08 +0200 Subject: [PATCH 4/4] invert reverted inverted --- addons/cookoff/CfgEden.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/cookoff/CfgEden.hpp b/addons/cookoff/CfgEden.hpp index d5b72ab157..1cc406463f 100644 --- a/addons/cookoff/CfgEden.hpp +++ b/addons/cookoff/CfgEden.hpp @@ -6,7 +6,7 @@ class Cfg3DEN { class Attributes { class GVAR(enable) { property = QGVAR(enable); - control = "CheckboxInverted"; + control = "Checkbox"; displayName = CSTRING(enable_name); tooltip = CSTRING(enable_tooltip); expression = QUOTE(if !(_value) then {_this setVariable [ARR_3('%s',_value,true)];};);