diff --git a/addons/explosives/CfgVehicles.hpp b/addons/explosives/CfgVehicles.hpp index 585066370c..b6421a4730 100644 --- a/addons/explosives/CfgVehicles.hpp +++ b/addons/explosives/CfgVehicles.hpp @@ -341,8 +341,18 @@ class CfgVehicles { // Editor placed mines class MineBase; + class SatchelCharge_F: MineBase { + GVAR(magazine) = "SatchelCharge_Remote_Mag"; + }; + class DemoCharge_F: MineBase { + GVAR(magazine) = "DemoCharge_Remote_Mag"; + }; + class Claymore_F: MineBase { + GVAR(magazine) = "ClaymoreDirectionalMine_Remote_Mag"; + }; class SLAMDirectionalMine: MineBase { displayName = CSTRING(Module_SLAMSideAttack_DisplayName); + GVAR(magazine) = "SLAMDirectionalMine_Wire_Mag"; }; class ACE_SLAMBottomMine: SLAMDirectionalMine { author = ECSTRING(common,aceteam); @@ -350,28 +360,41 @@ class CfgVehicles { displayName = CSTRING(Module_SLAMBottomAttack_DisplayName); // TODO: Find a way to place the mine laying down instead of standing up }; - class IEDUrbanBig_F; + + class IEDUrbanBig_F: MineBase { + GVAR(magazine) = "IEDUrbanBig_Remote_Mag"; + }; class ACE_IEDUrbanBig_Range: IEDUrbanBig_F { author = ECSTRING(common,aceteam); ammo = "ACE_IEDUrbanBig_Range_Ammo"; + GVAR(magazine) = "IEDUrbanBig_Remote_Mag"; displayName = CSTRING(Module_IEDUrbanBig_Range_DisplayName); }; - class IEDLandBig_F; + class IEDLandBig_F: MineBase { + GVAR(magazine) = "IEDLandBig_Remote_Mag"; + }; class ACE_IEDLandBig_Range: IEDLandBig_F { author = ECSTRING(common,aceteam); ammo = "ACE_IEDLandBig_Range_Ammo"; + GVAR(magazine) = "IEDLandBig_Remote_Mag"; displayName = CSTRING(Module_IEDLandBig_Range_DisplayName); }; - class IEDUrbanSmall_F; + class IEDUrbanSmall_F: MineBase { + GVAR(magazine) = "IEDUrbanSmall_Remote_Mag"; + }; class ACE_IEDUrbanSmall_Range: IEDUrbanSmall_F { author = ECSTRING(common,aceteam); ammo = "ACE_IEDUrbanSmall_Range_Ammo"; + GVAR(magazine) = "IEDUrbanSmall_Remote_Mag"; displayName = CSTRING(Module_IEDUrbanSmall_Range_DisplayName); }; - class IEDLandSmall_F; + class IEDLandSmall_F: MineBase { + GVAR(magazine) = "IEDLandSmall_Remote_Mag"; + }; class ACE_IEDLandSmall_Range: IEDLandSmall_F { author = ECSTRING(common,aceteam); ammo = "ACE_IEDLandSmall_Range_Ammo"; + GVAR(magazine) = "IEDLandSmall_Remote_Mag"; displayName = CSTRING(Module_IEDLandSmall_Range_DisplayName); }; diff --git a/addons/explosives/CfgWeapons.hpp b/addons/explosives/CfgWeapons.hpp index f6ee8ec65e..1ee76a7964 100644 --- a/addons/explosives/CfgWeapons.hpp +++ b/addons/explosives/CfgWeapons.hpp @@ -15,6 +15,7 @@ class CfgWeapons { model = QUOTE(PATHTOF(data\ace_m57.p3d)); ACE_Range = 250; ACE_Detonator = 1; + GVAR(triggerType) = "Command"; class ItemInfo: ACE_ExplosiveItem { mass = 3; @@ -25,6 +26,7 @@ class CfgWeapons { displayName = CSTRING(M26_displayName); picture = PATHTOF(Data\UI\MK26_Transmitter_ca.paa); ACE_Range = 5000; + GVAR(triggerType) = "MK16_Transmitter"; }; class ACE_DefusalKit: ACE_ItemCore { scope = 2; @@ -46,6 +48,7 @@ class CfgWeapons { model = "\A3\weapons_F\ammo\mag_univ.p3d"; ACE_Range = 100; ACE_Detonator = 1; + GVAR(triggerType) = "DeadManSwitch"; class ItemInfo: ACE_ExplosiveItem { mass = 2; @@ -60,6 +63,7 @@ class CfgWeapons { model = "\A3\weapons_F\ammo\mag_univ.p3d"; ACE_Range = 15000; ACE_Detonator = 1; + GVAR(triggerType) = "Cellphone"; class ItemInfo: ACE_ExplosiveItem { mass = 2; diff --git a/addons/explosives/functions/fnc_connectExplosive.sqf b/addons/explosives/functions/fnc_connectExplosive.sqf new file mode 100644 index 0000000000..bc9680e68c --- /dev/null +++ b/addons/explosives/functions/fnc_connectExplosive.sqf @@ -0,0 +1,27 @@ +/* + * Author: VKing + * Add preplaced explosives to a unit's detonator. + * + * Arguments: + * 0: Unit + * 1: Explosive object + * 2: Detonator type + * + * Return Value: + * None + * + * Example: + * [player, claymore1, "ACE_Clacker"] call ace_explosives_fnc_connectExplosive + * + * Public: Yes + */ +#include "script_component.hpp" + +params ["_unit", "_object", "_detonator"]; +TRACE_3("Params",_unit,_object,_detonator); + +private _detonatorConfig = getText (configFile >> "CfgWeapons" >> _detonator >> QGVAR(triggerType)); + +private _magazineClass = getText (configFile >> "CfgVehicles" >> typeOf _object >> QGVAR(magazine)); + +[_unit, _object, _magazineClass, [configFile >> "ACE_Triggers" >> _detonatorConfig]] call FUNC(addClacker);