Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Explosives - Use triggerAmmo instead of setDamage #10182

Merged
merged 2 commits into from
Aug 12, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions addons/common/XEH_postInit.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -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"];
Expand Down
4 changes: 0 additions & 4 deletions addons/explosives/CfgAmmo.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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};
Expand Down Expand Up @@ -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};
Expand All @@ -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};
Expand Down Expand Up @@ -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};
};
Expand Down
2 changes: 1 addition & 1 deletion addons/explosives/XEH_postInit.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion docs/wiki/framework/explosives-framework.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
johnb432 marked this conversation as resolved.
Show resolved Hide resolved
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)
Expand Down