diff --git a/addons/aiaircommander/functions/fnc_handleDelete.sqf b/addons/aiaircommander/functions/fnc_handleDelete.sqf index f62f83a6d..95aba725f 100644 --- a/addons/aiaircommander/functions/fnc_handleDelete.sqf +++ b/addons/aiaircommander/functions/fnc_handleDelete.sqf @@ -14,7 +14,5 @@ */ params ["_leader"]; -// TODO: Change this to use a common component for spawned AI deletion - -(_leader getVariable [QEGVAR(common,assignedVehicle), objNull]) call CBA_fnc_deleteEntity; +(vehicle _leader) call CBA_fnc_deleteEntity; (group _leader) call CBA_fnc_deleteEntity; diff --git a/addons/ailogistics/$PBOPREFIX$ b/addons/ailogistics/$PBOPREFIX$ new file mode 100644 index 000000000..cd6eba65b --- /dev/null +++ b/addons/ailogistics/$PBOPREFIX$ @@ -0,0 +1 @@ +u\uksf\addons\ailogistics diff --git a/addons/ailogistics/Cfg3den.hpp b/addons/ailogistics/Cfg3den.hpp new file mode 100644 index 000000000..90352dba2 --- /dev/null +++ b/addons/ailogistics/Cfg3den.hpp @@ -0,0 +1,20 @@ +// class Cfg3DEN { +// class Object { +// class AttributeCategories { +// class uksf_attributes { +// class Attributes { +// class GVAR(excluded) { +// property = QGVAR(excluded); +// control = "Checkbox"; +// displayName = QUOTE(Cleanup exclude); +// tooltip = QUOTE(Excludes object from cleanup); +// expression = QUOTE(_this setVariable [ARR_3(QQGVAR(excluded),_value,true)]); +// typeName = "BOOL"; +// defaultValue = "(false)"; +// condition = "1"; +// }; +// }; +// }; +// }; +// }; +// }; diff --git a/addons/ailogistics/README.md b/addons/ailogistics/README.md new file mode 100644 index 000000000..d4e6bc0dd --- /dev/null +++ b/addons/ailogistics/README.md @@ -0,0 +1,3 @@ +# AI Logistics + +An AI system for emulating logistics diff --git a/addons/ailogistics/XEH_postInit.sqf b/addons/ailogistics/XEH_postInit.sqf new file mode 100644 index 000000000..a95438352 --- /dev/null +++ b/addons/ailogistics/XEH_postInit.sqf @@ -0,0 +1,9 @@ +#include "script_component.hpp" + +if (!isServer) exitWith {}; + +if (GVAR(groundVehiclePool) isEqualTo [] && {GVAR(airVehiclePool) isEqualTo [] && {GVAR(counterBatteryUnits) isEqualTo []}}) exitWith { + WARNING("No counter units defined"); +}; + +["UK3CB_BAF_Static_Mortar_Base", "Fired", {call FUNC(selectResponse)}, true, [], true] call CBA_fnc_addClassEventHandler; diff --git a/addons/ailogistics/XEH_preInit.sqf b/addons/ailogistics/XEH_preInit.sqf new file mode 100644 index 000000000..13883dbe2 --- /dev/null +++ b/addons/ailogistics/XEH_preInit.sqf @@ -0,0 +1,18 @@ +#include "script_component.hpp" + +ADDON = false; + +#include "XEH_PREP.hpp" + +// #include "initSettings.sqf" + +GVAR(unitPoolString) = []; +GVAR(logisticVehiclePoolString) = []; +GVAR(routePickets) = false; +GVAR(picketLocations) = []; +GVAR(picketUnitPoolString) = []; +GVAR(picketGroupSize) = 0; +GVAR(logisticsObject) = ObjNull; +GVAR(logisticalVehicleNumber) = 0; + +ADDON = true; diff --git a/addons/ailogistics/initSettings.sqf b/addons/ailogistics/initSettings.sqf new file mode 100644 index 000000000..b84b34a4b --- /dev/null +++ b/addons/ailogistics/initSettings.sqf @@ -0,0 +1,24 @@ +// [ +// QGVAR(enabled), +// "CHECKBOX", +// ["Cleanup", "Enables cleanup of dead units/vehicles"], +// ["UKSF", QUOTE(COMPONENT_BEAUTIFIED)], +// false, +// 1, +// { +// params ["_value"]; + +// if (isServer && _value) then { +// [{call FUNC(cleanupCheck)}, [], 0] call CBA_fnc_waitAndExecute; +// }; +// } +// ] call CBA_settings_fnc_init; + +// [ +// QGVAR(delay), +// "SLIDER", +// ["Cleanup Delay", "Delay in seconds between death and cleanup"], +// ["UKSF", QUOTE(COMPONENT_BEAUTIFIED)], +// [5, 600, 300, 0], +// 1 +// ] call CBA_settings_fnc_init; diff --git a/addons/ied/$PBOPREFIX$ b/addons/ied/$PBOPREFIX$ deleted file mode 100644 index 452fa1b1a..000000000 --- a/addons/ied/$PBOPREFIX$ +++ /dev/null @@ -1 +0,0 @@ -u\uksf\addons\ied diff --git a/addons/ied/CfgEventHandlers.hpp b/addons/ied/CfgEventHandlers.hpp deleted file mode 100644 index 0d3301d6e..000000000 --- a/addons/ied/CfgEventHandlers.hpp +++ /dev/null @@ -1,17 +0,0 @@ -class Extended_PreStart_EventHandlers { - class ADDON { - init = QUOTE(call COMPILE_FILE(XEH_preStart)); - }; -}; - -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)); - }; -}; diff --git a/addons/ied/CfgVehicles.hpp b/addons/ied/CfgVehicles.hpp deleted file mode 100644 index 44116ed22..000000000 --- a/addons/ied/CfgVehicles.hpp +++ /dev/null @@ -1,199 +0,0 @@ -class CfgVehicles { - class Module_F; - class GVAR(module) : Module_F { - scope = 1; - is3DEN = 1; - functionPriority = 1; - category = EGVAR(common,eden); - class AttributesBase; - }; - - // static IEDs - class GVAR(IEDPlacementModule) : GVAR(module) { - scope = 2; - displayName = "(IED) IED Placement Zone"; - // icon = "a3\ui_f\data\gui\cfg\hints\ieds_ca.paa"; - // portrait = "a3\ui_f\data\gui\cfg\hints\ieds_ca.paa"; - canSetArea = 1; - canSetAreaHeight = 0; - canSetAreaShape = 1; - function = QFUNC(moduleIEDArea); - class AttributeValues { - size3[] = { 500, 500, -1 }; - isRectangle = 0; - }; - class Attributes : AttributesBase { - class GVAR(iedClasses) { - property = QGVAR(iedClasses); - displayName = "IED Classnames"; - tooltip = "IED class list, use magazine classnames. IED classname in eden doesn't work. Comma-separated list of class names in single quotes, no spaces"; - control = "Edit"; - defaultValue = "['IEDLandBig_Remote_Mag','IEDLandSmall_Remote_Mag','IEDUrbanSmall_Remote_Mag']"; - expression = QUOTE(_this setVariable [ARR_3(QQGVAR(iedClasses),_value,true)]); - }; - class GVAR(iedNumber) { - property = QGVAR(iedNumber); - displayName = "Number of IEDs"; - tooltip = "Number of IEDs to place on and/or near roads."; - control = "EditShort"; - validate = "NUMBER"; - defaultValue = "50"; - expression = QUOTE(_this setVariable [ARR_3(QQGVAR(iedNumber),_value,true)]); - }; - class GVAR(useRoads) { - property = QGVAR(useRoads); - displayName = "Use roads"; - tooltip = "Tick to place IEDs only on or next to roads."; - control = "Checkbox"; - defaultValue = true; - expression = QUOTE(_this setVariable [ARR_3(QQGVAR(useRoads),_value,true)]); - }; - class GVAR(iedHideChance) { - property = QGVAR(iedHideChance); - displayName = "IED Hidden Chance"; - tooltip = "Chance that an IED will be hidden under another object such as a cart. Only happens on IEDs at the side of the road. Set to 0 for no cover."; - control = "Slider"; - defaultValue = "0.2"; - expression = QUOTE(_this setVariable [ARR_3(QQGVAR(iedHideChance),_value,true)]); - }; - class GVAR(iedHideClasses) { - property = QGVAR(iedHideClasses); - displayName = "IED Hiding Classnames"; - tooltip = "Classnames of items to hide IEDs under. Comma-separated list of class names in single quotes, no spaces"; - control = "Edit"; - defaultValue = "[]"; - expression = QUOTE(_this setVariable [ARR_3(QQGVAR(iedHideClasses),_value,true)]); - }; - class GVAR(iedSecondaryChance) { - property = QGVAR(iedSecondaryChance); - displayName = "Chance of secondary IEDs"; - tooltip = "Chance that an IED will have secondary IEDs nearby."; - control = "Slider"; - defaultValue = "0.2"; - expression = QUOTE(_this setVariable [ARR_3(QQGVAR(iedSecondaryChance),_value,true)]); - }; - class GVAR(useIEDPlanters) { - property = QGVAR(useIEDPlanters); - displayName = "Use IED Planters"; - tooltip = "Tick to for units to place IEDs. Synchronized objects will become planters."; - control = "Checkbox"; - defaultValue = false; - expression = QUOTE(_this setVariable [ARR_3(QQGVAR(useIEDPlanters),_value,true)]); - }; - class GVAR(IEDPlanterBackpackClasses) { - property = QGVAR(IEDPlanterBackpackClasses); - displayName = "Backpack Classnames"; - tooltip = "Backpack classnames for the planter. Comma-separated list of class names in single quotes, no spaces"; - control = "Edit"; - defaultValue = "[]"; - expression = QUOTE(_this setVariable [ARR_3(QQGVAR(IEDPlanterBackpackClasses),_value,true)]); - }; - }; - }; - - - // suicide IEDs - class GVAR(suicidePlacementModule) : GVAR(module) { - scope = 2; - displayName = "(IED) Suicide IED Placement Zone"; - canSetArea = 1; - canSetAreaHeight = 0; - canSetAreaShape = 1; - // icon = "a3\ui_f\data\gui\cfg\hints\ieds_ca.paa"; - // portrait = "a3\ui_f\data\gui\cfg\hints\ieds_ca.paa"; - function = QFUNC(moduleSuicideIEDArea); - - class Attributes : AttributesBase { - class GVAR(suicideIEDClasses) { - property = QGVAR(suicideIEDClasses); - displayName = "Suicide Classnames"; - tooltip = "Civ/Soldier classnames to use for IEDs. Comma-separated list of class names in single quotes, no spaces"; - control = "Edit"; - defaultValue = "[]"; - expression = QUOTE(_this setVariable [ARR_3(QQGVAR(suicideIEDClasses),_value,true)]); - }; - class GVAR(suicideIEDItemClasses) { - property = QGVAR(suicideIEDItemClasses); - displayName = "Suicide Backpack Classnames"; - tooltip = "Backpack classnames for bombers not in cars. Comma-separated list of class names in single quotes, no spaces"; - control = "Edit"; - defaultValue = "[]"; - expression = QUOTE(_this setVariable [ARR_3(QQGVAR(suicideIEDItemClasses),_value,true)]); - }; - class GVAR(suicideIEDInCarBoolean) { - property = QGVAR(suicideIEDInCarBoolean); - displayName = "Use vehicle"; - tooltip = "Tick for suicide bombers to be in cars. Note they are placed at the start of a mission."; - control = "Checkbox"; - defaultValue = true; - expression = QUOTE(_this setVariable [ARR_3(QQGVAR(suicideIEDInCarBoolean),_value,true)]); - }; - class GVAR(suicideIEDVehicleClasses) { - property = QGVAR(suicideIEDVehicleClasses); - displayName = "Vehicle classes"; - tooltip = "Vehicles for suicide bombers. Comma-separated list of class names in single quotes, no spaces"; - control = "Edit"; - defaultValue = "[]"; - expression = QUOTE(_this setVariable [ARR_3(QQGVAR(suicideIEDVehicleClasses),_value,true)]); - }; - }; - }; - - // VBIED - class GVAR(VBIEDPlacementModule) : GVAR(module) { - scope = 2; - displayName = "(IED) VBIED Placement Zone"; - // icon = "a3\ui_f\data\gui\cfg\hints\ieds_ca.paa"; - // portrait = "a3\ui_f\data\gui\cfg\hints\ieds_ca.paa"; - canSetArea = 1; - canSetAreaHeight = 0; - canSetAreaShape = 1; - function = QFUNC(moduleVBIEDArea); - class AttributeValues { - size3[] = { 500, 500, -1 }; - isRectangle = 0; - }; - class Attributes : AttributesBase { - class GVAR(VBIEDVehicleClasses) { - property = QGVAR(VBIEDVehicleClasses); - displayName = "VBIED Classnames"; - tooltip = "Vehicle classnames to use for IEDs. Comma-separated list of class names in single quotes, no spaces"; - control = "Edit"; - defaultValue = "[]"; - expression = QUOTE(_this setVariable [ARR_3(QQGVAR(VBIEDVehicleClasses),_value,true)]); - }; - class GVAR(VBIEDNumber) { - property = QGVAR(VBIEDNumber); - displayName = "Number of Vehicles"; - tooltip = "Number of vehicles to place on and/or near roads."; - control = "EditShort"; - validate = "NUMBER"; - defaultValue = "15"; - expression = QUOTE(_this setVariable [ARR_3(QQGVAR(VBIEDNumber),_value,true)]); - }; - class GVAR(VBIEDChance) { - property = QGVAR(VBIEDChance); - displayName = "VBIED Chance"; - tooltip = "Chance that a vehicle will be a VBIED."; - control = "Slider"; - defaultValue = "0.2"; - expression = QUOTE(_this setVariable [ARR_3(QQGVAR(VBIEDChance),_value,true)]); - }; - }; - }; - - class GVAR(IEDExclusionModule) : GVAR(module) { - scope = 2; - displayName = "(IED) IED Exclusion Zone"; - //icon = "a3\ui_f\data\gui\cfg\hints\ieds_ca.paa"; - //portrait = "a3\ui_f\data\gui\cfg\hints\ieds_ca.paa"; - canSetArea = 1; - canSetAreaHeight = 0; - canSetAreaShape = 1; - function = QFUNC(moduleIEDExcludeArea); - class AttributeValues { - size3[] = { 500, 500, -1 }; - isRectangle = 0; - }; - }; -}; diff --git a/addons/ied/README.md b/addons/ied/README.md deleted file mode 100644 index 07515b5e4..000000000 --- a/addons/ied/README.md +++ /dev/null @@ -1,3 +0,0 @@ -# IED - -Creates IEDs / VBIEDs / Suicide IEDs in defined areas. Contains an additional option to add IED layers who will lay additional IEDs. diff --git a/addons/ied/XEH_PREP.hpp b/addons/ied/XEH_PREP.hpp deleted file mode 100644 index 9e149ebd4..000000000 --- a/addons/ied/XEH_PREP.hpp +++ /dev/null @@ -1,9 +0,0 @@ -PREP(getRoadSide); -PREP(setWaypoint); -PREP(moduleIEDArea); -PREP(moduleVBIEDArea); -PREP(moduleIEDExcludeArea); -PREP(moduleSuicideIEDArea); -PREP(IEDPlanters); -PREP(setWaypointPlanter); -PREP(layIED); diff --git a/addons/ied/XEH_postInit.sqf b/addons/ied/XEH_postInit.sqf deleted file mode 100644 index 421c54b49..000000000 --- a/addons/ied/XEH_postInit.sqf +++ /dev/null @@ -1 +0,0 @@ -#include "script_component.hpp" diff --git a/addons/ied/XEH_preInit.sqf b/addons/ied/XEH_preInit.sqf deleted file mode 100644 index 9d20646d2..000000000 --- a/addons/ied/XEH_preInit.sqf +++ /dev/null @@ -1,12 +0,0 @@ -#include "script_component.hpp" - -ADDON = false; - -#include "XEH_PREP.hpp" - -#include "initSettings.sqf" - -// code here -GVAR(iedExcludeAreas) = []; - -ADDON = true; diff --git a/addons/ied/XEH_preStart.sqf b/addons/ied/XEH_preStart.sqf deleted file mode 100644 index 022888575..000000000 --- a/addons/ied/XEH_preStart.sqf +++ /dev/null @@ -1,3 +0,0 @@ -#include "script_component.hpp" - -#include "XEH_PREP.hpp" diff --git a/addons/ied/config.cpp b/addons/ied/config.cpp deleted file mode 100644 index 265166fb1..000000000 --- a/addons/ied/config.cpp +++ /dev/null @@ -1,24 +0,0 @@ -#include "script_component.hpp" - -class CfgPatches { - class ADDON { - name = COMPONENT_NAME; - units[] = { - QGVAR(IEDPlacementModule), - QGVAR(suicidePlacementModule), - QGVAR(IEDExclusionModule) - }; - weapons[] = {}; - requiredVersion = REQUIRED_VERSION; - requiredAddons[] = { - "uksf_common" - }; - author = QUOTE(UKSF); - authors[] = { "Bridg" }; - url = URL; - VERSION_CONFIG; - }; -}; - -#include "CfgEventHandlers.hpp" -#include "CfgVehicles.hpp" diff --git a/addons/ied/functions/fnc_IEDPlanters.sqf b/addons/ied/functions/fnc_IEDPlanters.sqf deleted file mode 100644 index 665904372..000000000 --- a/addons/ied/functions/fnc_IEDPlanters.sqf +++ /dev/null @@ -1,39 +0,0 @@ -#include "script_component.hpp" -/* - Author: - Bridg - - Description: - Sets synchronizedObjects to be IED planters. - They'll move to random locations and plant IEDs. - The nearest building will be classed as their 'home' and is where they'll return to after laying IEDs. - - Parameters: - 0: logic - 1: area - 2: planterBackpacks - - Return value: - Nothing -*/ - -params ["_module", "_area", "_planterBackpacks"]; - -if (!(local _module)) exitWith {}; - -{ - private _planterHome = nearestBuilding _x; - - if (_planterHome == objNull) exitWith {diag_log format ["(UKSF IED ERROR): %1 at position %2 has no nearby building", _x, getPos _x]}; - - _x setVariable [QGVAR(planterHome), _planterHome]; - - // stored on planter for use in waypoints - _x setVariable [QGVAR(moduleObject), _module, true]; - _x setVariable [QGVAR(area), _area, true]; - - removeGoggles _x; - _x addBackpack (selectRandom _planterBackpacks); - - [_x] call FUNC(setWaypointPlanter); -} forEach (synchronizedObjects _module); diff --git a/addons/ied/functions/fnc_getRoadSide.sqf b/addons/ied/functions/fnc_getRoadSide.sqf deleted file mode 100644 index eafad1d58..000000000 --- a/addons/ied/functions/fnc_getRoadSide.sqf +++ /dev/null @@ -1,29 +0,0 @@ -#include "script_component.hpp" - -/* - Author: - Nicholas Clark (SENSEI) - - Description: - find positionAGL at roadside - - Parameters: - 0: road - 1: offset distance from roadside - - Return value: - position -*/ - -params [ - ["_road",objNull,[objNull]], - ["_offset",0,[0]] -]; - -private _info = getRoadInfo _road; -private _dir = (_info select 6) getDir (_info select 7); -_dir = _dir + (180 * round (random 1)); - -private _position = _road getRelPos [((_info select 1) * 0.5) + _offset, _dir + 90]; - -[_position, _dir] diff --git a/addons/ied/functions/fnc_layIED.sqf b/addons/ied/functions/fnc_layIED.sqf deleted file mode 100644 index 9ae697c19..000000000 --- a/addons/ied/functions/fnc_layIED.sqf +++ /dev/null @@ -1,35 +0,0 @@ -#include "script_component.hpp" -/* - Author: - Bridg - - Description: - animates the planter and lays the IED. - - Parameters: - 0: planter - - Return value: - Nothing -*/ -params ["_planter"]; - -if (!local _planter) exitWith {}; - -// _planter playMoveNow 'AinvPpneMstpSnonWnonDnon_Putdown_AmovPpneMstpSnonWnonDnon'; -[_planter, "KNEEL_TREAT2", "ASIS"] call BIS_fnc_ambientAnim; -_planter removeItem 'IEDUrbanSmall_Remote_Mag'; -private _planterDir = getDir _planter; -private _iedPos = _planter getPos [1.1, _planterDir]; -[{ - params ["_planter", "_iedPos"]; - // plant IED 1m to front of planter - ([objNull, _iedPos, random 360, "IEDUrbanSmall_Remote_Mag", "PressurePlate", []] call ACE_Explosives_fnc_placeExplosive) params ["_explosive"]; - _explosive setVectorUp surfaceNormal position _explosive; - EAST revealMine _explosive; - CIVILIAN revealMine _explosive; - INDEPENDENT revealMine _explosive; - _planter call BIS_fnc_ambientAnim__terminate; -}, [_planter, _iedPos], 20] call cba_fnc_waitAndExecute; - - diff --git a/addons/ied/functions/fnc_moduleIEDArea.sqf b/addons/ied/functions/fnc_moduleIEDArea.sqf deleted file mode 100644 index 6da4ec4c5..000000000 --- a/addons/ied/functions/fnc_moduleIEDArea.sqf +++ /dev/null @@ -1,111 +0,0 @@ -#include "script_component.hpp" -/* - Author: - Bridg, Beswick - - Description: - IED area spawning module - - Parameters: - 0: The module logic - - Return value: - Nothing -*/ - -(_this select 1) params ["_logic"]; - -if !(isServer) exitWith {}; - -private _area = _logic getVariable ["objectarea", []]; -if (_area isEqualTo []) exitWith {}; - -// get logic variables -private _numberOfIEDsToSpawn = _logic getVariable [QGVAR(iedNumber), 0]; -private _iedClassesParsed = parseSimpleArray (_logic getVariable [QGVAR(iedClasses), []]); -private _hiddenClassesParsed = parseSimpleArray (_logic getVariable [QGVAR(iedHideClasses), []]); -private _moduleHiddenChance = _logic getVariable [QGVAR(iedHideChance), 0]; -private _moduleSecondaryChance = _logic getVariable [QGVAR(iedSecondaryChance), 0]; -private _useRoads = _logic getVariable [QGVAR(useRoads), true]; -private _usePlanters = _logic getVariable [QGVAR(useIEDPlanters), false]; -private _planterBackpacks = parseSimpleArray (_logic getVariable [QGVAR(IEDPlanterBackpackClasses), []]); - -if (_usePlanters) then { - [_logic, _area, _planterBackpacks] call FUNC(IEDPlanters); -}; - -// creating the IED PFH -[{ - params ["_args", "_idPFH"]; - _args params ["_numberOfIEDsToSpawn", "_logic", "_area", "_iedClassesParsed", "_hiddenClassesParsed", "_moduleHiddenChance", "_moduleSecondaryChance", "_useRoads"]; - - // exit asap - if (_numberOfIEDsToSpawn < 1) then { - [_idPFH] call cba_fnc_removePerFrameHandler; - }; - - // get a position - _area deleteAt 4; - private _areaArray = [(getPos _logic)] + _area; - private _position = [_areaArray] call CBA_fnc_randPosArea; - private _road = [_position] call EFUNC(common,findNearRoad); - - // RNG Values - private _sideOfRoadchance = random 10; - private _hiddenChanceRNG = random 1; - private _secondaryChanceRNG = random 1; - - // allows for reference in other scopes - might be a better way to do this - private _currentExplosive = []; - - // check position isn't in any exclusion area, then continue - if ( - [GVAR(iedExcludeAreas), { - [_position, _x#0, _x#1] call EFUNC(common,objectInArea) - }] call EFUNC(common,arrayNone) - ) then { - if (_useRoads) then { - if (_sideOfRoadchance > 5) then { - ([_road, 1] call FUNC(getRoadSide)) params ["_roadSide", "_dir"]; - ([objNull, _roadSide, _dir, selectRandom _iedClassesParsed, "PressurePlate", []] call ACE_Explosives_fnc_placeExplosive) params ["_explosive"]; - _explosive setVectorUp surfaceNormal position _explosive; - _currentExplosive pushBack _explosive; - INDEPENDENT revealMine _explosive; - CIVILIAN revealMine _explosive; - EAST revealMine _explosive; - - // chance to spawn IED cover object - if (_hiddenChanceRNG < _moduleHiddenChance) then { - private _hideObject = createVehicle [selectRandom _hiddenClassesParsed, _roadSide, [], 0, "CAN_COLLIDE"]; - _hideObject setDir (random 360); - _hideObject setVectorUp surfaceNormal position _hideObject; - _hiddenObject enableSimulationGlobal false; - }; - } else { - ([objNull, getPos _road, random 360, selectRandom _iedClassesParsed, "PressurePlate", []] call ACE_Explosives_fnc_placeExplosive) params ["_explosive"]; - _currentExplosive pushBack _explosive; - INDEPENDENT revealMine _explosive; - CIVILIAN revealMine _explosive; - EAST revealMine _explosive; - }; - } else { - ([objNull, _position, random 360, selectRandom _iedClassesParsed, "PressurePlate", []] call ACE_Explosives_fnc_placeExplosive) params ["_explosive"]; - _currentExplosive pushBack _explosive; - INDEPENDENT revealMine _explosive; - CIVILIAN revealMine _explosive; - EAST revealMine _explosive; - }; - - // create secondary - if (_secondaryChanceRNG < _moduleSecondaryChance) then { - private _randomDistance = random [20,30,40]; - private _secondaryPosition = (_currentExplosive select 0) getPos [_randomDistance, random 360]; // possible place for object check to avoid houses etc? - ([objNull, _secondaryPosition, random 360, selectRandom _iedClassesParsed, "PressurePlate", []] call ACE_Explosives_fnc_placeExplosive) params ["_explosiveSecondary"]; - INDEPENDENT revealMine _explosiveSecondary; - CIVILIAN revealMine _explosiveSecondary; - EAST revealMine _explosiveSecondary; - }; - _currentExplosive deleteAt 0; - _args set [0, _numberOfIEDsToSpawn - 1]; - }; -}, 0.2, [_numberOfIEDsToSpawn, _logic, _area, _iedClassesParsed, _hiddenClassesParsed, _moduleHiddenChance, _moduleSecondaryChance, _useRoads]] call cba_fnc_addPerFrameHandler; diff --git a/addons/ied/functions/fnc_moduleIEDExcludeArea.sqf b/addons/ied/functions/fnc_moduleIEDExcludeArea.sqf deleted file mode 100644 index 13686d498..000000000 --- a/addons/ied/functions/fnc_moduleIEDExcludeArea.sqf +++ /dev/null @@ -1,23 +0,0 @@ -#include "script_component.hpp" -/* - Author: - Bridg, Beswick - - Description: - Adds module area to IED exclude areas - - Parameters: - 0: The module logic - - Return value: - Nothing -*/ - -(_this select 1) params ["_logic"]; - -if (!(local _logic)) exitWith {}; - -private _area = _logic getVariable ["objectarea", []]; -if (_area isEqualTo []) exitWith {}; - -GVAR(iedExcludeAreas) pushBack [_logic, _area]; diff --git a/addons/ied/functions/fnc_moduleSuicideIEDArea.sqf b/addons/ied/functions/fnc_moduleSuicideIEDArea.sqf deleted file mode 100644 index e5ca5a7a2..000000000 --- a/addons/ied/functions/fnc_moduleSuicideIEDArea.sqf +++ /dev/null @@ -1,56 +0,0 @@ -#include "script_component.hpp" -/* - Author: - Bridg, Beswick - - Description: - Suicide area spawning module - - Parameters: - 0: The module logic - - Return value: - Nothing -*/ -(_this select 1) params ["_logic"]; - -if !(isServer) exitWith {}; - -private _area = _logic getVariable ["objectarea", []]; -if (_area isEqualTo []) exitWith {}; - -// GVAR(suicideIEDAreas) pushBack [_logic, _area]; - -// get logic variables - -private _manClassesParsed = parseSimpleArray (_logic getVariable [QGVAR(suicideIEDClasses), []]); -private _suicideItems = parseSimpleArray (_logic getVariable [QGVAR(suicideIEDItemClasses), []]); -private _vehicleClassesParsed = parseSimpleArray (_logic getVariable [QGVAR(suicideIEDVehicleClasses), []]); -private _useVehicle = _logic getVariable [QGVAR(suicideIEDInCarBoolean), false]; - -// get a position -_area deleteAt 4; -private _areaArray = [(getPos _logic)] + _area; -private _position = [_areaArray] call CBA_fnc_randPosArea; - -// create opfor group - civs don't seem to work, need to be enemy -private _group = createGroup EAST; - -private _suicideUnit = _group createUnit [selectRandom _manClassesParsed, _position, [], 0, "NONE"]; -_suicideUnit addBackpack (selectRandom _suicideItems); -[_suicideUnit] join _group; - -// stored variables for the waypoint -_suicideUnit setVariable [QGVAR(sucideUnitGroup), _group, true]; -_suicideUnit setVariable [QGVAR(areaArray), _areaArray, true]; - -if (_useVehicle) exitWith { - private _suicideVehicle = createVehicle [selectRandom _vehicleClassesParsed, _position, [], 0, "NONE"]; - _suicideUnit moveInDriver _suicideVehicle; - [_suicideUnit, false, true] call EFUNC(special,suicide); - [_group, _areaArray] call FUNC(setWaypoint); -}; - - -[_suicideUnit, false, false] call EFUNC(special,suicide); -[_group, _areaArray] call FUNC(setWaypoint); diff --git a/addons/ied/functions/fnc_moduleVBIEDArea.sqf b/addons/ied/functions/fnc_moduleVBIEDArea.sqf deleted file mode 100644 index 26d239ba8..000000000 --- a/addons/ied/functions/fnc_moduleVBIEDArea.sqf +++ /dev/null @@ -1,65 +0,0 @@ -#include "script_component.hpp" -/* - Author: - Bridg, Beswick - - Description: - VBIED area spawning module - - Parameters: - 0: The module logic - - Return value: - Nothing -*/ - - - -(_this select 1) params ["_logic"]; - -if !(isServer) exitWith {}; - -private _area = _logic getVariable ["objectarea", []]; -if (_area isEqualTo []) exitWith {}; - - -// get logic variables -private _numberOfVBIEDsToSpawn = _logic getVariable [QGVAR(VBIEDNumber), 0]; -private _VBIEDVehiclesParsed = parseSimpleArray (_logic getVariable [QGVAR(VBIEDVehicleClasses), []]); -private _moduleVBIEDChance = _logic getVariable [QGVAR(VBIEDChance), 0]; - - -// creating the IED PFH -[{ - params ["_args", "_idPFH"]; - _args params ["_numberOfVBIEDsToSpawn", "_logic", "_area", "_VBIEDVehiclesParsed", "_moduleVBIEDChance"]; - - // exit asap - if (_numberOfVBIEDsToSpawn < 1) then { - { - CIVILIAN revealMine _x; - EAST revealMine _x; - } forEach allMines; - [_idPFH] call cba_fnc_removePerFrameHandler; - }; - - // get a position - _area deleteAt 4; - private _areaArray = [(getPos _logic)] + _area; - private _position = [_areaArray] call CBA_fnc_randPosArea; - private _road = [_position] call EFUNC(common,findNearRoad); - - // check road isn't in any exclusion area, then continue - if ( - [GVAR(iedExcludeAreas), { - [_road, _x#0, _x#1] call EFUNC(common,objectInArea) - }] call EFUNC(common,arrayNone) - ) then { - ([_road, 1] call FUNC(getRoadSide)) params ["_roadSide", "_dir"]; - private _vehicle = createVehicle [selectRandom _VBIEDVehiclesParsed, _roadSide, [], 0, "NONE"]; - _vehicle setDir _dir; - [_vehicle] call EFUNC(special,carBomb); - - _args set [0, _numberOfVBIEDsToSpawn - 1]; - }; -}, 1, [_numberOfVBIEDsToSpawn, _logic, _area, _VBIEDVehiclesParsed, _moduleVBIEDChance]] call cba_fnc_addPerFrameHandler; diff --git a/addons/ied/functions/fnc_setWaypoint.sqf b/addons/ied/functions/fnc_setWaypoint.sqf deleted file mode 100644 index 74e7231ff..000000000 --- a/addons/ied/functions/fnc_setWaypoint.sqf +++ /dev/null @@ -1,20 +0,0 @@ -#include "script_component.hpp" -/* - Author: - Bridg - - Description: - sets up a waypoint inside the area for suicide bombers to follow - - Parameters: - 0: _group - - Return value: - Nothing -*/ -params ["_group", "_areaArray"]; - -private _position = [_areaArray] call CBA_fnc_randPosArea; - -private _waypoint = [_group, _position, 0, "MOVE", "SAFE", "YELLOW", "LIMITED", "WEDGE", "[(this getVariable ['uksf_ied_sucideUnitGroup', grpNull]), (this getVariable ['uksf_ied_areaArray', []])] call uksf_ied_fnc_setWaypoint", [0,0,0], 30] call CBA_fnc_addWaypoint; - diff --git a/addons/ied/functions/fnc_setWaypointPlanter.sqf b/addons/ied/functions/fnc_setWaypointPlanter.sqf deleted file mode 100644 index 8c09dd3df..000000000 --- a/addons/ied/functions/fnc_setWaypointPlanter.sqf +++ /dev/null @@ -1,43 +0,0 @@ -#include "script_component.hpp" -/* - Author: - Bridg - - Description: - sets up a waypoint for the IED planter to follow - - Parameters: - 0: planter - 1: planterHome - - Return value: - Nothing -*/ -#define MAX_RETRIES 5 - -params ["_planter", ["_retries", 0]]; - -_planter addItemToBackpack "IEDUrbanSmall_Remote_Mag"; - -private _module = _planter getVariable [QGVAR(moduleObject), ObjNull]; -private _area = _planter getVariable [QGVAR(area), []]; - -_area deleteAt 4; -private _areaArray = [(getPos _module)] + _area; -private _position = [_areaArray] call CBA_fnc_randPosArea; - -if ( - [GVAR(iedExcludeAreas), { - [_position, _x#0, _x#1] call EFUNC(common,objectInArea) - }] call EFUNC(common,arrayNone) -) exitWith { - private _planterHome = _planter getVariable [QGVAR(planterHome), ObjNull]; - [_planter, _position, 2, "MOVE", "SAFE", "YELLOW", "LIMITED", "COLUMN", "[this] call uksf_ied_fnc_layIED;"] call cba_fnc_addWaypoint; - [_planter, _planterHome, 0, "MOVE", "CARELESS", "YELLOW", "LIMITED", "COLUMN", "[this] call uksf_ied_fnc_setWaypointPlanter", [60, 180, 240]] call cba_fnc_addWaypoint; -}; - -// runs if above doesn't exit -_retries + 1; -if (MAX_RETRIES > _retries) then { - [_planter, _retries] call FUNC(setWaypointPlanter); -}; diff --git a/addons/ied/functions/script_component.hpp b/addons/ied/functions/script_component.hpp deleted file mode 100644 index 373d2ec39..000000000 --- a/addons/ied/functions/script_component.hpp +++ /dev/null @@ -1 +0,0 @@ -#include "\u\uksf\addons\ied\script_component.hpp" diff --git a/addons/ied/initSettings.sqf b/addons/ied/initSettings.sqf deleted file mode 100644 index 2a26e8be5..000000000 --- a/addons/ied/initSettings.sqf +++ /dev/null @@ -1,19 +0,0 @@ -/* -[ - QGVAR(curatorsLocked), - "CHECKBOX", - ["Curators Locked", "Locks access to curators on mission start"], - ["UKSF", QUOTE(COMPONENT_BEAUTIFIED)], - false, - 1 -] call CBA_settings_fnc_init; - -[ - QGVAR(curatorsMax), - "SLIDER", - ["Maximum Curators", "Maximum number of curators allowed"], - ["UKSF", QUOTE(COMPONENT_BEAUTIFIED)], - [0, 10, 5, 0], - 1 -] call CBA_settings_fnc_init; -*/ diff --git a/addons/ied/script_component.hpp b/addons/ied/script_component.hpp deleted file mode 100644 index f633d1e63..000000000 --- a/addons/ied/script_component.hpp +++ /dev/null @@ -1,9 +0,0 @@ -#define COMPONENT ied -#define COMPONENT_BEAUTIFIED IED -#include "\u\uksf\addons\main\script_mod.hpp" - -// #define DEBUG_MODE_FULL -// #define DISABLE_COMPILE_CACHE -// #define CBA_DEBUG_SYNCHRONOUS - -#include "\u\uksf\addons\main\script_macros.hpp"