From 517b10844cbb7f6e87d04907bc7c86e8467b8c4c Mon Sep 17 00:00:00 2001 From: Glowbal Date: Thu, 5 May 2016 20:46:01 +0200 Subject: [PATCH 1/2] Add initial port of the cse ied modules --- addons/ieds/$PBOPREFIX$ | 1 + addons/ieds/ACE_Settings.hpp | 8 ++ addons/ieds/CfgEventHandlers.hpp | 19 ++++ addons/ieds/CfgVehicles.hpp | 103 ++++++++++++++++++ addons/ieds/PREP.hpp | 3 + addons/ieds/README.md | 11 ++ addons/ieds/UI/Icon_Module_Headless_ca.paa | Bin 0 -> 5625 bytes addons/ieds/XEH_postInit.sqf | 1 + addons/ieds/XEH_preInit.sqf | 9 ++ addons/ieds/config.cpp | 17 +++ addons/ieds/functions/fnc_createIEDObject.sqf | 71 ++++++++++++ addons/ieds/functions/fnc_moduleInit.sqf | 73 +++++++++++++ addons/ieds/functions/fnc_moduleZeus.sqf | 18 +++ addons/ieds/functions/fnc_onIEDActivated.sqf | 37 +++++++ addons/ieds/functions/script_component.hpp | 1 + addons/ieds/script_component.hpp | 14 +++ addons/ieds/stringtable.xml | 8 ++ 17 files changed, 394 insertions(+) create mode 100644 addons/ieds/$PBOPREFIX$ create mode 100644 addons/ieds/ACE_Settings.hpp create mode 100644 addons/ieds/CfgEventHandlers.hpp create mode 100644 addons/ieds/CfgVehicles.hpp create mode 100644 addons/ieds/PREP.hpp create mode 100644 addons/ieds/README.md create mode 100644 addons/ieds/UI/Icon_Module_Headless_ca.paa create mode 100644 addons/ieds/XEH_postInit.sqf create mode 100644 addons/ieds/XEH_preInit.sqf create mode 100644 addons/ieds/config.cpp create mode 100644 addons/ieds/functions/fnc_createIEDObject.sqf create mode 100644 addons/ieds/functions/fnc_moduleInit.sqf create mode 100644 addons/ieds/functions/fnc_moduleZeus.sqf create mode 100644 addons/ieds/functions/fnc_onIEDActivated.sqf create mode 100644 addons/ieds/functions/script_component.hpp create mode 100644 addons/ieds/script_component.hpp create mode 100644 addons/ieds/stringtable.xml diff --git a/addons/ieds/$PBOPREFIX$ b/addons/ieds/$PBOPREFIX$ new file mode 100644 index 00000000..5a223709 --- /dev/null +++ b/addons/ieds/$PBOPREFIX$ @@ -0,0 +1 @@ +z\acex\addons\ieds diff --git a/addons/ieds/ACE_Settings.hpp b/addons/ieds/ACE_Settings.hpp new file mode 100644 index 00000000..52c61518 --- /dev/null +++ b/addons/ieds/ACE_Settings.hpp @@ -0,0 +1,8 @@ +class ACE_Settings { + class GVAR(Enabled) { + value = 1; + typeName = "BOOL"; + displayName = ECSTRING(common,Enabled); + description = CSTRING(EnabledDesc); + }; +}; diff --git a/addons/ieds/CfgEventHandlers.hpp b/addons/ieds/CfgEventHandlers.hpp new file mode 100644 index 00000000..86491222 --- /dev/null +++ b/addons/ieds/CfgEventHandlers.hpp @@ -0,0 +1,19 @@ +class Extended_PreInit_EventHandlers { + class ADDON { + init = QUOTE(call COMPILE_FILE(XEH_preInit)); + }; +}; + +class Extended_PostInit_EventHandlers { + class ADDON { + init = QUOTE(call COMPILE_FILE(XEH_postInit)); + }; +}; + +class Extended_InitPost_EventHandlers { + class AllVehicles { + class ADDON { + serverInit = QUOTE(_this call FUNC(handleInitPost)); + }; + }; +}; diff --git a/addons/ieds/CfgVehicles.hpp b/addons/ieds/CfgVehicles.hpp new file mode 100644 index 00000000..890d53b4 --- /dev/null +++ b/addons/ieds/CfgVehicles.hpp @@ -0,0 +1,103 @@ +class CfgVehicles { + class ACE_Module; + class GVAR(createIed): ACE_Module { + author = "STR_ACE_common_ACETeam"; + category = "ACE_missionModules"; + displayName = CSTRING(Module); + function = QFUNC(moduleInit); + scope = 2; + isGlobal = 1; // Global + isTriggerActivated = 0; + isDisposable = 0; + // icon = ""; // TODO add module icon + class Arguments { + class typeOfIED { + displayName = "Type"; + description = "The Type of the IED"; + typeName = "NUMBER"; + class values { + class land {name="Normal"; value=0; default=1; }; + class urban {name="Urban"; value=1; }; + }; + }; + + class sizeOfIED { + displayName = "Size"; + description = "The size of the IED"; + typeName = "NUMBER"; + class values { + class small {name="Small"; value=1; default=1; }; + class large {name="Large"; value=0; }; + }; + }; + + class heightOfIED { + displayName = "Height"; + description = "The height that the IED is burried"; + typeName = "NUMBER"; + class values { + class Above {name="Above Ground"; value=0; default=1; }; + class slightly {name="Slightly burried"; value=1; }; + class medium {name="Medium burried"; value=2; }; + class almost {name="Almost burried"; value=3; }; + class fully {name="Fully burried"; value=4; }; + }; + }; + + class iedActivationType { + displayName = "Activation Type"; + description = "How is the IED activated"; + typeName = "NUMBER"; + class values { + class None {name="None"; value=-1; }; + class PressurePlate {name="Pressure Plate"; value=0; default=1;}; + class Radio {name="Radio"; value=1; }; + }; + }; + + class activatedForTargets { + displayName = "Activated for"; + description = "What types is the IED activated for"; + typeName = "NUMBER"; + class values { + class None {name="None"; value=-1; }; + class All {name="Any type"; value=0; default=1;}; + class Vehicles {name="Any Vehicle"; value=1; }; + class Land {name="Ground Vehicles"; value=2; }; + class Air {name="Airial Vehicles"; value=3; }; + class Man {name="Man"; value=4; }; + }; + }; + + class activatedForSides { + displayName = "What sides activate this IED"; + description = "What types is the IED activated for"; + typeName = "NUMBER"; + class values { + class None {name="None"; value=-1; }; + class All {name="Any side"; value=0; default=1; }; + class West {name="BLUFOR"; value=1; }; + class East {name="OpFOR"; value=2; }; + class Ind {name="Independant"; value=3; }; + class Civ {name="Civilian"; value=4; }; + }; + }; + }; + + class ModuleDescription { + description = CSTRING(ModuleDesc); + }; + }; + + class ace_zeus_moduleBase; + class GVAR(moduleCreateIedZeus): ace_zeus_moduleBase { + curatorCanAttach = 1; + displayName = CSTRING(Module); + function = QFUNC(moduleZeus); + // icon = ""; // TODO icon + class ModuleDescription { + description = "Creates an IED on position"; + sync[] = {}; + }; + }; +}; diff --git a/addons/ieds/PREP.hpp b/addons/ieds/PREP.hpp new file mode 100644 index 00000000..dafb2d7e --- /dev/null +++ b/addons/ieds/PREP.hpp @@ -0,0 +1,3 @@ +PREP(createIEDObject); +PREP(moduleInit); +PREP(onIEDActivated); diff --git a/addons/ieds/README.md b/addons/ieds/README.md new file mode 100644 index 00000000..aaceba9e --- /dev/null +++ b/addons/ieds/README.md @@ -0,0 +1,11 @@ +acex_ieds +============ + +Adds IED mission module framework + + +## Maintainers + +The people responsible for merging changes to this component or answering potential questions. + +- [Glowbal](http://github.com/glowbal) diff --git a/addons/ieds/UI/Icon_Module_Headless_ca.paa b/addons/ieds/UI/Icon_Module_Headless_ca.paa new file mode 100644 index 0000000000000000000000000000000000000000..a3e23a8537d9246e68096d9513e9248ef86da652 GIT binary patch literal 5625 zcmeHLO>7%Q6n^8MxJ8X^D!UQ~$cjdS3q2w($g@IqVu>n7*afMoL|t)!L&&KT0?C_J zZIwfb6VYQ-P8Ent+k-i9uu;#5ic_Q@(u$v3AWae4s;Z~od$SvAyS8iLQb>8;AAdVD z@6Gq-&F;L3o2efT0Kcn&A!+ADM^ht*3 ze3s}3oWqGGO_YXV+YB9$f5T!*H2z5BHlxx`7mJ2=*Z5!@hYYK)t3K(-Bo2OFgp6K4 z)g}weqMyp;GR$oEp9ysKhoUA$(ZFxzQpu2B4%-){eFuNI*P)0bdbHN8Kdc|x>%eJJ zfqtbF^bf~>u>Lmtok26mzfqb#IeF-N@mC2lusu

o9-KcPeb-@&hr4x~l#~;BAo9yp0dIx{^#ciGEc6R>C_#*syK0s=Aen6$b zK9>iyk2qxgh46of_6UAu?IHYOpX1-Q$Mgr5`PH+3o&6n*;U9#g^;g;Y>xshc<2%@2 zJF9-5P##H<%)i3kFuw3U?;mfJAd1oEgv8^)vK~n%9;XuJFXsID9P?4iRTMWDjNb@W z8+gNG<&ZNsg)hDk8hB~KpBJpP>psq|kHYrYzSc&rbz`0RyKn$KC0NsJ4#n5BSF^3i7uD{$L+Zo4XU{W{%4>93FkDb#C3?Se5!( zzcGq2_*dzO`lrJ9Ry@AZ+w;Ix;qPL8>~QIdZ{?rL;b8vw-v7^khmSuc@pAW7_n;J9Nk5PKK+#9)UUUT}~H{)OcAz#Un|xVm*Uz&hfct=_r( z!5zlwOeX6!P@bBT*EAef6s%`|3hKuVO?xpMj583?U){pTUff%>_Uy77Pq3^n)M7Ze zJPV;nbu(q`wgS=yd=}fwy+&%Y-M(&_KK6q&62mIn2wls3Y^WriAkE2Uk)?RKTA21A z>i}*q*WTi@tMwI0L%3XfCua8t7+DkQC!P!SWipJ-g~{zSsu$)kWd9&>llr}}=JNVE zvCmnV#Vg`JcrdWnyM32_85T}e|C$Q?s2BFWnND6Oju+cwuQ@YEi8=J&Vs6Xg;Jp9Y zsBq3JB!4+kdBIwX$F(=JMGGrIJQj;EE8^h#DC~P3+gx79HjTCZ@cbn$kiN?3+xYB* z5pNYtCJ1k{Vd>;8jDx&jW%dyW)AJX>TVE*CDP5qd#F%ZHHlfq2YO{CgEeXzy6 zu;SpxHY(TttbFa4$ucJV6oyH`%0&wn`kbx8AS@x_Y=3a|=6&q#k!KmJkOy~2pq>d!B~ dx_0U4GGkU7!w>#E`00DkFO2QkZ5x5V$UQJVxmy4L literal 0 HcmV?d00001 diff --git a/addons/ieds/XEH_postInit.sqf b/addons/ieds/XEH_postInit.sqf new file mode 100644 index 00000000..421c54b4 --- /dev/null +++ b/addons/ieds/XEH_postInit.sqf @@ -0,0 +1 @@ +#include "script_component.hpp" diff --git a/addons/ieds/XEH_preInit.sqf b/addons/ieds/XEH_preInit.sqf new file mode 100644 index 00000000..eed965cb --- /dev/null +++ b/addons/ieds/XEH_preInit.sqf @@ -0,0 +1,9 @@ +#include "script_component.hpp" + +ADDON = false; + +#include "PREP.hpp" + +GVAR(IED_COLLECTION) = []; + +ADDON = true; diff --git a/addons/ieds/config.cpp b/addons/ieds/config.cpp new file mode 100644 index 00000000..81729da1 --- /dev/null +++ b/addons/ieds/config.cpp @@ -0,0 +1,17 @@ +#include "script_component.hpp" + +class CfgPatches { + class ADDON { + units[] = {}; + weapons[] = {}; + requiredVersion = REQUIRED_VERSION; + requiredAddons[] = {"acex_main", "ace_explosives"}; + author[]= {"Glowbal"}; + authorUrl = "https://github.com/glowbal"; + VERSION_CONFIG; + }; +}; + +#include "ACE_Settings.hpp" +#include "CfgEventHandlers.hpp" +#include "CfgVehicles.hpp" diff --git a/addons/ieds/functions/fnc_createIEDObject.sqf b/addons/ieds/functions/fnc_createIEDObject.sqf new file mode 100644 index 00000000..7ad9fc62 --- /dev/null +++ b/addons/ieds/functions/fnc_createIEDObject.sqf @@ -0,0 +1,71 @@ + +#include "script_component.hpp" + +#define LAND_IEDS ["ACE_IEDLandBig_Range", "ACE_IEDLandSmall_Range"] +#define URBAN_IEDS ["ACE_IEDUrbanBig_Range", "ACE_IEDUrbanSmall_Range"] + +params ["_logic"]; + +private ["_logic","_typeOfIED", "_sizeOfIED", "_heightOfIED", "_iedClass", "_iedCreated"]; + +if (isNull _logic) exitwith {}; + +private _typeOfIED = _logic getvariable ["typeOfIED", 0]; +private _sizeOfIED = _logic getvariable ["sizeOfIED", 0]; +private _heightOfIED = _logic getvariable ["heightOfIED", 0]; + +_heightOfIED = switch (_heightOfIED) do { + case 1: {-0.01}; + case 2: {-0.05}; + case 3: {-0.075}; + case 4: {-0.25}; + default {_heightOfIED}; +}; + +private _iedClass = switch (_typeOfIED) do { + case 0: { LAND_IEDS select _sizeOfIED }; + case 1: { URBAN_IEDS select _sizeOfIED }; +}; + +private _iedCreated = _iedClass createVehicle (getPos _logic); + +_iedCreated setPos [getPos _Logic select 0, getPos _Logic select 1, (getPos _Logic select 2) + _heightOfIED]; + +if (_logic getvariable ["iedActivationType", 0] == 0) then { + private _mine = createMine [_iedClass, getPos _iedCreated, [], 0]; + _mine setDir ((getDir _iedCreated)+90); + _iedCreated setvariable [QGVAR(pressurePlate), _mine]; + hideObjectGlobal _mine; +}; + +_logic setvariable [QGVAR(linkedIED), _iedCreated, true]; // TODO do we need a global flag here? +_iedCreated setvariable [QGVAR(linkedIED), _logic, true]; // TODO do we need a global flag here? + +_iedCreated addEventHandler ["Killed", { + params ["_ied", "_killer"]; + + private _logic = _ied getvariable [QGVAR(linkedIED), objNull]; + private _activationType = _logic getvariable ["iedActivationType", 0]; + [_logic] call FUNC(onIEDActivated); + + private _pressurePlate = _ied getvariable [QGVAR(pressurePlate), objNull]; + if (!isNull _pressurePlate) then { + deleteVehicle _pressurePlate; + }; + + if (_activationType == -1) then { + private _iedClass = typeOf _ied; + private _iedPos = getPos _ied; + private _ammoClass = getText(configFile >> "CfgVehicles" >> _iedClass >> "ammo"); + private _dummyIed = _ammoClass createVehicle _iedPos; + _dummyIed setPos _iedPos; + + if (!isNil "ace_frag_fnc_addPfhRound") then { + [objNull, _ammoClass, _dummyIed, true] call ace_frag_fnc_addPfhRound; + }; + _dummyIed setDamage 1; + }; + deleteVehicle _ied; +}]; + +_iedCreated; diff --git a/addons/ieds/functions/fnc_moduleInit.sqf b/addons/ieds/functions/fnc_moduleInit.sqf new file mode 100644 index 00000000..7dc93ee1 --- /dev/null +++ b/addons/ieds/functions/fnc_moduleInit.sqf @@ -0,0 +1,73 @@ +/* + * Author: Glowbal + * + * Arguments: + * 0: + * + * Return Value: + * None + * + * Public: No + */ +#include "script_component.hpp" + +params ["_logic", "_units", "_activated"]; + +if (!local _logic) exitwith {}; + +private _collectObjects = { + params ["_logic"]; + + private _collection = synchronizedObjects _logic; + { + if !(_x in _totalCollection) then { + if (typeOf _x == QGVAR(createIed)) then { + if !(_x getvariable [QGVAR(masterIED), false]) then { + _x setvariable [QGVAR(subIED), true]; + _x setvariable [QGVAR(controlledByIED), _logic]; + _totalCollection pushback _x; + [_x] call _collectObjects; + }; + } else { + if (typeOf _x == "cseModule_triggerManLinkIEDS") then { + _list = _x getvariable ["EnableList",""]; + _list = "[" + _list + "]"; + _parsedList = [] call compile _list; + _triggerManList = (_logic getvariable [QGVAR(triggerManUnits), []]) + _parsedList; + _logic setvariable [QGVAR(triggerManUnits), _triggerManList]; + }; + }; + }; + }foreach _collection; +}; + +if !(_logic getvariable [QGVAR(subIED),false]) then { + _logic setvariable [QGVAR(masterIED), true]; + private _totalCollection = [_logic]; + [_logic] call _collectObjects; + _logic setvariable [QGVAR(collection), _totalCollection]; +}; + +[_logic] call FUNC(createIEDObject); + +private _activatedTargets = switch (_logic getvariable ["activatedForTargets", -1]) do { + case 0: {["CaManBase", "Air", "Car", "Motorcycle", "Tank"]}; + case 1: {["Air", "Car", "Motorcycle", "Tank"]}; + case 2: {["Car", "Motorcycle", "Tank"]}; + case 3: {["Air"]}; + case 4: {["CaManBase"]}; + default {[]}; +}; +_logic setvariable ["activatedForTargets", _activatedTargets]; + +private _activatedSides = switch (_logic getvariable ["activatedForSides", -1]) do { + case 0: {[west, east, independent, civilian, sideEnemy, sideFriendly]}; + case 1: {[west, sideEnemy]}; + case 2: {[east, sideEnemy]}; + case 3: {[independent, sideEnemy]}; + case 4: {[civilian, sideEnemy]}; + default {[]}; +}; + +_logic setvariable ["activatedForSides", _activatedSides, true]; +_logic setvariable ["iedActivationType", _logic getvariable ["iedActivationType", 0], true]; diff --git a/addons/ieds/functions/fnc_moduleZeus.sqf b/addons/ieds/functions/fnc_moduleZeus.sqf new file mode 100644 index 00000000..d25dd45a --- /dev/null +++ b/addons/ieds/functions/fnc_moduleZeus.sqf @@ -0,0 +1,18 @@ +/* + * Author: Glowbal + * + * Arguments: + * 0: + * + * Return Value: + * None + * + * Public: No + */ +#include "script_component.hpp" + +params ["_logic", "_units", "_activated"]; + +if (!local _logic) exitwith {}; + +[_logic] call FUNC(createIEDObject); diff --git a/addons/ieds/functions/fnc_onIEDActivated.sqf b/addons/ieds/functions/fnc_onIEDActivated.sqf new file mode 100644 index 00000000..f94a9f27 --- /dev/null +++ b/addons/ieds/functions/fnc_onIEDActivated.sqf @@ -0,0 +1,37 @@ + +#include "script_component.hpp" + +params ["_logic"]; + +private _originalLogic = _logic; + +private _getMasterIED = { + if (_logic getvariable [QGVAR(subIED),false]) then { + _logic = _logic getvariable [QGVAR(controlledByIED), _logic]; + if (_logic getvariable [QGVAR(subIED),false]) then { + call _getMasterIED; + }; + }; +}; +call _getMasterIED; + +private _chain = _logic getvariable [QGVAR(collection), []]; +{ + private _iedLogic = _x; + if (_iedLogic != _originalLogic) then { + _iedLogic setvariable ["iedActivationType", -1]; // disable all other activation methods, we are blowing the entire chain already anway + }; + + private _trigger = _iedLogic getvariable [QGVAR(linkedIED), objNull]; + if (!(isNull _trigger)) then { + [_iedLogic, _trigger, _logic] spawn { // using a spawn because it doesn't matter to much if an ied isn't detonated at a reliable time + params ["_iedLogic", "_trigger", "_master"]; + if (!isNull _trigger) then { + if ((_iedLogic != _master) && {random(1)>0.1}) then { + uisleep (random(2)); + }; + _trigger setDamage 1; + }; + }; + }; +} forEach _chain; diff --git a/addons/ieds/functions/script_component.hpp b/addons/ieds/functions/script_component.hpp new file mode 100644 index 00000000..75982e07 --- /dev/null +++ b/addons/ieds/functions/script_component.hpp @@ -0,0 +1 @@ +#include "\z\acex\addons\ieds\script_component.hpp" diff --git a/addons/ieds/script_component.hpp b/addons/ieds/script_component.hpp new file mode 100644 index 00000000..2fad71a9 --- /dev/null +++ b/addons/ieds/script_component.hpp @@ -0,0 +1,14 @@ +#define COMPONENT ieds +#include "\z\acex\addons\main\script_mod.hpp" + +#ifdef DEBUG_ENABLED_IEDS + #define DEBUG_MODE_FULL +#endif + +#ifdef DEBUG_SETTINGS_IEDS + #define DEBUG_SETTINGS DEBUG_SETTINGS_IEDS +#endif + +#include "\z\acex\addons\main\script_macros.hpp" + +#define DELAY_DEFAULT 15 diff --git a/addons/ieds/stringtable.xml b/addons/ieds/stringtable.xml new file mode 100644 index 00000000..9fcb37b0 --- /dev/null +++ b/addons/ieds/stringtable.xml @@ -0,0 +1,8 @@ + + + + + Create IED + + + From b3b0ba27cbf74a12bd782d80d0c16e9f0c374d9a Mon Sep 17 00:00:00 2001 From: Glowbal Date: Mon, 3 Oct 2016 22:07:26 +0200 Subject: [PATCH 2/2] Stage work --- addons/ieds/CfgVehicles.hpp | 63 +++++++++++++------ addons/ieds/config.cpp | 4 +- addons/ieds/functions/fnc_createIEDObject.sqf | 10 +-- addons/ieds/functions/fnc_onIEDActivated.sqf | 2 + addons/ieds/script_component.hpp | 6 ++ addons/ieds/stringtable.xml | 45 +++++++++++++ 6 files changed, 106 insertions(+), 24 deletions(-) diff --git a/addons/ieds/CfgVehicles.hpp b/addons/ieds/CfgVehicles.hpp index 890d53b4..03e6c2ba 100644 --- a/addons/ieds/CfgVehicles.hpp +++ b/addons/ieds/CfgVehicles.hpp @@ -1,7 +1,7 @@ class CfgVehicles { class ACE_Module; class GVAR(createIed): ACE_Module { - author = "STR_ACE_common_ACETeam"; + author = ACECSTRING(common,ACETeam); category = "ACE_missionModules"; displayName = CSTRING(Module); function = QFUNC(moduleInit); @@ -10,37 +10,64 @@ class CfgVehicles { isTriggerActivated = 0; isDisposable = 0; // icon = ""; // TODO add module icon - class Arguments { + class Arguments { class typeOfIED { - displayName = "Type"; - description = "The Type of the IED"; + displayName = CSTRING(Type); + description = CSTRING(Type_Description); typeName = "NUMBER"; class values { - class land {name="Normal"; value=0; default=1; }; - class urban {name="Urban"; value=1; }; + class land { + name = CSTRING(Type_Normal); + value = 0; default = 1; + }; + class urban { + name = CSTRING(Type_Urban); + value = 1; + }; }; }; - class sizeOfIED { - displayName = "Size"; - description = "The size of the IED"; + displayName = CSTRING(Size); + description = CSTRING(Size_Description); typeName = "NUMBER"; class values { - class small {name="Small"; value=1; default=1; }; - class large {name="Large"; value=0; }; + class small { + name = CSTRING(Size_Normal); + value = 0; default = 1; + }; + class large { + name = CSTRING(Size_Urban); + value = 1; + }; }; }; class heightOfIED { - displayName = "Height"; - description = "The height that the IED is burried"; + displayName = CSTRING(Height); + description = CSTRING(Height_Description); typeName = "NUMBER"; class values { - class Above {name="Above Ground"; value=0; default=1; }; - class slightly {name="Slightly burried"; value=1; }; - class medium {name="Medium burried"; value=2; }; - class almost {name="Almost burried"; value=3; }; - class fully {name="Fully burried"; value=4; }; + class Above { + name = CSTRING(Height_AboveGround); + value = 0; + default = 1; + }; + class slightly { + name = CSTRING(Height_SlightlyBurried); + value = 1; + }; + class medium { + name = CSTRING(Height_MediumBurried); + value = 2; + }; + class almost { + name = CSTRING(Height_AlmostBurried); + value = 3; + }; + class fully { + name = CSTRING(Height_FullyBurried); + value = 4; + }; }; }; diff --git a/addons/ieds/config.cpp b/addons/ieds/config.cpp index 81729da1..8e9e9208 100644 --- a/addons/ieds/config.cpp +++ b/addons/ieds/config.cpp @@ -2,11 +2,13 @@ class CfgPatches { class ADDON { + name = COMPONENT_NAME; units[] = {}; weapons[] = {}; requiredVersion = REQUIRED_VERSION; requiredAddons[] = {"acex_main", "ace_explosives"}; - author[]= {"Glowbal"}; + author = ACECSTRING(common,ACETeam); + authors[]= {"Glowbal"}; authorUrl = "https://github.com/glowbal"; VERSION_CONFIG; }; diff --git a/addons/ieds/functions/fnc_createIEDObject.sqf b/addons/ieds/functions/fnc_createIEDObject.sqf index 7ad9fc62..c04d941d 100644 --- a/addons/ieds/functions/fnc_createIEDObject.sqf +++ b/addons/ieds/functions/fnc_createIEDObject.sqf @@ -6,8 +6,6 @@ params ["_logic"]; -private ["_logic","_typeOfIED", "_sizeOfIED", "_heightOfIED", "_iedClass", "_iedCreated"]; - if (isNull _logic) exitwith {}; private _typeOfIED = _logic getvariable ["typeOfIED", 0]; @@ -27,13 +25,13 @@ private _iedClass = switch (_typeOfIED) do { case 1: { URBAN_IEDS select _sizeOfIED }; }; -private _iedCreated = _iedClass createVehicle (getPos _logic); - +private _iedCreated = _iedClass createVehicle [0,0,0]; _iedCreated setPos [getPos _Logic select 0, getPos _Logic select 1, (getPos _Logic select 2) + _heightOfIED]; if (_logic getvariable ["iedActivationType", 0] == 0) then { private _mine = createMine [_iedClass, getPos _iedCreated, [], 0]; - _mine setDir ((getDir _iedCreated)+90); + _mine setDir ((getDir _iedCreated) + 90); + _mine setPos _iedCreated; _iedCreated setvariable [QGVAR(pressurePlate), _mine]; hideObjectGlobal _mine; }; @@ -68,4 +66,6 @@ _iedCreated addEventHandler ["Killed", { deleteVehicle _ied; }]; +["acex_iedCreated", [_iedCreated, _typeOfIED, _sizeOfIED, _heightOfIED]] call CBA_fnc_localEvent; + _iedCreated; diff --git a/addons/ieds/functions/fnc_onIEDActivated.sqf b/addons/ieds/functions/fnc_onIEDActivated.sqf index f94a9f27..cbc86f40 100644 --- a/addons/ieds/functions/fnc_onIEDActivated.sqf +++ b/addons/ieds/functions/fnc_onIEDActivated.sqf @@ -24,6 +24,8 @@ private _chain = _logic getvariable [QGVAR(collection), []]; private _trigger = _iedLogic getvariable [QGVAR(linkedIED), objNull]; if (!(isNull _trigger)) then { + ["acex_iedActivated", [_trigger]] call CBA_fnc_localEvent; + [_iedLogic, _trigger, _logic] spawn { // using a spawn because it doesn't matter to much if an ied isn't detonated at a reliable time params ["_iedLogic", "_trigger", "_master"]; if (!isNull _trigger) then { diff --git a/addons/ieds/script_component.hpp b/addons/ieds/script_component.hpp index 2fad71a9..b39c27a2 100644 --- a/addons/ieds/script_component.hpp +++ b/addons/ieds/script_component.hpp @@ -1,6 +1,12 @@ #define COMPONENT ieds +#define COMPONENT_BEAUTIFIED IEDs #include "\z\acex\addons\main\script_mod.hpp" +// #define DEBUG_MODE_FULL +// #define DISABLE_COMPILE_CACHE +// #define CBA_DEBUG_SYNCHRONOUS +// #define ENABLE_PERFORMANCE_COUNTERS + #ifdef DEBUG_ENABLED_IEDS #define DEBUG_MODE_FULL #endif diff --git a/addons/ieds/stringtable.xml b/addons/ieds/stringtable.xml index 9fcb37b0..faedf762 100644 --- a/addons/ieds/stringtable.xml +++ b/addons/ieds/stringtable.xml @@ -4,5 +4,50 @@ Create IED + + Type + + + The Type of the IED + + + Urban + + + Normal + + + Size + + + The Size of the IED + + + Small + + + Large + + + Height + + + The height that the IED is burried + + + Above Ground + + + Slightly burried + + + Medium burried + + + Almost burried + + + Fully burried +