From 172da2a632ff2c7c67fdcf85c58aa4f383427008 Mon Sep 17 00:00:00 2001 From: johnb432 <58661205+johnb432@users.noreply.github.com> Date: Sat, 10 Aug 2024 17:54:44 +0200 Subject: [PATCH 1/2] Use `triggerAmmo` instead of `setDamage` --- addons/common/XEH_postInit.sqf | 1 + addons/explosives/CfgAmmo.hpp | 4 ---- addons/explosives/XEH_postInit.sqf | 2 +- docs/wiki/framework/explosives-framework.md | 2 +- 4 files changed, 3 insertions(+), 6 deletions(-) diff --git a/addons/common/XEH_postInit.sqf b/addons/common/XEH_postInit.sqf index 8b7568f75e2..2ed87543fb7 100644 --- a/addons/common/XEH_postInit.sqf +++ b/addons/common/XEH_postInit.sqf @@ -216,6 +216,7 @@ if (isServer) then { [QGVAR(setVectorDirAndUp), {(_this select 0) setVectorDirAndUp (_this select 1)}] call CBA_fnc_addEventHandler; [QGVAR(addWeaponItem), {(_this select 0) addWeaponItem [(_this select 1), (_this select 2)]}] call CBA_fnc_addEventHandler; [QGVAR(removeMagazinesTurret), {(_this select 0) removeMagazinesTurret [_this select 1, _this select 2]}] call CBA_fnc_addEventHandler; +[QGVAR(triggerAmmo), {triggerAmmo _this}] call CBA_fnc_addEventHandler; [QGVAR(setVanillaHitPointDamage), { params ["_object", "_hitPointAnddamage"]; diff --git a/addons/explosives/CfgAmmo.hpp b/addons/explosives/CfgAmmo.hpp index c02885362ee..2d925ba7e60 100644 --- a/addons/explosives/CfgAmmo.hpp +++ b/addons/explosives/CfgAmmo.hpp @@ -28,7 +28,6 @@ class CfgAmmo { class DirectionalBombBase; class ClaymoreDirectionalMine_Remote_Ammo: DirectionalBombBase { GVAR(magazine) = "ClaymoreDirectionalMine_Remote_Mag"; - GVAR(Explosive) = "ClaymoreDirectionalMine_Remote_Ammo_Scripted"; GVAR(size) = 0; GVAR(defuseObjectPosition)[] = {0, 0, 0.038}; soundActivation[] = {"", 0, 0, 0}; @@ -92,7 +91,6 @@ class CfgAmmo { class PipeBombBase; class DemoCharge_Remote_Ammo: PipeBombBase { GVAR(magazine) = "DemoCharge_Remote_Mag"; - GVAR(Explosive) = "DemoCharge_Remote_Ammo_Scripted"; // can probably remove as base ammo now has triggerWhenDestroyed GVAR(size) = 0; GVAR(defuseObjectPosition)[] = {0.07, 0, 0.055}; soundActivation[] = {"", 0, 0, 0}; @@ -103,7 +101,6 @@ class CfgAmmo { }; class SatchelCharge_Remote_Ammo: PipeBombBase { GVAR(magazine) = "SatchelCharge_Remote_Mag"; - GVAR(Explosive) = "SatchelCharge_Remote_Ammo_Scripted"; // can probably remove as base ammo now has triggerWhenDestroyed GVAR(size) = 0; GVAR(defuseObjectPosition)[] = {0.1, 0.1, 0.05}; soundActivation[] = {"", 0, 0, 0}; @@ -171,7 +168,6 @@ class CfgAmmo { // Orange DLC: class APERSMineDispenser_Ammo: PipeBombBase { GVAR(magazine) = "APERSMineDispenser_Mag"; - GVAR(Explosive) = "APERSMineDispenser_Ammo_Scripted"; // triggerWhenDestroyed = 1; GVAR(size) = 0; GVAR(defuseObjectPosition)[] = {0.0, -0.05, 0.15}; }; diff --git a/addons/explosives/XEH_postInit.sqf b/addons/explosives/XEH_postInit.sqf index 81ab1b54069..f47dbbe5bd2 100644 --- a/addons/explosives/XEH_postInit.sqf +++ b/addons/explosives/XEH_postInit.sqf @@ -42,7 +42,7 @@ if (isServer) then { params ["_explosive"]; TRACE_1("exploding",_explosive); if (!isNull _explosive) then { - _explosive setDamage 1; + [QEGVAR(common,triggerAmmo), _explosive, _explosive] call CBA_fnc_targetEvent; }; }, _explosive, _delay] call CBA_fnc_waitAndExecute; }] call CBA_fnc_addEventHandler; diff --git a/docs/wiki/framework/explosives-framework.md b/docs/wiki/framework/explosives-framework.md index 8abffa9448c..86bc03df121 100644 --- a/docs/wiki/framework/explosives-framework.md +++ b/docs/wiki/framework/explosives-framework.md @@ -52,7 +52,7 @@ class CfgAmmo { class SatchelCharge_Remote_Ammo: PipeBombBase { soundActivation[] = {"", 0, 0, 0}; // No sound on activation soundDeactivation[] = {"", 0, 0, 0}; // No sound on deactivation - triggerWhenDestroyed = 1; // (Optional) Explode when the object is shot and destroyed (after being placed) (0-disabled, 1-enabled). + triggerWhenDestroyed = 1; // Explode when the object is shot and destroyed (after being placed) (0-disabled, 1-enabled). Required to be enabled prior to ACE 3.18.0. ACE_explodeOnDefuse = 0.02; // (Optional) Add a chance for the explosive to detonate after being disarmed (in percent) ACE_explosives_defuseObjectPosition[] = {-1.415, 0, 0.12}; // (Optional) The position relative to the model where the defuse helper object will be attached and thus the interaction point will be rendered ACE_explosives_size = 0; // (Optional) Setting to 1 will use a defusal action with a larger radius (useful for large mines or mines with a wide pressure plane trigger area) From f40451708705f64f301f0aceaae0e6b8b0a268d3 Mon Sep 17 00:00:00 2001 From: johnb432 <58661205+johnb432@users.noreply.github.com> Date: Sat, 10 Aug 2024 10:57:34 -0700 Subject: [PATCH 2/2] Update docs/wiki/framework/explosives-framework.md --- docs/wiki/framework/explosives-framework.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/wiki/framework/explosives-framework.md b/docs/wiki/framework/explosives-framework.md index 86bc03df121..f662e7958ed 100644 --- a/docs/wiki/framework/explosives-framework.md +++ b/docs/wiki/framework/explosives-framework.md @@ -52,7 +52,7 @@ class CfgAmmo { class SatchelCharge_Remote_Ammo: PipeBombBase { soundActivation[] = {"", 0, 0, 0}; // No sound on activation soundDeactivation[] = {"", 0, 0, 0}; // No sound on deactivation - triggerWhenDestroyed = 1; // Explode when the object is shot and destroyed (after being placed) (0-disabled, 1-enabled). Required to be enabled prior to ACE 3.18.0. + triggerWhenDestroyed = 1; // (Optional) Explode when the object is shot and destroyed (after being placed) (0-disabled, 1-enabled). Required to be enabled prior to ACE 3.18.0. ACE_explodeOnDefuse = 0.02; // (Optional) Add a chance for the explosive to detonate after being disarmed (in percent) ACE_explosives_defuseObjectPosition[] = {-1.415, 0, 0.12}; // (Optional) The position relative to the model where the defuse helper object will be attached and thus the interaction point will be rendered ACE_explosives_size = 0; // (Optional) Setting to 1 will use a defusal action with a larger radius (useful for large mines or mines with a wide pressure plane trigger area)