Explosives - Use triggerAmmo instead of setDamage (#10182)

* Use `triggerAmmo` instead of `setDamage`

* Update docs/wiki/framework/explosives-framework.md
This commit is contained in:
johnb432 2024-08-12 15:18:21 +02:00 committed by GitHub
parent 5e65e56c5e
commit f3938ba0cc
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 3 additions and 6 deletions

View File

@ -216,6 +216,7 @@ if (isServer) then {
[QGVAR(setVectorDirAndUp), {(_this select 0) setVectorDirAndUp (_this select 1)}] call CBA_fnc_addEventHandler; [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(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(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), { [QGVAR(setVanillaHitPointDamage), {
params ["_object", "_hitPointAnddamage"]; params ["_object", "_hitPointAnddamage"];

View File

@ -28,7 +28,6 @@ class CfgAmmo {
class DirectionalBombBase; class DirectionalBombBase;
class ClaymoreDirectionalMine_Remote_Ammo: DirectionalBombBase { class ClaymoreDirectionalMine_Remote_Ammo: DirectionalBombBase {
GVAR(magazine) = "ClaymoreDirectionalMine_Remote_Mag"; GVAR(magazine) = "ClaymoreDirectionalMine_Remote_Mag";
GVAR(Explosive) = "ClaymoreDirectionalMine_Remote_Ammo_Scripted";
GVAR(size) = 0; GVAR(size) = 0;
GVAR(defuseObjectPosition)[] = {0, 0, 0.038}; GVAR(defuseObjectPosition)[] = {0, 0, 0.038};
soundActivation[] = {"", 0, 0, 0}; soundActivation[] = {"", 0, 0, 0};
@ -92,7 +91,6 @@ class CfgAmmo {
class PipeBombBase; class PipeBombBase;
class DemoCharge_Remote_Ammo: PipeBombBase { class DemoCharge_Remote_Ammo: PipeBombBase {
GVAR(magazine) = "DemoCharge_Remote_Mag"; GVAR(magazine) = "DemoCharge_Remote_Mag";
GVAR(Explosive) = "DemoCharge_Remote_Ammo_Scripted"; // can probably remove as base ammo now has triggerWhenDestroyed
GVAR(size) = 0; GVAR(size) = 0;
GVAR(defuseObjectPosition)[] = {0.07, 0, 0.055}; GVAR(defuseObjectPosition)[] = {0.07, 0, 0.055};
soundActivation[] = {"", 0, 0, 0}; soundActivation[] = {"", 0, 0, 0};
@ -103,7 +101,6 @@ class CfgAmmo {
}; };
class SatchelCharge_Remote_Ammo: PipeBombBase { class SatchelCharge_Remote_Ammo: PipeBombBase {
GVAR(magazine) = "SatchelCharge_Remote_Mag"; GVAR(magazine) = "SatchelCharge_Remote_Mag";
GVAR(Explosive) = "SatchelCharge_Remote_Ammo_Scripted"; // can probably remove as base ammo now has triggerWhenDestroyed
GVAR(size) = 0; GVAR(size) = 0;
GVAR(defuseObjectPosition)[] = {0.1, 0.1, 0.05}; GVAR(defuseObjectPosition)[] = {0.1, 0.1, 0.05};
soundActivation[] = {"", 0, 0, 0}; soundActivation[] = {"", 0, 0, 0};
@ -171,7 +168,6 @@ class CfgAmmo {
// Orange DLC: // Orange DLC:
class APERSMineDispenser_Ammo: PipeBombBase { class APERSMineDispenser_Ammo: PipeBombBase {
GVAR(magazine) = "APERSMineDispenser_Mag"; GVAR(magazine) = "APERSMineDispenser_Mag";
GVAR(Explosive) = "APERSMineDispenser_Ammo_Scripted"; // triggerWhenDestroyed = 1;
GVAR(size) = 0; GVAR(size) = 0;
GVAR(defuseObjectPosition)[] = {0.0, -0.05, 0.15}; GVAR(defuseObjectPosition)[] = {0.0, -0.05, 0.15};
}; };

View File

@ -42,7 +42,7 @@ if (isServer) then {
params ["_explosive"]; params ["_explosive"];
TRACE_1("exploding",_explosive); TRACE_1("exploding",_explosive);
if (!isNull _explosive) then { if (!isNull _explosive) then {
_explosive setDamage 1; [QEGVAR(common,triggerAmmo), _explosive, _explosive] call CBA_fnc_targetEvent;
}; };
}, _explosive, _delay] call CBA_fnc_waitAndExecute; }, _explosive, _delay] call CBA_fnc_waitAndExecute;
}] call CBA_fnc_addEventHandler; }] call CBA_fnc_addEventHandler;

View File

@ -51,7 +51,7 @@ class CfgAmmo {
class SatchelCharge_Remote_Ammo: PipeBombBase { class SatchelCharge_Remote_Ammo: PipeBombBase {
soundActivation[] = {"", 0, 0, 0}; // No sound on activation soundActivation[] = {"", 0, 0, 0}; // No sound on activation
soundDeactivation[] = {"", 0, 0, 0}; // No sound on deactivation 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; // (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_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_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) 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)