From d176a4e72646b0c41a4e65d00599a9cd1c92ff89 Mon Sep 17 00:00:00 2001 From: lambdatiger Date: Sat, 7 Sep 2024 13:10:02 -0500 Subject: [PATCH 01/18] Added supply box stacking --- addons/assignGear/XEH_PREP.hpp | 1 + .../functions/fnc_assignGearSupplyBox.sqf | 82 ++++++++----------- .../fnc_setBoxContentsFromConfig.sqf | 68 +++++++++++++++ 3 files changed, 105 insertions(+), 46 deletions(-) create mode 100644 addons/assignGear/functions/fnc_setBoxContentsFromConfig.sqf diff --git a/addons/assignGear/XEH_PREP.hpp b/addons/assignGear/XEH_PREP.hpp index b729b781..953ef9ba 100644 --- a/addons/assignGear/XEH_PREP.hpp +++ b/addons/assignGear/XEH_PREP.hpp @@ -15,4 +15,5 @@ PREP(getLoadoutFromConfig); PREP(getWeaponArray); PREP(isOpticMagnified); PREP(requestPlayerGear); +PREP(setBoxContentsFromConfig); PREP(setWeaponAttachment); diff --git a/addons/assignGear/functions/fnc_assignGearSupplyBox.sqf b/addons/assignGear/functions/fnc_assignGearSupplyBox.sqf index beddfc54..2c4571f9 100644 --- a/addons/assignGear/functions/fnc_assignGearSupplyBox.sqf +++ b/addons/assignGear/functions/fnc_assignGearSupplyBox.sqf @@ -2,6 +2,8 @@ /* * Author: Bailey * Fills supply box with gear for a faction + * Edit by Lambda.tiger + * Supports boxes containing other boxes * * Arguments: * 0: Box @@ -17,12 +19,11 @@ params ["_theBox"]; -private _config = configOf _theBox; -private _faction = getText (_config >> QGVAR(faction)); -private _type = getText (_config >> QGVAR(type)); // 1=squad, 2=platoon - TRACE_1("",GVAR(setSupplyBoxLoadouts)); +if (_theBox getVariable [QGVAR(initialized), false]) exitWith {}; +_theBox setVariable [QGVAR(initialized), true, true]; + //Leave default gear when GVAR(setSupplyBoxLoadouts) is 0 if (GVAR(setSupplyBoxLoadouts) == 0) exitWith {}; @@ -40,46 +41,35 @@ if (!isClass _path) exitWith { diag_log text format ["[POTATO-assignGear] - No loadout found for %1 (typeOf %2)", _theBox, typeOf _theBox]; }; -//Clean out starting inventory (even if there is no class) -clearWeaponCargoGlobal _theBox; -clearMagazineCargoGlobal _theBox; -clearItemCargoGlobal _theBox; -clearBackpackCargoGlobal _theBox; - -private _transportMagazines = getArray(_path >> "TransportMagazines"); -private _transportItems = getArray(_path >> "TransportItems"); -private _transportWeapons = getArray(_path >> "TransportWeapons"); -private _transportBackpacks = getArray(_path >> "TransportBackpacks"); - -// transportMagazines -{ - (_x splitString ":") params ["_classname", ["_amount", "1", [""]]]; - _theBox addMagazineCargoGlobal [_classname, parseNumber _amount]; - nil -} count _transportMagazines; // count used here for speed, make sure nil is above this line - -// transportItems -{ - (_x splitString ":") params ["_classname", ["_amount", "1", [""]]]; - _theBox addItemCargoGlobal [_classname, parseNumber _amount]; - nil -} count _transportItems; // count used here for speed, make sure nil is above this line - -// transportWeapons -{ - (_x splitString ":") params ["_classname", ["_amount", "1", [""]]]; - private _disposableName = [cba_disposable_LoadedLaunchers, _classname, "get", ""] call FUNC(getDisposableInfo); - if (_disposableName != "") then { - TRACE_2("cba_disposable_LoadedLaunchers replace",_classname,_disposableName); - _classname = _disposableName; +private _subBoxes = "true" configClasses _path; +if (_subBoxes isNotEqualTo []) then { + private _boxName = getText (_path >> "boxCustomName"); + if (_boxName isNotEqualTo "") then { + _theBox setVariable ["ace_cargo_customName", _boxName, true]; }; - _theBox addWeaponCargoGlobal [_classname, parseNumber _amount]; - nil -} count _transportWeapons; // count used here for speed, make sure nil is above this line - -// transportBackpacks -{ - (_x splitString ":") params ["_classname", ["_amount", "1", [""]]]; - _theBox addBackpackCargoGlobal [_classname, parseNumber _amount]; - nil -} count _transportBackpacks; // count used here for speed, make sure nil is above this line + clearWeaponCargoGlobal _theBox; + clearMagazineCargoGlobal _theBox; + clearItemCargoGlobal _theBox; + clearBackpackCargoGlobal _theBox; + private _boxSpace = getNumber (_path >> "boxSpace"); + [_theBox, [_boxSpace, 4] select (_boxSpace == 0)] call ace_cargo_fnc_setSpace; + { + private _subBoxType = configName _x; + private _boxCount = (getNumber (_x >> "boxCount")) max 1; + for "_i" from 1 to _boxCount do { + private _subBox = createVehicle [_subBoxType, [23,54,975], [], 0, "CAN_COLLIDE"]; + [_subBox, _x, ["%1", "%1 " + str _i] select (_boxCount > 1)] call FUNC(setBoxContentsFromConfig); + [_subBox, 1] call ace_cargo_fnc_setSize; + if !([_subBox, _theBox, true] call ace_cargo_fnc_loadItem) exitWith { + diag_log text format ["[POTATO-assignGear] - Failed to create %1 supply box(es) for %2 - out of space ", _subBoxType, typeOf _theBox]; + deleteVehicle _subBox; + }; + _subBox setVariable [QGVAR(initialized), true]; + }; + } forEach _subBoxes; + [_theBox, 4] call ace_cargo_fnc_setSize; + [_theBox, true, [0, 1, 1], 0, true, true] call ace_dragging_fnc_setCarryable; + [_theBox, true, [0, 1.5, 0], 0, true, true] call ace_dragging_fnc_setDraggable; +} else { + [_theBox, _path] call FUNC(setBoxContentsFromConfig); +}; diff --git a/addons/assignGear/functions/fnc_setBoxContentsFromConfig.sqf b/addons/assignGear/functions/fnc_setBoxContentsFromConfig.sqf new file mode 100644 index 00000000..e4d1f570 --- /dev/null +++ b/addons/assignGear/functions/fnc_setBoxContentsFromConfig.sqf @@ -0,0 +1,68 @@ +#include "script_component.hpp" +/* + * Author: Bailey + * Fills box with gear from a config + * Edited by Lambda.Tiger to add box names + * + * Arguments: + * 0: Box + * 1: missionConfigFile path for the box's loadout + * 2: Optional format string for box name, must contain "%1" + * + * Return Value: + * None + * + * Example: + * [cursorObject] call potato_assignGear_fnc_assignGearSupplyBox + * + * Public: No + */ + +params ["_theBox", "_path", ["_nameFormatString", "%1", [""]]]; + +clearWeaponCargoGlobal _theBox; +clearMagazineCargoGlobal _theBox; +clearItemCargoGlobal _theBox; +clearBackpackCargoGlobal _theBox; + +private _transportMagazines = getArray(_path >> "TransportMagazines"); +private _transportItems = getArray(_path >> "TransportItems"); +private _transportWeapons = getArray(_path >> "TransportWeapons"); +private _transportBackpacks = getArray(_path >> "TransportBackpacks"); + +// transportMagazines +{ + (_x splitString ":") params ["_classname", ["_amount", "1", [""]]]; + _theBox addMagazineCargoGlobal [_classname, parseNumber _amount]; + nil +} count _transportMagazines; // count used here for speed, make sure nil is above this line + +// transportItems +{ + (_x splitString ":") params ["_classname", ["_amount", "1", [""]]]; + _theBox addItemCargoGlobal [_classname, parseNumber _amount]; + nil +} count _transportItems; // count used here for speed, make sure nil is above this line + +// transportWeapons +{ + (_x splitString ":") params ["_classname", ["_amount", "1", [""]]]; + private _disposableName = [cba_disposable_LoadedLaunchers, _classname, "get", ""] call potato_assignGear_fnc_getDisposableInfo; + if (_disposableName != "") then { + _classname = _disposableName; + }; + _theBox addWeaponCargoGlobal [_classname, parseNumber _amount]; + nil +} count _transportWeapons; // count used here for speed, make sure nil is above this line + +// transportBackpacks +{ + (_x splitString ":") params ["_classname", ["_amount", "1", [""]]]; + _theBox addBackpackCargoGlobal [_classname, parseNumber _amount]; + nil +} count _transportBackpacks; // count used here for speed, make sure nil is above this line + +private _boxName = getText (_path >> "boxCustomName"); +if (_boxName isNotEqualTo "") then { + _theBox setVariable ["ace_cargo_customName", format [_nameFormatString, _boxName], true]; +}; From cb2ba499ff5e6a7e52d6ffd97dcd3147d5b2339e Mon Sep 17 00:00:00 2001 From: lambdatiger Date: Sat, 7 Sep 2024 14:16:10 -0500 Subject: [PATCH 02/18] Added option to allow crates weight to not impede movement --- addons/assignGear/functions/fnc_setBoxContentsFromConfig.sqf | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/addons/assignGear/functions/fnc_setBoxContentsFromConfig.sqf b/addons/assignGear/functions/fnc_setBoxContentsFromConfig.sqf index e4d1f570..c002c37d 100644 --- a/addons/assignGear/functions/fnc_setBoxContentsFromConfig.sqf +++ b/addons/assignGear/functions/fnc_setBoxContentsFromConfig.sqf @@ -66,3 +66,8 @@ private _boxName = getText (_path >> "boxCustomName"); if (_boxName isNotEqualTo "") then { _theBox setVariable ["ace_cargo_customName", format [_nameFormatString, _boxName], true]; }; + +private _overrideCarryWeight = 1 == (getNumber (_path >> "forceAllowCarry")); +private _overrideDragWeight = 1 == (getNumber (_path >> "forceAllowDrag")); +_theBox setVariable ["ace_cargo_ignoreWeightCarry", _overrideCarryWeight, true]; +_theBox setVariable ["ace_cargo_ignoreWeightDrag", _overrideCarryWeight || _overrideDragWeight, true]; From 861374135b13da92ca3893e449fa9e4d6bb07979 Mon Sep 17 00:00:00 2001 From: lambdatiger Date: Sun, 8 Sep 2024 17:48:20 -0500 Subject: [PATCH 03/18] Initial commit, requires PR539 before further anything --- addons/assignGear/XEH_PREP.hpp | 1 + .../functions/fnc_assignGearVehicle.sqf | 308 +++++++++++++++--- .../fnc_setBoxContentsFromConfig.sqf | 46 +-- .../fnc_setContainerContentsFromConfig.sqf | 64 ++++ 4 files changed, 337 insertions(+), 82 deletions(-) create mode 100644 addons/assignGear/functions/fnc_setContainerContentsFromConfig.sqf diff --git a/addons/assignGear/XEH_PREP.hpp b/addons/assignGear/XEH_PREP.hpp index 953ef9ba..9d394b8b 100644 --- a/addons/assignGear/XEH_PREP.hpp +++ b/addons/assignGear/XEH_PREP.hpp @@ -16,4 +16,5 @@ PREP(getWeaponArray); PREP(isOpticMagnified); PREP(requestPlayerGear); PREP(setBoxContentsFromConfig); +PREP(setContainerContentsFromConfig); PREP(setWeaponAttachment); diff --git a/addons/assignGear/functions/fnc_assignGearVehicle.sqf b/addons/assignGear/functions/fnc_assignGearVehicle.sqf index a9bf7f15..4b1377d8 100644 --- a/addons/assignGear/functions/fnc_assignGearVehicle.sqf +++ b/addons/assignGear/functions/fnc_assignGearVehicle.sqf @@ -16,6 +16,10 @@ * Public: Yes */ +#define BAGS_PER_BOX 10 +#define WEAPONS_PER_BOX 5 +#define MAGAZINES_PER_BOX 100 + params ["_theVehicle", "_defaultLoadout"]; TRACE_2("assignGearVehicle",_theVehicle,_defaultLoadout); @@ -28,7 +32,7 @@ TRACE_2("",GVAR(setVehicleLoadouts),_loadout); //Leave default gear when "F_Gear" is "Default" or GVAR(setVehicleLoadouts) is 0 if ((GVAR(setVehicleLoadouts) == 0) || {_loadout == "Default"}) exitWith { if (GVAR(alwaysAddToolkits)) then { _theVehicle addItemCargoGlobal ["Toolkit", 1]; }; - if (GVAR(alwaysAddLandRopes) && {(_theVehicle isKindOf "Car") || {_theVehicle isKindOf "Tank"}}) then { + if (GVAR(alwaysAddLandRopes) && {(_theVehicle isKindOf "Car") || {_theVehicle isKindOf "Tank"}}) then { _theVehicle addItemCargoGlobal ["ACE_rope15", 1]; // note: this rope is probably too short to fastrope with, so don't add to air }; }; @@ -41,7 +45,7 @@ if ((GVAR(setVehicleLoadouts) == -1) || {_loadout == "Empty"}) exitWith { clearBackpackCargoGlobal _theVehicle; //Add a Toolkit if (GVAR(alwaysAddToolkits)) then { _theVehicle addItemCargoGlobal ["Toolkit", 1]; }; - if (GVAR(alwaysAddLandRopes) && {(_theVehicle isKindOf "Car") || {_theVehicle isKindOf "Tank"}}) then { + if (GVAR(alwaysAddLandRopes) && {(_theVehicle isKindOf "Car") || {_theVehicle isKindOf "Tank"}}) then { _theVehicle addItemCargoGlobal ["ACE_rope15", 1]; }; }; @@ -82,44 +86,270 @@ clearItemCargoGlobal _theVehicle; clearBackpackCargoGlobal _theVehicle; //Add a Toolkit if (GVAR(alwaysAddToolkits)) then { _theVehicle addItemCargoGlobal ["Toolkit", 1]; }; -if (GVAR(alwaysAddLandRopes) && {(_theVehicle isKindOf "Car") || {_theVehicle isKindOf "Tank"}}) then { +if (GVAR(alwaysAddLandRopes) && {(_theVehicle isKindOf "Car") || {_theVehicle isKindOf "Tank"}}) then { _theVehicle addItemCargoGlobal ["ACE_rope15", 1]; }; -private _transportMagazines = getArray(_path >> "TransportMagazines"); -private _transportItems = getArray(_path >> "TransportItems"); -private _transportWeapons = getArray(_path >> "TransportWeapons"); -private _transportBackpacks = getArray(_path >> "TransportBackpacks"); - -// transportMagazines -{ - (_x splitString ":") params ["_classname", ["_amount", "1", [""]]]; - _theVehicle addMagazineCargoGlobal [_classname, parseNumber _amount]; - nil -} count _transportMagazines; // count used here for speed, make sure nil is above this line - -// transportItems -{ - (_x splitString ":") params ["_classname", ["_amount", "1", [""]]]; - _theVehicle addItemCargoGlobal [_classname, parseNumber _amount]; - nil -} count _transportItems; // count used here for speed, make sure nil is above this line - -// transportWeapons -{ - (_x splitString ":") params ["_classname", ["_amount", "1", [""]]]; - private _disposableName = [cba_disposable_LoadedLaunchers, _classname, "get", ""] call FUNC(getDisposableInfo); - if (_disposableName != "") then { - TRACE_2("cba_disposable_LoadedLaunchers replace",_classname,_disposableName); - _classname = _disposableName; +switch (GVAR(setVehicleLoadouts)) do { + case 1: { // ammo in vehicle inventory + [_theVehicle, _path, false] call FUNC(setContentsFromConfig); + }; + case 2: { // ammo in boxes in vehicle from inventory + private _getMassLbs = { + params ["_config"]; + private _mass = getNumber (_config >> "mass"); + + if (_mass == 0 && {isClass (_config >> "itemInfo")}) then { + _mass = getNumber (_config >> "itemInfo" >> "mass"); + }; + + if (_mass == 0 && {isClass (_config >> "WeaponSlotsInfo")}) then { + _mass = getNumber (_config >> "WeaponSlotsInfo" >> "mass"); + }; + _mass / 10 + }; + + private _getShortName = { + params ["_displayName"]; + (_displayName splitString " ") params ["_f", "_s"]; + private _shortName = format ["%1 %2", _f, _s]; + if (isNil "_s") then { + _shortName = _f; + }; + _shortName + }; + + private _transportMagazines = getArray(_path >> "TransportMagazines"); + private _transportItems = getArray(_path >> "TransportItems"); + private _transportWeapons = getArray(_path >> "TransportWeapons"); + private _transportBackpacks = getArray(_path >> "TransportBackpacks"); + private _transportBoxClassname = getText(_path >> "AmmoBox"); + if (_transportBoxClassname == "") then { + _transportBoxClassname = "Box_NATO_Ammo_F"; + }; + private _transportBoxWeight = getNumber(_path >> "AmmoBoxCapacity"); + if (_transportBoxWeight == 0) then { + _transportBoxWeight = 75; + }; + + private _loadoutInfo = createHashMap; + private _availableMagazines = []; + private _availableItems = []; + private _availableWeapons = []; + private _availableBackpacks = []; + // transportMagazines + { + (_x splitString ":") params ["_classname", ["_amount", "1", [""]]]; + _availableMagazines pushBackUnique _classname; + private _config = configFile >> "CfgMagazines" >> _classname; + (_loadoutInfo getOrDefault [_classname, [0, _config call _getMassLbs, getText (_config >> "displayName")]]) params ["_existingAmount", "_mass", "_name"]; + _loadoutInfo set [_classname, [_existingAmount + parseNumber _amount, _mass, _name]]; + nil + } count _transportMagazines; // count used here for speed, make sure nil is above this line + + // transportItems + { + (_x splitString ":") params ["_classname", ["_amount", "1", [""]]]; + _availableItems pushBackUnique _classname; + private _config = configFile >> "CfgWeapons" >> _classname; + (_loadoutInfo getOrDefault [_classname, [0, _config call _getMassLbs, getText (_config >> "displayName")]]) params ["_existingAmount", "_mass", "_name"]; + _loadoutInfo set [_classname, [_existingAmount + parseNumber _amount, _mass, _name]]; + nil + } count _transportItems; // count used here for speed, make sure nil is above this line + + // transportWeapons + { + (_x splitString ":") params ["_classname", ["_amount", "1", [""]]]; + private _disposableName = [cba_disposable_LoadedLaunchers, _classname, "get", ""] call FUNC(getDisposableInfo); + if (_disposableName != "") then { + TRACE_2("cba_disposable_LoadedLaunchers replace",_classname,_disposableName); + _classname = _disposableName; + }; + _availableWeapons pushBackUnique _classname; + private _config = configFile >> "CfgWeapons" >> _classname; + (_loadoutInfo getOrDefault [_classname, [0, _config call _getMassLbs, getText (_config >> "displayName")]]) params ["_existingAmount", "_mass", "_name"]; + _loadoutInfo set [_classname, [_existingAmount + parseNumber _amount, _mass, _name]]; + nil + } count _transportWeapons; // count used here for speed, make sure nil is above this line + + // transportBackpacks + { + (_x splitString ":") params ["_classname", ["_amount", "1", [""]]]; + _availableBackpacks pushBackUnique _classname; + private _config = configFile >> "CfgBackpacks" >> _classname; + (_loadoutInfo getOrDefault [_classname, [0, _config call _getMassLbs, getText (_config >> "displayName")]]) params ["_existingAmount", "_mass", "_name"]; + _loadoutInfo set [_classname, [_existingAmount + parseNumber _amount, _mass, _name]]; + nil + } count _transportBackpacks; // count used here for speed, make sure nil is above this line + + while { + _availableBackpacks isNotEqualTo [] || + { _availableItems isNotEqualTo [] } || + { _availableWeapons isNotEqualTo [] } || + { _availableMagazines isNotEqualTo [] } + } do { + scopeName "item_select_loop"; + private _currentWeight = 0; + private _box = createVehicle [_transportBoxClassname, [0, 0, 0], [], 0, "NONE"]; + clearWeaponCargoGlobal _box; + clearMagazineCargoGlobal _box; + clearItemCargoGlobal _box; + clearBackpackCargoGlobal _box; + [_box, 0] call ace_cargo_fnc_setSize; + [_box, _theVehicle, true] call ace_cargo_fnc_loadItem; + + private _name = []; + if (_currentWeight < _transportBoxWeight && _availableBackpacks isNotEqualTo []) then { + scopeName "add_Backpack"; + private _chosen = ""; + private _amounts = [0]; + for "_i" from 0 to BACKPACKS_PER_BOX do { + // check if Backpacks of this type remain + if ((_amounts select 0) == 0) then { + _loadoutInfo deleteAt _chosen; + if (_availableBackpacks isEqualTo []) exitWith { + breakTo "item_select_loop"; + }; + _chosen = _availableBackpacks deleteAt 0; + _amounts = _loadoutInfo get _chosen; + _name pushBackUnique ([_amounts select 2] call _getShortName); + }; + _amounts params ["_count", "_weight"]; + // always add at least one item + _currentWeight = _currentWeight + _weight; + _amounts set [0, _count - 1]; + _box addBackpackCargoGlobal [_chosen, 1]; + + if (_currentWeight >= _transportBoxWeight) exitWith { + breakTo "add_Backpack"; + }; + }; + // Since, if a bag still exists to add we exist here, we need to re-add it + _loadoutInfo set [_chosen, _amounts]; + _availableBackpacks pushBack _chosen; + }; + if (_currentWeight < _transportBoxWeight && _availableWeapons isNotEqualTo []) then { + scopeName "add_weapon"; + private _chosen = ""; + private _amounts = [0]; + for "_i" from 0 to WEAPONS_PER_BOX do { + // check if weapons of this type remain + if ((_amounts select 0) == 0) then { + _loadoutInfo deleteAt _chosen; + if (_availableWeapons isEqualTo []) exitWith { + breakTo "item_select_loop"; + }; + _chosen = _availableWeapons deleteAt 0; + _amounts = _loadoutInfo get _chosen; + _name pushBackUnique ([_amounts select 2] call _getShortName); + }; + _amounts params ["_count", "_weight"]; + // always add at least one item + _currentWeight = _currentWeight + _weight; + _amounts set [0, _count - 1]; + _box addWeaponCargoGlobal [_chosen, 1]; + + if (_currentWeight >= _transportBoxWeight) exitWith { + breakTo "add_weapon"; + }; + }; + // Since, if a bag still exists to add we exist here, we need to re-add it + _loadoutInfo set [_chosen, _amounts]; + _availableWeapons pushBack _chosen; + }; + if (_currentWeight < _transportBoxWeight && _availableMagazines isNotEqualTo []) then { + scopeName "add_magazine"; + private _chosen = ""; + private _amounts = [0]; + for "_i" from 0 to MAGAZINES_PER_BOX do { + // check if magazines of this type remain + if ((_amounts select 0) == 0) then { + _loadoutInfo deleteAt _chosen; + if (_availableMagazines isEqualTo []) exitWith { + breakTo "item_select_loop"; + }; + _chosen = _availableMagazines deleteAt 0; + _amounts = _loadoutInfo get _chosen; + _name pushBackUnique ([_amounts select 2] call _getShortName); + }; + _amounts params ["_count", "_weight"]; + private _toAdd = 1; + if (_weight == 0) then { + _toAdd = _count; + } else { + _toAdd = floor ((_transportBoxWeight - _currentWeight) / _weight); + }; + // always add at least one item + _toAdd = 1 max (_toAdd min _count); + + _currentWeight = _currentWeight + _weight * _toAdd; + _amounts set [0, _count - _toAdd]; + _box addMagazineCargoGlobal [_chosen, _toAdd]; + + if (_currentWeight >= _transportBoxWeight) exitWith { + breakTo "add_magazine"; + }; + }; + // Since, if a bag still exists to add we exist here, we need to re-add it + _loadoutInfo set [_chosen, _amounts]; + _availableMagazines pushBack _chosen; + }; + if (_currentWeight < _transportBoxWeight && _availableItems isNotEqualTo []) then { + scopeName "add_item"; + private _chosen = ""; + private _amounts = [0]; + for "_i" from 0 to MAGAZINES_PER_BOX do { + // check if items of this type remain + if ((_amounts select 0) == 0) then { + _loadoutInfo deleteAt _chosen; + if (_availableItems isEqualTo []) exitWith { + breakTo "item_select_loop"; + }; + _chosen = _availableItems deleteAt 0; + _amounts = _loadoutInfo get _chosen; + _name pushBackUnique ([_amounts select 2] call _getShortName); + }; + _amounts params ["_count", "_weight"]; + private _toAdd = 1; + if (_weight == 0) then { + _toAdd = _count; + } else { + _toAdd = floor ((_transportBoxWeight - _currentWeight) / _weight); + }; + // always add at least one item + _toAdd = 1 max (_toAdd min _count); + + _currentWeight = _currentWeight + _weight * _toAdd; + _amounts set [0, _count - _toAdd]; + _box addItemCargoGlobal [_chosen, _toAdd]; + + if (_currentWeight >= _transportBoxWeight) exitWith { + breakTo "add_item"; + }; + }; + // Since, if a bag still exists to add we exist here, we need to re-add it + _loadoutInfo set [_chosen, _amounts]; + _availableItems pushBack _chosen; + }; + + _box setVariable ["ace_cargo_customName", _name joinString ",", true]; + }; + }; + case 3: { // ammo in boxes in vehicle from config + private _boxes = "true" configClasses _path; + { + private _boxType = configName _x; + private _boxCount = (getNumber (_x >> "boxCount")) max 1; + for "_i" from 1 to _boxCount do { + private _box = createVehicle [_boxType, [2,5,105], [], 0, "CAN_COLLIDE"]; + [_box, _x, ["%1", "%1 " + str _i] select (_boxCount > 1)] call FUNC(setBoxContentsFromConfig); + [_box, 1] call ace_cargo_fnc_setSize; + if !([_box, _theVehicle, true] call ace_cargo_fnc_loadItem) exitWith { + diag_log text format ["[POTATO-assignGear] - Failed to create %1 supply box(es) for %2 - out of space ", _boxType, typeOf _theVehicle]; + deleteVehicle _box; + }; + _box setVariable [QGVAR(initialized), true]; + }; + } forEach _boxes; }; - _theVehicle addWeaponCargoGlobal [_classname, parseNumber _amount]; - nil -} count _transportWeapons; // count used here for speed, make sure nil is above this line - -// transportBackpacks -{ - (_x splitString ":") params ["_classname", ["_amount", "1", [""]]]; - _theVehicle addBackpackCargoGlobal [_classname, parseNumber _amount]; - nil -} count _transportBackpacks; // count used here for speed, make sure nil is above this line +}; \ No newline at end of file diff --git a/addons/assignGear/functions/fnc_setBoxContentsFromConfig.sqf b/addons/assignGear/functions/fnc_setBoxContentsFromConfig.sqf index c002c37d..d5601870 100644 --- a/addons/assignGear/functions/fnc_setBoxContentsFromConfig.sqf +++ b/addons/assignGear/functions/fnc_setBoxContentsFromConfig.sqf @@ -6,61 +6,21 @@ * * Arguments: * 0: Box - * 1: missionConfigFile path for the box's loadout + * 1: Config path for the box's loadout * 2: Optional format string for box name, must contain "%1" * * Return Value: * None * * Example: - * [cursorObject] call potato_assignGear_fnc_assignGearSupplyBox + * [cursorObject, missionConfigFile >> "CfgLoadouts" >> "SupplyBox" >> (typeOf cursorObject)] call potato_assignGear_fnc_assignGearSupplyBox * * Public: No */ params ["_theBox", "_path", ["_nameFormatString", "%1", [""]]]; -clearWeaponCargoGlobal _theBox; -clearMagazineCargoGlobal _theBox; -clearItemCargoGlobal _theBox; -clearBackpackCargoGlobal _theBox; - -private _transportMagazines = getArray(_path >> "TransportMagazines"); -private _transportItems = getArray(_path >> "TransportItems"); -private _transportWeapons = getArray(_path >> "TransportWeapons"); -private _transportBackpacks = getArray(_path >> "TransportBackpacks"); - -// transportMagazines -{ - (_x splitString ":") params ["_classname", ["_amount", "1", [""]]]; - _theBox addMagazineCargoGlobal [_classname, parseNumber _amount]; - nil -} count _transportMagazines; // count used here for speed, make sure nil is above this line - -// transportItems -{ - (_x splitString ":") params ["_classname", ["_amount", "1", [""]]]; - _theBox addItemCargoGlobal [_classname, parseNumber _amount]; - nil -} count _transportItems; // count used here for speed, make sure nil is above this line - -// transportWeapons -{ - (_x splitString ":") params ["_classname", ["_amount", "1", [""]]]; - private _disposableName = [cba_disposable_LoadedLaunchers, _classname, "get", ""] call potato_assignGear_fnc_getDisposableInfo; - if (_disposableName != "") then { - _classname = _disposableName; - }; - _theBox addWeaponCargoGlobal [_classname, parseNumber _amount]; - nil -} count _transportWeapons; // count used here for speed, make sure nil is above this line - -// transportBackpacks -{ - (_x splitString ":") params ["_classname", ["_amount", "1", [""]]]; - _theBox addBackpackCargoGlobal [_classname, parseNumber _amount]; - nil -} count _transportBackpacks; // count used here for speed, make sure nil is above this line +[_theBox, _path] call FUNC(setContainerContentsFromConfig); private _boxName = getText (_path >> "boxCustomName"); if (_boxName isNotEqualTo "") then { diff --git a/addons/assignGear/functions/fnc_setContainerContentsFromConfig.sqf b/addons/assignGear/functions/fnc_setContainerContentsFromConfig.sqf new file mode 100644 index 00000000..59f2ec2f --- /dev/null +++ b/addons/assignGear/functions/fnc_setContainerContentsFromConfig.sqf @@ -0,0 +1,64 @@ +#include "script_component.hpp" +/* + * Author: Bailey + * Fills box with gear from a config + * + * Arguments: + * 0: The container to be filled such as a vehicle or supply box + * 1: Config path for the box's loadout + * + * Return Value: + * None + * + * Example: + * [cursorObject, missionConfigFile >> "CfgLoadouts" >> "SupplyBox" >> (typeOf cursorObject)] call potato_assignGear_fnc_assignGearSupplyBox + * + * Public: No + */ + +params ["_theContainer", "_path", ["_clearContents", true, [true]]]; +diag_log text "container contents"; + +if (_clearContents) then { + clearWeaponCargoGlobal _theContainer; + clearMagazineCargoGlobal _theContainer; + clearItemCargoGlobal _theContainer; + clearBackpackCargoGlobal _theContainer; +}; + +private _transportMagazines = getArray(_path >> "TransportMagazines"); +private _transportItems = getArray(_path >> "TransportItems"); +private _transportWeapons = getArray(_path >> "TransportWeapons"); +private _transportBackpacks = getArray(_path >> "TransportBackpacks"); + +// transportMagazines +{ + (_x splitString ":") params ["_classname", ["_amount", "1", [""]]]; + _theContainer addMagazineCargoGlobal [_classname, parseNumber _amount]; + nil +} count _transportMagazines; // count used here for speed, make sure nil is above this line + +// transportItems +{ + (_x splitString ":") params ["_classname", ["_amount", "1", [""]]]; + _theContainer addItemCargoGlobal [_classname, parseNumber _amount]; + nil +} count _transportItems; // count used here for speed, make sure nil is above this line + +// transportWeapons +{ + (_x splitString ":") params ["_classname", ["_amount", "1", [""]]]; + private _disposableName = [cba_disposable_LoadedLaunchers, _classname, "get", ""] call potato_assignGear_fnc_getDisposableInfo; + if (_disposableName != "") then { + _classname = _disposableName; + }; + _theContainer addWeaponCargoGlobal [_classname, parseNumber _amount]; + nil +} count _transportWeapons; // count used here for speed, make sure nil is above this line + +// transportBackpacks +{ + (_x splitString ":") params ["_classname", ["_amount", "1", [""]]]; + _theContainer addBackpackCargoGlobal [_classname, parseNumber _amount]; + nil +} count _transportBackpacks; // count used here for speed, make sure nil is above this line From 7355e059e12d09e1314230ae6364d84f9a533df5 Mon Sep 17 00:00:00 2001 From: lambdatiger Date: Tue, 10 Sep 2024 16:25:14 -0500 Subject: [PATCH 04/18] Added marking actions and updated some syntax --- addons/assignGear/XEH_PREP.hpp | 1 + addons/assignGear/XEH_clientPostInit.sqf | 2 + addons/assignGear/XEH_preInit.sqf | 1 + .../functions/fnc_addSupplyBoxActions.sqf | 94 +++++++++++++++++++ .../functions/fnc_assignGearSupplyBox.sqf | 28 ++++-- .../fnc_setBoxContentsFromConfig.sqf | 10 +- 6 files changed, 122 insertions(+), 14 deletions(-) create mode 100644 addons/assignGear/functions/fnc_addSupplyBoxActions.sqf diff --git a/addons/assignGear/XEH_PREP.hpp b/addons/assignGear/XEH_PREP.hpp index 953ef9ba..733491e4 100644 --- a/addons/assignGear/XEH_PREP.hpp +++ b/addons/assignGear/XEH_PREP.hpp @@ -1,6 +1,7 @@ TRACE_1("",QUOTE(ADDON)); PREP(addItemsToContainer); +PREP(addSupplyBoxActions); PREP(assignGearMan); PREP(assignGearSupplyBox); PREP(assignGearPotatoBox); diff --git a/addons/assignGear/XEH_clientPostInit.sqf b/addons/assignGear/XEH_clientPostInit.sqf index b1cad131..1c3d0c67 100644 --- a/addons/assignGear/XEH_clientPostInit.sqf +++ b/addons/assignGear/XEH_clientPostInit.sqf @@ -36,4 +36,6 @@ if (GVAR(usePotato) && hasInterface) then { _baseAction, true ] call ACEFUNC(interact_menu,addActionToClass); }; + + [QGVAR(resupplyBoxAddActions), LINKFUNC(addSupplyBoxActions)] call CBA_fnc_addEventHandler; }; diff --git a/addons/assignGear/XEH_preInit.sqf b/addons/assignGear/XEH_preInit.sqf index 1d0e0832..c6b06b68 100644 --- a/addons/assignGear/XEH_preInit.sqf +++ b/addons/assignGear/XEH_preInit.sqf @@ -22,6 +22,7 @@ if (GVAR(usePotato)) then { GVAR(alwaysAddToolkits) = [missionConfigFile >> "CfgLoadouts" >> "alwaysAddToolkits", true] call CFUNC(getBool); GVAR(alwaysAddLandRopes) = [missionConfigFile >> "CfgLoadouts" >> "alwaysAddLandRopes", true] call CFUNC(getBool); GVAR(prefixes) = [missionConfigFile >> "CfgLoadouts" >> "prefixes"] call CFUNC(getArray); + GVAR(resupplyBoxMarkerIndex) = 0; if (isServer) then { if (is3DEN) then { diff --git a/addons/assignGear/functions/fnc_addSupplyBoxActions.sqf b/addons/assignGear/functions/fnc_addSupplyBoxActions.sqf new file mode 100644 index 00000000..74996906 --- /dev/null +++ b/addons/assignGear/functions/fnc_addSupplyBoxActions.sqf @@ -0,0 +1,94 @@ +#include "script_component.hpp" +/* + * Author: Lambda.Tiger + * Adds actions to allow a client to mark a supply box using smoke, glow sticks + * and or map markers. Smoke and glow sticks are enabled with a marking level + * of 1 or greater, and map markers at level 2 or greater. + * + * Arguments: + * 0: Box + * 1: Marking level + * >=1 allows smoke and chem lights to be added + * >=2 allows for a map marker to be placed/updated + * + * Return Value: + * None + * + * Example: + * [cursorObject, 2] call potato_assignGear_fnc_addSupplyBoxActions.sqf + * + * Public: No + */ +#define LARGE_UNIQUE_MARKER_INDEX 934648 +params ["_theBox", "_markingLevel"]; + +if (_markingLevel < 1 || !hasInterface) exitWith {}; + +private _action = [ + "markBoxBase", + "Mark Box", + "\a3\ui_f\data\igui\cfg\simpletasks\types\move_ca.paa", { + private _marker = _target getVariable [QGVAR(boxMarker), ""]; + if (getMarkerPos _marker isNotEqualTo [0, 0, 0]) then { + _marker setMarkerPos (getPosATL _target); + }; + }, + {true} +] call ACEFUNC(interact_menu,createAction); +[_theBox, 0, ["ACE_MainActions"], _action] call ACEFUNC(interact_menu,addActionToObject); + +_action = [ + "markBoxSmoke", + "Smoke", + "\a3\Modules_F_Curator\Data\portraitSmoke_ca.paa", { + private _smoke = createVehicle ["SmokeShellYellow", ASLToAGL getPosASL _target, [], 0, "CAN_COLLIDE"]; + _smoke attachTo [_target, [0, 0, 0]]; + _target setVariable [QGVAR(smokeAvailable), false]; + }, + {_target getVariable [QGVAR(smokeAvailable), true]} +] call ACEFUNC(interact_menu,createAction); +[_theBox, 0, ["ACE_MainActions","markBoxBase"], _action] call ACEFUNC(interact_menu,addActionToObject); +_action = [ + "markBoxGlowstick", + "Glow Stick", + "\a3\Modules_F_Curator\Data\portraitChemlight_ca.paa", { + private _smoke = createVehicle ["ACE_G_Chemlight_HiYellow", ASLToAGL getPosASL _target, [], 0, "CAN_COLLIDE"]; + _smoke attachTo [_target, [0, 0, 0]]; + _target setVariable [QGVAR(glowStickAvailable), false]; + }, + {_target getVariable [QGVAR(glowStickAvailable), true]} +] call ACEFUNC(interact_menu,createAction); +[_theBox, 0, ["ACE_MainActions","markBoxBase"], _action] call ACEFUNC(interact_menu,addActionToObject); + +if (_markingLevel < 2) exitWith {}; +_action = [ + "markBoxMapMarker", + "Map Marker", + "\a3\ui_f\data\igui\cfg\simpletasks\types\rearm_ca.paa", { + private _marker = _target getVariable [QGVAR(boxMarker), ""]; + // when a marker name/values are edit, the marker is re-created so it's possible to lose it (often) + if (getMarkerPos _marker isEqualTo [0, 0, 0]) then { + _marker = createMarkerLocal [ + format ["_USER_DEFINED #%1/%2/%3ResupplyBoxMarker_%4", + clientOwner, + LARGE_UNIQUE_MARKER_INDEX, + 1, + GVAR(resupplyBoxMarkerIndex) + ], + getPosATL _target, + 1, + player + ]; + GVAR(resupplyBoxMarkerIndex) = GVAR(resupplyBoxMarkerIndex) + 1; + _marker setMarkerColorLocal "ColorYellow"; + private _boxName = _target getVariable [QACEGVAR(cargo,customName), "Resupply Box"]; + _marker setMarkerTextLocal _boxName; + _marker setMarkerTypeLocal "loc_rearm"; + _target setVariable [QGVAR(boxMarker), _marker, true]; + } else { + _marker setMarkerPos (getPosATL _target); + }; + }, + {true} +] call ACEFUNC(interact_menu,createAction); +[_theBox, 0, ["ACE_MainActions","markBoxBase"], _action] call ACEFUNC(interact_menu,addActionToObject); \ No newline at end of file diff --git a/addons/assignGear/functions/fnc_assignGearSupplyBox.sqf b/addons/assignGear/functions/fnc_assignGearSupplyBox.sqf index 2c4571f9..ef118d4a 100644 --- a/addons/assignGear/functions/fnc_assignGearSupplyBox.sqf +++ b/addons/assignGear/functions/fnc_assignGearSupplyBox.sqf @@ -38,38 +38,48 @@ if (GVAR(setSupplyBoxLoadouts) == -1) exitWith { private _path = missionConfigFile >> "CfgLoadouts" >> "SupplyBoxes" >> typeOf _theBox; if (!isClass _path) exitWith { - diag_log text format ["[POTATO-assignGear] - No loadout found for %1 (typeOf %2)", _theBox, typeOf _theBox]; + diag_log formatText ["[POTATO-assignGear] - No loadout found for %1 (typeOf %2)", _theBox, typeOf _theBox]; }; private _subBoxes = "true" configClasses _path; if (_subBoxes isNotEqualTo []) then { private _boxName = getText (_path >> "boxCustomName"); if (_boxName isNotEqualTo "") then { - _theBox setVariable ["ace_cargo_customName", _boxName, true]; + _theBox setVariable [QACEGVAR(cargo,customName), _boxName, true]; }; clearWeaponCargoGlobal _theBox; clearMagazineCargoGlobal _theBox; clearItemCargoGlobal _theBox; clearBackpackCargoGlobal _theBox; private _boxSpace = getNumber (_path >> "boxSpace"); - [_theBox, [_boxSpace, 4] select (_boxSpace == 0)] call ace_cargo_fnc_setSpace; + [_theBox, [_boxSpace, 4] select (_boxSpace == 0)] call ACEFUNC(cargo,setSpace); { private _subBoxType = configName _x; private _boxCount = (getNumber (_x >> "boxCount")) max 1; for "_i" from 1 to _boxCount do { - private _subBox = createVehicle [_subBoxType, [23,54,975], [], 0, "CAN_COLLIDE"]; + private _subBox = createVehicle [_subBoxType, [0, 0, 0], [], 0, "CAN_COLLIDE"]; [_subBox, _x, ["%1", "%1 " + str _i] select (_boxCount > 1)] call FUNC(setBoxContentsFromConfig); - [_subBox, 1] call ace_cargo_fnc_setSize; + [_subBox, 1] call ACEFUNC(cargo,setSize); if !([_subBox, _theBox, true] call ace_cargo_fnc_loadItem) exitWith { - diag_log text format ["[POTATO-assignGear] - Failed to create %1 supply box(es) for %2 - out of space ", _subBoxType, typeOf _theBox]; + diag_log formatText [ + "[POTATO-assignGear] - Failed to create %1 %2 supply box(es) for %3 - out of space ", + _subBoxType, + "x" + str (_boxCount - _i + 1), + typeOf _theBox + ]; deleteVehicle _subBox; }; _subBox setVariable [QGVAR(initialized), true]; }; } forEach _subBoxes; - [_theBox, 4] call ace_cargo_fnc_setSize; - [_theBox, true, [0, 1, 1], 0, true, true] call ace_dragging_fnc_setCarryable; - [_theBox, true, [0, 1.5, 0], 0, true, true] call ace_dragging_fnc_setDraggable; + [_theBox, 2] call ACEFUNC(cargo,setSize); + [_theBox, true, [0, 1, 1], 0, true, true] call ACEFUNC(dragging,setCarryable); + [_theBox, true, [0, 1.5, 0], 0, true, true] call ACEFUNC(dragging,setDraggable); } else { [_theBox, _path] call FUNC(setBoxContentsFromConfig); }; + +private _addMarkingActions = getNumber (_path >> "addMarkingActions"); +if (_addMarkingActions >= 1) then { + [QGVAR(resupplyBoxAddActions), [_theBox, _addMarkingActions]] call CBA_fnc_globalEventJIP; +}; diff --git a/addons/assignGear/functions/fnc_setBoxContentsFromConfig.sqf b/addons/assignGear/functions/fnc_setBoxContentsFromConfig.sqf index c002c37d..a40f6e50 100644 --- a/addons/assignGear/functions/fnc_setBoxContentsFromConfig.sqf +++ b/addons/assignGear/functions/fnc_setBoxContentsFromConfig.sqf @@ -13,7 +13,7 @@ * None * * Example: - * [cursorObject] call potato_assignGear_fnc_assignGearSupplyBox + * [cursorObject, missionConfigFile >> "CfgLoadouts" >> "SupplyBoxes" >> (typeOf cursorObject)] call potato_assignGear_fnc_setBoxContentsFromConfig * * Public: No */ @@ -47,7 +47,7 @@ private _transportBackpacks = getArray(_path >> "TransportBackpacks"); // transportWeapons { (_x splitString ":") params ["_classname", ["_amount", "1", [""]]]; - private _disposableName = [cba_disposable_LoadedLaunchers, _classname, "get", ""] call potato_assignGear_fnc_getDisposableInfo; + private _disposableName = [cba_disposable_LoadedLaunchers, _classname, "get", ""] call FUNC(getDisposableInfo); if (_disposableName != "") then { _classname = _disposableName; }; @@ -64,10 +64,10 @@ private _transportBackpacks = getArray(_path >> "TransportBackpacks"); private _boxName = getText (_path >> "boxCustomName"); if (_boxName isNotEqualTo "") then { - _theBox setVariable ["ace_cargo_customName", format [_nameFormatString, _boxName], true]; + _theBox setVariable [QACEGVAR(cargo,customName), format [_nameFormatString, _boxName], true]; }; private _overrideCarryWeight = 1 == (getNumber (_path >> "forceAllowCarry")); private _overrideDragWeight = 1 == (getNumber (_path >> "forceAllowDrag")); -_theBox setVariable ["ace_cargo_ignoreWeightCarry", _overrideCarryWeight, true]; -_theBox setVariable ["ace_cargo_ignoreWeightDrag", _overrideCarryWeight || _overrideDragWeight, true]; +_theBox setVariable [QACEGVAR(cargo,ignoreWeightCarry), _overrideCarryWeight, true]; +_theBox setVariable [QACEGVAR(cargo,ignoreWeightDrag), _overrideCarryWeight || _overrideDragWeight, true]; \ No newline at end of file From 9234f6f40f962ad410b07da3a3972ba12b5b8056 Mon Sep 17 00:00:00 2001 From: lambdatiger Date: Tue, 10 Sep 2024 16:36:18 -0500 Subject: [PATCH 05/18] changed up how a few things are ordered to avoid repeat code --- .../functions/fnc_assignGearVehicle.sqf | 25 +++++++++++-------- .../fnc_setContainerContentsFromConfig.sqf | 13 ++++------ 2 files changed, 19 insertions(+), 19 deletions(-) diff --git a/addons/assignGear/functions/fnc_assignGearVehicle.sqf b/addons/assignGear/functions/fnc_assignGearVehicle.sqf index 4b1377d8..08f0b501 100644 --- a/addons/assignGear/functions/fnc_assignGearVehicle.sqf +++ b/addons/assignGear/functions/fnc_assignGearVehicle.sqf @@ -80,19 +80,10 @@ if (!isClass _path) exitWith { }; //Clean out starting inventory (even if there is no class) -clearWeaponCargoGlobal _theVehicle; -clearMagazineCargoGlobal _theVehicle; -clearItemCargoGlobal _theVehicle; -clearBackpackCargoGlobal _theVehicle; -//Add a Toolkit -if (GVAR(alwaysAddToolkits)) then { _theVehicle addItemCargoGlobal ["Toolkit", 1]; }; -if (GVAR(alwaysAddLandRopes) && {(_theVehicle isKindOf "Car") || {_theVehicle isKindOf "Tank"}}) then { - _theVehicle addItemCargoGlobal ["ACE_rope15", 1]; -}; switch (GVAR(setVehicleLoadouts)) do { case 1: { // ammo in vehicle inventory - [_theVehicle, _path, false] call FUNC(setContentsFromConfig); + [_theVehicle, _path] call FUNC(setContainerContentsFromConfig); }; case 2: { // ammo in boxes in vehicle from inventory private _getMassLbs = { @@ -119,6 +110,11 @@ switch (GVAR(setVehicleLoadouts)) do { _shortName }; + clearWeaponCargoGlobal _theVehicle; + clearMagazineCargoGlobal _theVehicle; + clearItemCargoGlobal _theVehicle; + clearBackpackCargoGlobal _theVehicle; + private _transportMagazines = getArray(_path >> "TransportMagazines"); private _transportItems = getArray(_path >> "TransportItems"); private _transportWeapons = getArray(_path >> "TransportWeapons"); @@ -352,4 +348,11 @@ switch (GVAR(setVehicleLoadouts)) do { }; } forEach _boxes; }; -}; \ No newline at end of file +}; + + +//Add a Toolkit +if (GVAR(alwaysAddToolkits)) then { _theVehicle addItemCargoGlobal ["Toolkit", 1]; }; +if (GVAR(alwaysAddLandRopes) && {(_theVehicle isKindOf "Car") || {_theVehicle isKindOf "Tank"}}) then { + _theVehicle addItemCargoGlobal ["ACE_rope15", 1]; +}; diff --git a/addons/assignGear/functions/fnc_setContainerContentsFromConfig.sqf b/addons/assignGear/functions/fnc_setContainerContentsFromConfig.sqf index 59f2ec2f..e702d2f2 100644 --- a/addons/assignGear/functions/fnc_setContainerContentsFromConfig.sqf +++ b/addons/assignGear/functions/fnc_setContainerContentsFromConfig.sqf @@ -16,15 +16,12 @@ * Public: No */ -params ["_theContainer", "_path", ["_clearContents", true, [true]]]; -diag_log text "container contents"; +params ["_theContainer", "_path"]; -if (_clearContents) then { - clearWeaponCargoGlobal _theContainer; - clearMagazineCargoGlobal _theContainer; - clearItemCargoGlobal _theContainer; - clearBackpackCargoGlobal _theContainer; -}; +clearWeaponCargoGlobal _theContainer; +clearMagazineCargoGlobal _theContainer; +clearItemCargoGlobal _theContainer; +clearBackpackCargoGlobal _theContainer; private _transportMagazines = getArray(_path >> "TransportMagazines"); private _transportItems = getArray(_path >> "TransportItems"); From 3eac360fc77d0f8435625365679e8ff8f141bcc1 Mon Sep 17 00:00:00 2001 From: lambdatiger Date: Tue, 10 Sep 2024 16:40:27 -0500 Subject: [PATCH 06/18] syntaxFixes --- addons/assignGear/functions/fnc_assignGearVehicle.sqf | 4 ++-- .../assignGear/functions/fnc_setBoxContentsFromConfig.sqf | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/addons/assignGear/functions/fnc_assignGearVehicle.sqf b/addons/assignGear/functions/fnc_assignGearVehicle.sqf index 08f0b501..59490620 100644 --- a/addons/assignGear/functions/fnc_assignGearVehicle.sqf +++ b/addons/assignGear/functions/fnc_assignGearVehicle.sqf @@ -339,8 +339,8 @@ switch (GVAR(setVehicleLoadouts)) do { for "_i" from 1 to _boxCount do { private _box = createVehicle [_boxType, [2,5,105], [], 0, "CAN_COLLIDE"]; [_box, _x, ["%1", "%1 " + str _i] select (_boxCount > 1)] call FUNC(setBoxContentsFromConfig); - [_box, 1] call ace_cargo_fnc_setSize; - if !([_box, _theVehicle, true] call ace_cargo_fnc_loadItem) exitWith { + [_box, 1] call ACEFUNC(cargo,setSize); + if !([_box, _theVehicle, true] call ACEFUNC(cargo,loadItem)) exitWith { diag_log text format ["[POTATO-assignGear] - Failed to create %1 supply box(es) for %2 - out of space ", _boxType, typeOf _theVehicle]; deleteVehicle _box; }; diff --git a/addons/assignGear/functions/fnc_setBoxContentsFromConfig.sqf b/addons/assignGear/functions/fnc_setBoxContentsFromConfig.sqf index d5601870..318684ad 100644 --- a/addons/assignGear/functions/fnc_setBoxContentsFromConfig.sqf +++ b/addons/assignGear/functions/fnc_setBoxContentsFromConfig.sqf @@ -24,10 +24,10 @@ params ["_theBox", "_path", ["_nameFormatString", "%1", [""]]]; private _boxName = getText (_path >> "boxCustomName"); if (_boxName isNotEqualTo "") then { - _theBox setVariable ["ace_cargo_customName", format [_nameFormatString, _boxName], true]; + _theBox setVariable [QACEGVAR(cargo,customName), format [_nameFormatString, _boxName], true]; }; private _overrideCarryWeight = 1 == (getNumber (_path >> "forceAllowCarry")); private _overrideDragWeight = 1 == (getNumber (_path >> "forceAllowDrag")); -_theBox setVariable ["ace_cargo_ignoreWeightCarry", _overrideCarryWeight, true]; -_theBox setVariable ["ace_cargo_ignoreWeightDrag", _overrideCarryWeight || _overrideDragWeight, true]; +_theBox setVariable [QACEGVAR(cargo,ignoreWeightCarry), _overrideCarryWeight, true]; +_theBox setVariable [QACEGVAR(cargo,ignoreWeightDrag), _overrideCarryWeight || _overrideDragWeight, true]; From f7049152cb366da4c273d438ac0e44da800bfc67 Mon Sep 17 00:00:00 2001 From: lambdatiger Date: Tue, 10 Sep 2024 16:47:04 -0500 Subject: [PATCH 07/18] Bad glow stick variable name and marker broadcasting --- addons/assignGear/functions/fnc_addSupplyBoxActions.sqf | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/addons/assignGear/functions/fnc_addSupplyBoxActions.sqf b/addons/assignGear/functions/fnc_addSupplyBoxActions.sqf index 74996906..33cb0d44 100644 --- a/addons/assignGear/functions/fnc_addSupplyBoxActions.sqf +++ b/addons/assignGear/functions/fnc_addSupplyBoxActions.sqf @@ -52,8 +52,8 @@ _action = [ "markBoxGlowstick", "Glow Stick", "\a3\Modules_F_Curator\Data\portraitChemlight_ca.paa", { - private _smoke = createVehicle ["ACE_G_Chemlight_HiYellow", ASLToAGL getPosASL _target, [], 0, "CAN_COLLIDE"]; - _smoke attachTo [_target, [0, 0, 0]]; + private _glowstick = createVehicle ["ACE_G_Chemlight_HiYellow", ASLToAGL getPosASL _target, [], 0, "CAN_COLLIDE"]; + _glowstick attachTo [_target, [0, 0, 0]]; _target setVariable [QGVAR(glowStickAvailable), false]; }, {_target getVariable [QGVAR(glowStickAvailable), true]} @@ -83,7 +83,7 @@ _action = [ _marker setMarkerColorLocal "ColorYellow"; private _boxName = _target getVariable [QACEGVAR(cargo,customName), "Resupply Box"]; _marker setMarkerTextLocal _boxName; - _marker setMarkerTypeLocal "loc_rearm"; + _marker setMarkerType "loc_rearm"; _target setVariable [QGVAR(boxMarker), _marker, true]; } else { _marker setMarkerPos (getPosATL _target); From 3d639efec140c5357d2b760c598cf00721edb46e Mon Sep 17 00:00:00 2001 From: lambdatiger Date: Tue, 10 Sep 2024 17:23:47 -0500 Subject: [PATCH 08/18] missed a FUNC --- .../assignGear/functions/fnc_setContainerContentsFromConfig.sqf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/assignGear/functions/fnc_setContainerContentsFromConfig.sqf b/addons/assignGear/functions/fnc_setContainerContentsFromConfig.sqf index e702d2f2..a276b48b 100644 --- a/addons/assignGear/functions/fnc_setContainerContentsFromConfig.sqf +++ b/addons/assignGear/functions/fnc_setContainerContentsFromConfig.sqf @@ -45,7 +45,7 @@ private _transportBackpacks = getArray(_path >> "TransportBackpacks"); // transportWeapons { (_x splitString ":") params ["_classname", ["_amount", "1", [""]]]; - private _disposableName = [cba_disposable_LoadedLaunchers, _classname, "get", ""] call potato_assignGear_fnc_getDisposableInfo; + private _disposableName = [cba_disposable_LoadedLaunchers, _classname, "get", ""] call FUNC(getDisposableInfo); if (_disposableName != "") then { _classname = _disposableName; }; From f59990de2f7deabdb9fbfd4ff01fd092febbe535 Mon Sep 17 00:00:00 2001 From: lambdatiger Date: Tue, 10 Sep 2024 17:25:49 -0500 Subject: [PATCH 09/18] and one more --- addons/assignGear/functions/fnc_assignGearSupplyBox.sqf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/assignGear/functions/fnc_assignGearSupplyBox.sqf b/addons/assignGear/functions/fnc_assignGearSupplyBox.sqf index ef118d4a..9869a273 100644 --- a/addons/assignGear/functions/fnc_assignGearSupplyBox.sqf +++ b/addons/assignGear/functions/fnc_assignGearSupplyBox.sqf @@ -60,7 +60,7 @@ if (_subBoxes isNotEqualTo []) then { private _subBox = createVehicle [_subBoxType, [0, 0, 0], [], 0, "CAN_COLLIDE"]; [_subBox, _x, ["%1", "%1 " + str _i] select (_boxCount > 1)] call FUNC(setBoxContentsFromConfig); [_subBox, 1] call ACEFUNC(cargo,setSize); - if !([_subBox, _theBox, true] call ace_cargo_fnc_loadItem) exitWith { + if !([_subBox, _theBox, true] call ACEFUNC(cargo,loadItem)) exitWith { diag_log formatText [ "[POTATO-assignGear] - Failed to create %1 %2 supply box(es) for %3 - out of space ", _subBoxType, From 4e323a6118621c57e0e8b050ce3b471b8bc8f2c8 Mon Sep 17 00:00:00 2001 From: lambdatiger Date: Tue, 10 Sep 2024 19:19:53 -0500 Subject: [PATCH 10/18] updating authorship --- .../assignGear/functions/fnc_setContainerContentsFromConfig.sqf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/assignGear/functions/fnc_setContainerContentsFromConfig.sqf b/addons/assignGear/functions/fnc_setContainerContentsFromConfig.sqf index a276b48b..e08e16e8 100644 --- a/addons/assignGear/functions/fnc_setContainerContentsFromConfig.sqf +++ b/addons/assignGear/functions/fnc_setContainerContentsFromConfig.sqf @@ -1,6 +1,6 @@ #include "script_component.hpp" /* - * Author: Bailey + * Author: Pabst * Fills box with gear from a config * * Arguments: From d695aec772f9b075a2d53952dce705b80e7e2dba Mon Sep 17 00:00:00 2001 From: lambdatiger Date: Tue, 10 Sep 2024 20:25:00 -0500 Subject: [PATCH 11/18] fixed author --- addons/assignGear/functions/fnc_setBoxContentsFromConfig.sqf | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/addons/assignGear/functions/fnc_setBoxContentsFromConfig.sqf b/addons/assignGear/functions/fnc_setBoxContentsFromConfig.sqf index 7aa82d48..d02f336b 100644 --- a/addons/assignGear/functions/fnc_setBoxContentsFromConfig.sqf +++ b/addons/assignGear/functions/fnc_setBoxContentsFromConfig.sqf @@ -1,8 +1,7 @@ #include "script_component.hpp" /* - * Author: Bailey + * Author: Lambda.Tiger * Fills box with gear from a config - * Edited by Lambda.Tiger to add box names * * Arguments: * 0: Box From 373210d566ae1dddf34eb39330257bc4684cadcf Mon Sep 17 00:00:00 2001 From: lambdatiger Date: Tue, 10 Sep 2024 20:35:15 -0500 Subject: [PATCH 12/18] added ability to set vehicle space to allow for more boxes --- addons/assignGear/functions/fnc_assignGearVehicle.sqf | 3 +++ 1 file changed, 3 insertions(+) diff --git a/addons/assignGear/functions/fnc_assignGearVehicle.sqf b/addons/assignGear/functions/fnc_assignGearVehicle.sqf index 59490620..b6ddb21c 100644 --- a/addons/assignGear/functions/fnc_assignGearVehicle.sqf +++ b/addons/assignGear/functions/fnc_assignGearVehicle.sqf @@ -333,6 +333,9 @@ switch (GVAR(setVehicleLoadouts)) do { }; case 3: { // ammo in boxes in vehicle from config private _boxes = "true" configClasses _path; + private _vehicleSpace = getNumber (_path >> "minVehicleBoxSpace"); + private _currentVehicleSpace = _theVehicle getVariable [QACEGVAR(cargo,space), 4]; + [_theBox, _vehicleSpace max _currentVehicleSpace] call ACEFUNC(cargo,setSpace); { private _boxType = configName _x; private _boxCount = (getNumber (_x >> "boxCount")) max 1; From 5da6194249cd40441ba96f2aaa1c9307bd83dc60 Mon Sep 17 00:00:00 2001 From: lambdatiger Date: Tue, 10 Sep 2024 21:35:49 -0500 Subject: [PATCH 13/18] Fixed box spawn point and added option to increase vehicle ace cargo space --- addons/assignGear/functions/fnc_assignGearVehicle.sqf | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/addons/assignGear/functions/fnc_assignGearVehicle.sqf b/addons/assignGear/functions/fnc_assignGearVehicle.sqf index b6ddb21c..fe625c2b 100644 --- a/addons/assignGear/functions/fnc_assignGearVehicle.sqf +++ b/addons/assignGear/functions/fnc_assignGearVehicle.sqf @@ -334,13 +334,18 @@ switch (GVAR(setVehicleLoadouts)) do { case 3: { // ammo in boxes in vehicle from config private _boxes = "true" configClasses _path; private _vehicleSpace = getNumber (_path >> "minVehicleBoxSpace"); - private _currentVehicleSpace = _theVehicle getVariable [QACEGVAR(cargo,space), 4]; - [_theBox, _vehicleSpace max _currentVehicleSpace] call ACEFUNC(cargo,setSpace); + if (_vehicleSpace > 0) then { + private _currentVehicleSpace = _theVehicle getVariable [ + QACEGVAR(cargo,hasCargo), + getNumber (configOf _theVehicle >> QACEGVAR(cargo,space)) + ]; + [_theVehicle, _vehicleSpace max _currentVehicleSpace] call ACEFUNC(cargo,setSpace); + }; { private _boxType = configName _x; private _boxCount = (getNumber (_x >> "boxCount")) max 1; for "_i" from 1 to _boxCount do { - private _box = createVehicle [_boxType, [2,5,105], [], 0, "CAN_COLLIDE"]; + private _box = createVehicle [_boxType, [0, 0, 0], [], 0, "CAN_COLLIDE"]; [_box, _x, ["%1", "%1 " + str _i] select (_boxCount > 1)] call FUNC(setBoxContentsFromConfig); [_box, 1] call ACEFUNC(cargo,setSize); if !([_box, _theVehicle, true] call ACEFUNC(cargo,loadItem)) exitWith { From 0505bae2576e644cd204c55696e1bdb97f55780b Mon Sep 17 00:00:00 2001 From: lambdatiger Date: Thu, 19 Sep 2024 22:59:11 -0500 Subject: [PATCH 14/18] Merge remote-tracking branch 'upstream/master' into vehicleBoxes --- addons/armor_modifier_ace/$PBOPREFIX$ | 1 + .../armor_modifier_ace/CfgEventHandlers.hpp | 17 + addons/armor_modifier_ace/LICENSE | 19 + .../armor_modifier_ace/LICENSE_FOR_ACE_CODE | 379 ++++++++++++++ addons/armor_modifier_ace/XEH_PREP.hpp | 4 + addons/armor_modifier_ace/XEH_postInit.sqf | 38 ++ addons/armor_modifier_ace/XEH_preInit.sqf | 12 + addons/armor_modifier_ace/XEH_preStart.sqf | 3 + addons/armor_modifier_ace/config.cpp | 22 + .../functions/fnc_handleDamage.sqf | 257 ++++++++++ .../functions/fnc_resolveHitPoints.sqf | 37 ++ .../functions/fnc_setClassArmor.sqf | 39 ++ .../functions/fnc_setUnitArmor.sqf | 40 ++ .../armor_modifier_ace/initSettings.inc.sqf | 61 +++ .../armor_modifier_ace/script_component.hpp | 38 ++ addons/assignGear/XEH_PREP.hpp | 5 +- .../functions/fnc_assignGearSupplyBox.sqf | 2 + .../functions/fnc_assignGearVehicle.sqf | 259 +--------- .../fnc_assignGearVehicle_asBoxes.sqf | 214 ++++++++ .../fnc_setBoxContentsFromConfig.sqf | 1 - addons/cswCompat/patchGM/ACE_CSW_Groups.hpp | 26 + addons/cswCompat/patchGM/CfgMagazines.hpp | 50 ++ addons/cswCompat/patchGM/CfgVehicles.hpp | 264 ++++++++++ addons/cswCompat/patchGM/CfgWeapons.hpp | 98 ++++ addons/cswCompat/patchGM/config.cpp | 41 ++ addons/miscFixes/XEH_preInit.sqf | 43 ++ addons/missileGuidanceCompat/CfgAmmo.hpp | 478 +----------------- addons/missileGuidanceCompat/CfgMagazines.hpp | 7 - .../missileGuidanceCompat/CfgMissileAtaka.hpp | 38 -- .../CfgMissileBastion.hpp | 39 -- .../CfgMissileDrakon.hpp | 39 -- .../missileGuidanceCompat/CfgMissileFagot.hpp | 39 -- .../CfgMissileFalanga.hpp | 37 -- .../CfgMissileFleyta.hpp | 37 -- .../missileGuidanceCompat/CfgMissileHOT.hpp | 38 -- .../missileGuidanceCompat/CfgMissileIgla.hpp | 32 -- .../missileGuidanceCompat/CfgMissileKH25.hpp | 27 - .../missileGuidanceCompat/CfgMissileKH29.hpp | 27 - .../missileGuidanceCompat/CfgMissileKobra.hpp | 39 -- .../CfgMissileKonkurs.hpp | 38 -- .../CfgMissileKornet.hpp | 39 -- .../CfgMissileMalyutka.hpp | 37 -- .../missileGuidanceCompat/CfgMissileMetis.hpp | 38 -- .../missileGuidanceCompat/CfgMissileMilan.hpp | 38 -- .../CfgMissileMolniya.hpp | 32 -- .../missileGuidanceCompat/CfgMissileR73.hpp | 32 -- .../missileGuidanceCompat/CfgMissileR77.hpp | 38 -- .../CfgMissileRefleks.hpp | 39 -- .../CfgMissileShturm.hpp | 38 -- .../CfgMissileStrela.hpp | 32 -- .../CfgMissileTypesNato.hpp | 20 + .../CfgMissileTypesWarsaw.hpp | 25 + .../missileGuidanceCompat/CfgMissileVikhr.hpp | 34 -- .../CfgMissileVympel.hpp | 32 -- addons/missileGuidanceCompat/config.cpp | 5 +- .../missileGuidanceCompat/patchCUP/config.cpp | 172 +++++++ .../missileGuidanceCompat/patchGM/config.cpp | 51 +- .../patchMELB/config.cpp | 44 +- .../patchRHSAFRF/config.cpp | 47 +- .../script_component.hpp | 1 + .../missileGuidanceCompat/script_macros.hpp | 2 + addons/settings/XEH_preInit.sqf | 2 +- 62 files changed, 1973 insertions(+), 1710 deletions(-) create mode 100644 addons/armor_modifier_ace/$PBOPREFIX$ create mode 100644 addons/armor_modifier_ace/CfgEventHandlers.hpp create mode 100644 addons/armor_modifier_ace/LICENSE create mode 100644 addons/armor_modifier_ace/LICENSE_FOR_ACE_CODE create mode 100644 addons/armor_modifier_ace/XEH_PREP.hpp create mode 100644 addons/armor_modifier_ace/XEH_postInit.sqf create mode 100644 addons/armor_modifier_ace/XEH_preInit.sqf create mode 100644 addons/armor_modifier_ace/XEH_preStart.sqf create mode 100644 addons/armor_modifier_ace/config.cpp create mode 100644 addons/armor_modifier_ace/functions/fnc_handleDamage.sqf create mode 100644 addons/armor_modifier_ace/functions/fnc_resolveHitPoints.sqf create mode 100644 addons/armor_modifier_ace/functions/fnc_setClassArmor.sqf create mode 100644 addons/armor_modifier_ace/functions/fnc_setUnitArmor.sqf create mode 100644 addons/armor_modifier_ace/initSettings.inc.sqf create mode 100644 addons/armor_modifier_ace/script_component.hpp create mode 100644 addons/assignGear/functions/fnc_assignGearVehicle_asBoxes.sqf create mode 100644 addons/cswCompat/patchGM/ACE_CSW_Groups.hpp create mode 100644 addons/cswCompat/patchGM/CfgMagazines.hpp create mode 100644 addons/cswCompat/patchGM/CfgVehicles.hpp create mode 100644 addons/cswCompat/patchGM/CfgWeapons.hpp create mode 100644 addons/cswCompat/patchGM/config.cpp delete mode 100644 addons/missileGuidanceCompat/CfgMagazines.hpp delete mode 100644 addons/missileGuidanceCompat/CfgMissileAtaka.hpp delete mode 100644 addons/missileGuidanceCompat/CfgMissileBastion.hpp delete mode 100644 addons/missileGuidanceCompat/CfgMissileDrakon.hpp delete mode 100644 addons/missileGuidanceCompat/CfgMissileFagot.hpp delete mode 100644 addons/missileGuidanceCompat/CfgMissileFalanga.hpp delete mode 100644 addons/missileGuidanceCompat/CfgMissileFleyta.hpp delete mode 100644 addons/missileGuidanceCompat/CfgMissileHOT.hpp delete mode 100644 addons/missileGuidanceCompat/CfgMissileIgla.hpp delete mode 100644 addons/missileGuidanceCompat/CfgMissileKH25.hpp delete mode 100644 addons/missileGuidanceCompat/CfgMissileKH29.hpp delete mode 100644 addons/missileGuidanceCompat/CfgMissileKobra.hpp delete mode 100644 addons/missileGuidanceCompat/CfgMissileKonkurs.hpp delete mode 100644 addons/missileGuidanceCompat/CfgMissileKornet.hpp delete mode 100644 addons/missileGuidanceCompat/CfgMissileMalyutka.hpp delete mode 100644 addons/missileGuidanceCompat/CfgMissileMetis.hpp delete mode 100644 addons/missileGuidanceCompat/CfgMissileMilan.hpp delete mode 100644 addons/missileGuidanceCompat/CfgMissileMolniya.hpp delete mode 100644 addons/missileGuidanceCompat/CfgMissileR73.hpp delete mode 100644 addons/missileGuidanceCompat/CfgMissileR77.hpp delete mode 100644 addons/missileGuidanceCompat/CfgMissileRefleks.hpp delete mode 100644 addons/missileGuidanceCompat/CfgMissileShturm.hpp delete mode 100644 addons/missileGuidanceCompat/CfgMissileStrela.hpp create mode 100644 addons/missileGuidanceCompat/CfgMissileTypesNato.hpp create mode 100644 addons/missileGuidanceCompat/CfgMissileTypesWarsaw.hpp delete mode 100644 addons/missileGuidanceCompat/CfgMissileVikhr.hpp delete mode 100644 addons/missileGuidanceCompat/CfgMissileVympel.hpp create mode 100644 addons/missileGuidanceCompat/patchCUP/config.cpp create mode 100644 addons/missileGuidanceCompat/script_macros.hpp diff --git a/addons/armor_modifier_ace/$PBOPREFIX$ b/addons/armor_modifier_ace/$PBOPREFIX$ new file mode 100644 index 00000000..eaf793ab --- /dev/null +++ b/addons/armor_modifier_ace/$PBOPREFIX$ @@ -0,0 +1 @@ +z\potato\addons\armor_modifier_ace diff --git a/addons/armor_modifier_ace/CfgEventHandlers.hpp b/addons/armor_modifier_ace/CfgEventHandlers.hpp new file mode 100644 index 00000000..f6503c24 --- /dev/null +++ b/addons/armor_modifier_ace/CfgEventHandlers.hpp @@ -0,0 +1,17 @@ +class Extended_PreStart_EventHandlers { + class ADDON { + init = QUOTE(call COMPILE_SCRIPT(XEH_preStart)); + }; +}; + +class Extended_PreInit_EventHandlers { + class ADDON { + init = QUOTE(call COMPILE_SCRIPT(XEH_preInit)); + }; +}; + +class Extended_PostInit_EventHandlers { + class ADDON { + init = QUOTE(call COMPILE_SCRIPT(XEH_postInit)); + }; +}; diff --git a/addons/armor_modifier_ace/LICENSE b/addons/armor_modifier_ace/LICENSE new file mode 100644 index 00000000..6f4c47cd --- /dev/null +++ b/addons/armor_modifier_ace/LICENSE @@ -0,0 +1,19 @@ +Copyright (c) 2023 johnb432 + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE +OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/addons/armor_modifier_ace/LICENSE_FOR_ACE_CODE b/addons/armor_modifier_ace/LICENSE_FOR_ACE_CODE new file mode 100644 index 00000000..50be717e --- /dev/null +++ b/addons/armor_modifier_ace/LICENSE_FOR_ACE_CODE @@ -0,0 +1,379 @@ +This license only applies to the file "fnc_handleDamage.sqf": + +============================================================================ + +Copyright (C) 2015 Felix "KoffeinFlummi" Wiegand + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License along +with this program; if not, write to the Free Software Foundation, Inc., +51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + +Additionally to the conditions of the GPL, you are granted the right to +redistribute any combination of the .pbo-files of the finished product +without having to share your source code, as long as you do not modify the +source code of the individual modules. + +When publishing a derivative of this product you may not use a name that +might create the impression that your version is an official release. + +Some folders of this project may contain a separate LICENSE file. Should +that be the case, everything in that folder and all subfolders is subject +to that license instead. + + - ARMA PUBLIC LICENSE (\addons\apl) + - CreativeCommons Attributions 3.0 (\addons\fastroping\data\sounds) + +============================================================================ + Full GNU General Public License Text +============================================================================ + + +GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Lesser General Public License instead.) You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + {description} + Copyright (C) {year} {fullname} + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: + + Gnomovision version 69, Copyright (C) year name of author + Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, the commands you use may +be called something other than `show w' and `show c'; they could even be +mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the program + `Gnomovision' (which makes passes at compilers) written by James Hacker. + + {signature of Ty Coon}, 1 April 1989 + Ty Coon, President of Vice + +This General Public License does not permit incorporating your program into +proprietary programs. If your program is a subroutine library, you may +consider it more useful to permit linking proprietary applications with the +library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. diff --git a/addons/armor_modifier_ace/XEH_PREP.hpp b/addons/armor_modifier_ace/XEH_PREP.hpp new file mode 100644 index 00000000..b2322204 --- /dev/null +++ b/addons/armor_modifier_ace/XEH_PREP.hpp @@ -0,0 +1,4 @@ +PREP(handleDamage); +PREP(resolveHitPoints); +PREP(setClassArmor); +PREP(setUnitArmor); \ No newline at end of file diff --git a/addons/armor_modifier_ace/XEH_postInit.sqf b/addons/armor_modifier_ace/XEH_postInit.sqf new file mode 100644 index 00000000..ad446146 --- /dev/null +++ b/addons/armor_modifier_ace/XEH_postInit.sqf @@ -0,0 +1,38 @@ +#include "script_component.hpp" + +// Call in post init, so that we are sure to overwrite default ACE damage handling and any other mods interfering with ACE medical +["CAManBase", "initPost", { + params ["_unit"]; + + private _ehID = _unit getVariable [QACEGVAR(medical,HandleDamageEHID), -1]; + + // If no EH exists, don't add one + if (_ehID == -1) exitWith {}; + + // Replace existing ace medical damage event handler + _unit removeEventHandler ["HandleDamage", _ehID]; + + _ehID = _unit addEventHandler ["HandleDamage", {[_this] call FUNC(handleDamage)}]; + + _unit setVariable [QACEGVAR(medical,HandleDamageEHID), _ehID]; +}, true, [], true] call CBA_fnc_addClassEventHandler; + +[QGVAR(updateUnitArmor), { + params ["_unit", "_hitPoint", "_armorArray"]; + if (!alive _unit) exitWith {}; + private _newHash = +(_unit getVariable [QGVAR(armorHash), GVAR(defaultArmorHash)]); + {_newHash set [_x, _armorArray]} forEach (_hitPoint call FUNC(resolveHitPoints)); + _unit setVariable [QGVAR(armorHash), _newHash]; +}] call CBA_fnc_addEventHandler; + +[QGVAR(updateClassArmor), { + params ["_class", "_hitPoint", "_armorArray"]; + private _classHashMap = GVAR(classArmorHash) getOrDefaultCall [_class, { + [_class, "init", { + params ["_unit"]; + _unit setVariable [QGVAR(armorHash), GVAR(classArmorHash) getOrDefault [(typeOf _unit), DEFAULT_HASH_SETTINGS]]; + }, false] call CBA_fnc_addClassEventHandler; + +GVAR(defaultArmorHash) + }, true]; + {_classHashMap set [_x, _armorArray]} forEach (_hitPoint call FUNC(resolveHitPoints)); +}] call CBA_fnc_addEventHandler; diff --git a/addons/armor_modifier_ace/XEH_preInit.sqf b/addons/armor_modifier_ace/XEH_preInit.sqf new file mode 100644 index 00000000..a9a106a1 --- /dev/null +++ b/addons/armor_modifier_ace/XEH_preInit.sqf @@ -0,0 +1,12 @@ +#include "script_component.hpp" + +ADDON = false; + +#include "XEH_PREP.hpp" +GVAR(armorValueHash) = createHashMap; +GVAR(classArmorHash) = createHashMap; +GVAR(defaultArmorHash) = DEFAULT_HASH_SETTINGS; +// CBA Settings +#include "initSettings.inc.sqf" + +ADDON = true; diff --git a/addons/armor_modifier_ace/XEH_preStart.sqf b/addons/armor_modifier_ace/XEH_preStart.sqf new file mode 100644 index 00000000..02288857 --- /dev/null +++ b/addons/armor_modifier_ace/XEH_preStart.sqf @@ -0,0 +1,3 @@ +#include "script_component.hpp" + +#include "XEH_PREP.hpp" diff --git a/addons/armor_modifier_ace/config.cpp b/addons/armor_modifier_ace/config.cpp new file mode 100644 index 00000000..d66b108e --- /dev/null +++ b/addons/armor_modifier_ace/config.cpp @@ -0,0 +1,22 @@ +#include "script_component.hpp" + +class CfgPatches { + class ADDON { + units[] = {}; + weapons[] = {}; + requiredVersion = REQUIRED_VERSION; + requiredAddons[] = { + "ace_medical_engine" + }; + author = "johnb43"; + authors[] = { + "johnb43", + "Lambda.Tiger" + }; + skipWhenMissingDependencies = 1; + authorUrl = "https://github.com/BourbonWarfare/POTATO"; + VERSION_CONFIG; + }; +}; + +#include "CfgEventHandlers.hpp" diff --git a/addons/armor_modifier_ace/functions/fnc_handleDamage.sqf b/addons/armor_modifier_ace/functions/fnc_handleDamage.sqf new file mode 100644 index 00000000..1742b869 --- /dev/null +++ b/addons/armor_modifier_ace/functions/fnc_handleDamage.sqf @@ -0,0 +1,257 @@ +#include "..\script_component.hpp" + +/* + * Author: commy2, kymckay, modified by johnb43 & Lambda.Tiger + * Original: + * HandleDamage EH where wound events are raised based on incoming damage. + * Be aware that for each source of damage, the EH can fire multiple times (once for each hitpoint). + * We store these incoming damages and compare them on our final hitpoint: "ace_hdbracket". + * Added: + * Handling of damage to allow armor modifcation. + * + * Arguments: + * Handle damage EH + * + * Return Value: + * Damage to be inflicted + * + * Public: No + */ + +params ["_args", ["_ignoreAllowDamageACE", false]]; +_args params ["_unit", "_selection", "_damage", "_shooter", "_ammo", "_hitPointIndex", "_instigator", "_hitpoint", "_directHit", "_context"]; + +// HD sometimes triggers for remote units - ignore. +if !(local _unit) exitWith {nil}; + +// Get missing meta info +private _oldDamage = 0; +private _structuralDamage = _context == 0; + +if (_hitPoint isEqualTo "") then { + _hitPoint = "#structural"; + _oldDamage = damage _unit; +} else { + _oldDamage = _unit getHitIndex _hitPointIndex; +}; + +// Damage can be disabled with old variable or via sqf command allowDamage +if !(isDamageAllowed _unit && {_unit getVariable ["ace_medical_allowDamage", true] || _ignoreAllowDamageACE}) exitWith {_oldDamage}; + +private _newDamage = _damage - _oldDamage; + +// _newDamage == 0 happens occasionally for vehiclehit events (see line 80 onwards), just exit early to save some frametime +// context 4 is engine "bleeding". For us, it's just a duplicate event for #structural which we can ignore without any issues +if (_context != 2 && {_context == 4 || _newDamage == 0}) exitWith { + TRACE_4("Skipping engine bleeding or zero damage",_ammo,_newDamage,_directHit,_context); + _oldDamage +}; + +// Get scaled armor value of hitpoint and calculate damage before armor +// We scale using passThrough to handle explosive-resistant armor properly (#9063) +// We need realDamage to determine which limb was hit correctly +[_unit, _hitpoint] call ace_medical_engine_fnc_getHitpointArmor params ["_armor", "_armorScaled"]; +private _realDamage = _newDamage * _armor; +if (!_structuralDamage) then { + private _armorCoef = _armor/_armorScaled; + private _damageCoef = linearConversion [0, 1, ace_medical_engine_damagePassThroughEffect, 1, _armorCoef]; + _newDamage = _newDamage * _damageCoef; +}; +TRACE_6("Received hit",_hitpoint,_ammo,_newDamage,_realDamage,_directHit,_context); + +// Drowning doesn't fire the EH for each hitpoint so the "ace_hdbracket" code never runs +// Damage occurs in consistent increments +if ( + _structuralDamage && + {getOxygenRemaining _unit <= 0.5} && + {_damage isEqualTo (_oldDamage + 0.005)} +) exitWith { + TRACE_5("Drowning",_unit,_shooter,_instigator,_damage,_newDamage); + ["ace_medical_woundReceived", [_unit, [[_newDamage, "Body", _newDamage]], _unit, "drowning"]] call CBA_fnc_localEvent; + + 0 +}; + +// Faster than (vehicle _unit), also handles dead units +private _vehicle = objectParent _unit; +private _inVehicle = !isNull _vehicle; +private _environmentDamage = _ammo == ""; + +// Crashing a vehicle doesn't fire the EH for each hitpoint so the "ace_hdbracket" code never runs +// It does fire the EH multiple times, but this seems to scale with the intensity of the crash +if ( + ace_medical_enableVehicleCrashes && + {_environmentDamage && _inVehicle && _structuralDamage} && + {vectorMagnitude (velocity _vehicle) > 5} + // todo: no way to detect if stationary and another vehicle hits you +) exitWith { + TRACE_5("Crash",_unit,_shooter,_instigator,_damage,_newDamage); + ["ace_medical_woundReceived", [_unit, [[_newDamage, _hitPoint, _newDamage]], _unit, "vehiclecrash"]] call CBA_fnc_localEvent; + + 0 +}; + +// Receiving explosive damage inside a vehicle doesn't trigger for each hitpoint +// This is the case for mines, explosives, artillery, and catasthrophic vehicle explosions +if ( + (!_environmentDamage && _inVehicle && _structuralDamage) && + { + private _ammoCfg = configFile >> "CfgAmmo" >> _ammo; + GET_NUMBER(_ammoCfg >> "explosive",0) > 0 || + {GET_NUMBER(_ammoCfg >> "indirectHit",0) > 0} + } +) exitWith { + TRACE_5("Vehicle hit",_unit,_shooter,_instigator,_damage,_newDamage); + + _unit setVariable ["ace_medical_lastDamageSource", _shooter]; + _unit setVariable ["ace_medical_lastInstigator", _instigator]; + + ["ace_medical_woundReceived", [_unit, [[_newDamage, _hitPoint, _newDamage]], _shooter, "vehiclehit"]] call CBA_fnc_localEvent; + + 0 +}; + +// Get setting for particular unit +private _multiplierArray = _unit getVariable [QGVAR(armorHash), + GVAR(armorValueHash) getOrDefault [ + side _unit, + GVAR(defaultArmorHash) + ] +] getOrDefault [_hitPoint, DEFAULT_SETTINGS, true]; + +private _modifiedNewDamage = _newDamage; +private _modifiedRealDamage = _realDamage; + +// If default settings, we don't need to change anything, so skip calculcations and let ace handle damage +if (_multiplierArray isNotEqualTo DEFAULT_SETTINGS) then { + _multiplierArray params ["_hitPointTimeser", "_armorMin", "_armorMax"]; + + switch (true) do { + case (_armorMin >= 1 && {_armor < _armorMin}): { + // This will decrease damage + _modifiedNewDamage = _newDamage * _armor / _armorMin; + _modifiedRealDamage = _realDamage * _armor / _armorMin; + + TRACE_6("Under min armor",_armor,_armorMin,_newDamage,_modifiedNewDamage,_realDamage,_modifiedRealDamage); + }; + case (_armorMax >= 1 && {_armor > _armorMax}): { + // This will increase damage + _modifiedNewDamage = _newDamage * _armor / _armorMax; + _modifiedRealDamage = _realDamage * _armor / _armorMax; + + TRACE_6("Over max armor",_armor,_armorMax,_newDamage,_modifiedNewDamage,_realDamage,_modifiedRealDamage); + }; + }; + + _modifiedNewDamage = _modifiedNewDamage / _hitPointTimeser; + _modifiedRealDamage = _modifiedRealDamage / _hitPointTimeser; + + TRACE_5("Hitpoint damage multiplied",_armor,_newDamage,_modifiedNewDamage,_realDamage,_modifiedRealDamage); +}; + +// Damages are stored for last iteration of the HandleDamage event (_context == 2) +_unit setVariable [format ["ace_medical_engine_$%1", _hitPoint], [_realDamage, _newDamage, _modifiedRealDamage, _modifiedNewDamage]]; + +// Ref https://community.bistudio.com/wiki/Arma_3:_Event_Handlers#HandleDamage +// Context 2 means this is the last iteration of HandleDamage, so figure out which hitpoint took the most real damage and send wound event +// Don't exit, as the last iteration can be one of the hitpoints that we need to keep _oldDamage for +if (_context == 2) then { + _unit setVariable ["ace_medical_lastDamageSource", _shooter]; + _unit setVariable ["ace_medical_lastInstigator", _instigator]; + + private _damageStructural = _unit getVariable ["ace_medical_engine_$#structural", [0,0,0,0]]; + + // --- Head + private _damageHead = [ + _unit getVariable ["ace_medical_engine_$HitFace", [0,0,0,0]], + _unit getVariable ["ace_medical_engine_$HitNeck", [0,0,0,0]], + _unit getVariable ["ace_medical_engine_$HitHead", [0,0,0,0]] + ]; + _damageHead sort false; + _damageHead = _damageHead select 0; + + // --- Body + private _damageBody = [ + _unit getVariable ["ace_medical_engine_$HitPelvis", [0,0,0,0]], + _unit getVariable ["ace_medical_engine_$HitAbdomen", [0,0,0,0]], + _unit getVariable ["ace_medical_engine_$HitDiaphragm", [0,0,0,0]], + _unit getVariable ["ace_medical_engine_$HitChest", [0,0,0,0]] + // HitBody removed as it's a placeholder hitpoint and the high armor value (1000) throws the calculations off + ]; + _damageBody sort false; + _damageBody = _damageBody select 0; + + // --- Arms and Legs + private _damageLeftArm = _unit getVariable ["ace_medical_engine_$HitLeftArm", [0,0,0,0]]; + private _damageRightArm = _unit getVariable ["ace_medical_engine_$HitRightArm", [0,0,0,0]]; + private _damageLeftLeg = _unit getVariable ["ace_medical_engine_$HitLeftLeg", [0,0,0,0]]; + private _damageRightLeg = _unit getVariable ["ace_medical_engine_$HitRightLeg", [0,0,0,0]]; + + // Find hit point that received the maxium damage + // Priority used for sorting if incoming damage is equal + private _allDamages = [ + // Real damage (ignoring armor), Actual damage (with armor), Real damage modified (ignoring armor), Modified damage (with armor) + [_damageHead select 0, PRIORITY_HEAD, _damageHead select 1, "Head", _damageHead param [2, _damageHead select 0], _damageHead param [3, _damageHead select 1]], + [_damageBody select 0, PRIORITY_BODY, _damageBody select 1, "Body", _damageBody param [2, _damageBody select 0], _damageBody param [3, _damageBody select 1]], + [_damageLeftArm select 0, PRIORITY_LEFT_ARM, _damageLeftArm select 1, "LeftArm", _damageLeftArm param [2, _damageLeftArm select 0], _damageLeftArm param [3, _damageLeftArm select 1]], + [_damageRightArm select 0, PRIORITY_RIGHT_ARM, _damageRightArm select 1, "RightArm", _damageRightArm param [2, _damageRightArm select 0], _damageRightArm param [3, _damageRightArm select 1]], + [_damageLeftLeg select 0, PRIORITY_LEFT_LEG, _damageLeftLeg select 1, "LeftLeg", _damageLeftLeg param [2, _damageLeftLeg select 0], _damageLeftLeg param [3, _damageLeftLeg select 1]], + [_damageRightLeg select 0, PRIORITY_RIGHT_LEG, _damageRightLeg select 1, "RightLeg", _damageRightLeg param [2, _damageRightLeg select 0], _damageRightLeg param [3, _damageRightLeg select 1]], + [_damageStructural select 0, PRIORITY_STRUCTURAL, _damageStructural select 1, "#structural", _damageStructural param [2, _damageStructural select 0], _damageStructural param [3, _damageStructural select 1]] + ]; + TRACE_2("incoming",_allDamages,_damageStructural); + + _allDamages sort false; + // Use modified damages instead of initial ones + _allDamages = _allDamages apply {[_x select 5, _x select 3, _x select 4]}; + + // Environmental damage sources all have empty ammo string + // No explicit source given, we infer from differences between them + if (_environmentDamage) then { + // Any collision with terrain/vehicle/object has a shooter + // Check this first because burning can happen at any velocity + if !(isNull _shooter) then { + /* + If shooter != unit then they hit unit, otherwise it could be: + - Unit hitting anything at speed + - An empty vehicle hitting unit + - A physX object hitting unit + Assume fall damage for downward velocity because it's most common + */ + if (_shooter == _unit && {(velocity _unit select 2) < -2}) then { + _ammo = "falling"; + TRACE_5("Fall",_unit,_shooter,_instigator,_damage,_allDamages); + } else { + _ammo = "collision"; + TRACE_5("Collision",_unit,_shooter,_instigator,_damage,_allDamages); + }; + } else { + // Anything else is almost guaranteed to be fire damage + _ammo = "fire"; + TRACE_5("Fire Damage",_unit,_shooter,_instigator,_damage,_allDamages); + }; + }; + + // No wounds for minor damage + // TODO check if this needs to be changed for burning damage (occurs as lots of small events that we add together) + if ((_allDamages select 0 select 0) > 1E-3) then { + TRACE_1("received",_allDamages); + ["ace_medical_woundReceived", [_unit, _allDamages, _shooter, _ammo]] call CBA_fnc_localEvent; + }; + + // Clear stored damages otherwise they will influence future damage events + // (aka wounds will pile onto the historically most damaged hitpoint) + { + _unit setVariable [_x, nil]; + } forEach [ + "ace_medical_engine_$HitFace","ace_medical_engine_$HitNeck","ace_medical_engine_$HitHead", + "ace_medical_engine_$HitPelvis","ace_medical_engine_$HitAbdomen","ace_medical_engine_$HitDiaphragm","ace_medical_engine_$HitChest","ace_medical_engine_$HitBody", + "ace_medical_engine_$HitLeftArm","ace_medical_engine_$HitRightArm","ace_medical_engine_$HitLeftLeg","ace_medical_engine_$HitRightLeg", + "ace_medical_engine_$#structural" + ]; +}; + +// Engine damage to these hitpoints controls blood visuals, limping, weapon sway +// Handled in fnc_damageBodyPart, persist here +// For all other hitpoints, we store our own damage values, so engine damage is unnecessary +[0, _oldDamage] select (_hitPoint in ["hithead", "hitbody", "hithands", "hitlegs"]) diff --git a/addons/armor_modifier_ace/functions/fnc_resolveHitPoints.sqf b/addons/armor_modifier_ace/functions/fnc_resolveHitPoints.sqf new file mode 100644 index 00000000..cd6ceb21 --- /dev/null +++ b/addons/armor_modifier_ace/functions/fnc_resolveHitPoints.sqf @@ -0,0 +1,37 @@ +#include "../script_component.hpp" +/* + * Author: Lambda.Tiger + * Sets the armor value for a specific class. + * + * Arguments: + * 0: Hit point to resolve to one or more hitpoints + * + * Return Value: + * Array of hitpoints + * + * Public: Yes + */ +params [["_hitPoint", "", [""]]]; + +_hitPoint = toLowerANSI _hitPoint; + +switch (_hitPoint) do { + case "ama_hitbody": { + ["hitabdomen", "hitdiaphragm", "hitchest", "hitpelvis"] + }; + case "ama_hittorso": { + ["hitabdomen", "hitdiaphragm", "hitchest"] + }; + case "ama_hitarms": { + ["hitleftarm", "hitrightarm"] + }; + case "ama_hitlegs": { + ["hitleftleg", "hitrightleg"] + }; + case "ama_hitlimbs": { + ["hitleftarm", "hitrightarm", "hitleftleg", "hitrightleg"] + }; + default { + [_hitPoint] + }; +} diff --git a/addons/armor_modifier_ace/functions/fnc_setClassArmor.sqf b/addons/armor_modifier_ace/functions/fnc_setClassArmor.sqf new file mode 100644 index 00000000..5d60c312 --- /dev/null +++ b/addons/armor_modifier_ace/functions/fnc_setClassArmor.sqf @@ -0,0 +1,39 @@ +#include "..\script_component.hpp" +/* + * Author: Lambda.Tiger + * Sets the armor value for a specific class. This is not retroactive or inherited. + * + * Arguments: + * 0: Unit classname to set hit point armor values + * 1: Hit point to apply armor value to + * 2: Armor array in format [multiplier, minimum, maximum] + * + * Return Value: + * None + * + * Example: + * [typeOf player, "hitFace", [1, 2, 2]] call potato_armor_modifier_ace_fnc_setClassArmor; + * [typeOf player, "ama_hitTorso", [1, 2, 2]] call potato_armor_modifier_ace_fnc_setClassArmor; + * + * Public: Yes + */ +params [ + ["_classname", "", [""]], + ["_hitPoint", "", [""]], + ["_armorArray", [1, 0, 0], [[]], [3]] +]; + +_hitPoint = toLowerANSI _hitPoint; + +if (_classname == "") exitWith { + ["No classname given",2] call ace_common_fnc_displayTextStructured; +}; +if (_hitPoint == "") exitWith { + ["No hitpoint given",2] call ace_common_fnc_displayTextStructured; +}; +if (false in (_armorArray apply {_x isEqualType 0})) exitWith { + [format ["Invalid format for _armorArray: %1", _armorArray],2] call ace_common_fnc_displayTextStructured; +}; + +_this set [1, _hitPoint]; +[QGVAR(updateClassArmor), _this] call CBA_fnc_globalEventJIP; diff --git a/addons/armor_modifier_ace/functions/fnc_setUnitArmor.sqf b/addons/armor_modifier_ace/functions/fnc_setUnitArmor.sqf new file mode 100644 index 00000000..4fd160f6 --- /dev/null +++ b/addons/armor_modifier_ace/functions/fnc_setUnitArmor.sqf @@ -0,0 +1,40 @@ +#include "..\script_component.hpp" +/* + * Author: Lambda.Tiger + * Sets the armor value for a specific unit. + * + * Arguments: + * 0: Unit to set hit point armor values + * 1: Hit point to apply armor value to + * 2: Armor array in format [multiplier, minimum, maximum] + * + * Return Value: + * None + * + * Example: + * [cursorObject, "hitFace", [1, 2, 2]] call potato_armor_modifier_ace_fnc_setUnitArmor; + * [player, "ama_hitTorso", [1, 2, 2]] call potato_armor_modifier_ace_fnc_setUnitArmor; + * + * Public: Yes + */ +params [ + ["_unit", objNull, [objNull]], + ["_hitPoint", "", [""]], + ["_armorArray", [1, 0, 0], [[]], [3]] +]; + +_hitPoint = toLowerANSI _hitPoint; + +if (isNull _unit) exitWith { + ["Null unit given",2] call ace_common_fnc_displayTextStructured; +}; +if (_hitPoint == "") exitWith { + ["No hitpoint given",2] call ace_common_fnc_displayTextStructured; +}; +if (false in (_armorArray apply {_x isEqualType 0})) exitWith { + [format ["Invalid format for _armorArray: %1", _armorArray],2] call ace_common_fnc_displayTextStructured; +}; + +_this set [1, _hitPoint]; +private _jipID = [QGVAR(updateUnitArmor), _this] call CBA_fnc_globalEventJIP; +[_jipID, _unit] call CBA_fnc_removeGlobalEventJIP; diff --git a/addons/armor_modifier_ace/initSettings.inc.sqf b/addons/armor_modifier_ace/initSettings.inc.sqf new file mode 100644 index 00000000..6a152ec3 --- /dev/null +++ b/addons/armor_modifier_ace/initSettings.inc.sqf @@ -0,0 +1,61 @@ +//#pragma hemtt suppress command_case file +#define HITPOINT_SETTINGS_FUNCTION(HITPOINT,SIDE_CMD) {\ + private _newSettings = parseSimpleArray _this;\ + private _parsedSettings = [];\ + \ + {\ + if (_x isEqualType 0) then {\ + _parsedSettings pushBack (_x max (MINIMUM_SETTINGS select _forEachIndex));\ + } else {\ + _parsedSettings pushBack (DEFAULT_SETTINGS select _forEachIndex);\ + };\ + } forEach _newSettings;\ + \ + if (_parsedSettings isNotEqualTo _newSettings) then {\ + [ARR_2("A setting was set too low or otherwise incorrectly, reverting to default setting.",3)] call ace_common_fnc_displayTextStructured;\ + };\ + \ + private _hitPointHashMap = GVAR(armorValueHash) getOrDefault [SIDE_CMD, createHashMap, true];\ + switch (QUOTE(HITPOINT)) do {\ + case QUOTE(torso): {\ + _hitPointHashMap set ["hitabdomen", _parsedSettings];\ + _hitPointHashMap set ["hitdiaphragm", _parsedSettings];\ + _hitPointHashMap set ["hitchest", _parsedSettings];\ + };\ + case QUOTE(arms): {\ + _hitPointHashMap set ["hitleftarm", _parsedSettings];\ + _hitPointHashMap set ["hitrightarm", _parsedSettings];\ + };\ + case QUOTE(legs): {\ + _hitPointHashMap set ["hitleftleg", _parsedSettings];\ + _hitPointHashMap set ["hitrightleg", _parsedSettings];\ + };\ + default {\ + _hitPointHashMap set [FORMAT_1("hit%1",QUOTE(HITPOINT)), _parsedSettings];\ + };\ + };\ +} + +#define HITPOINT_SETTINGS_SIDE(TYPE,SIDE_CMD,HITPOINT,TEXT,DEFAULT_ARRAY)\ +[\ + QGVAR(DOUBLES(TYPE,HITPOINT)),\ + "EDITBOX",\ + [TEXT, "Allows the tuning the effectiveness of groups of armor hitpoints.\n[hitpoint multiplier, minimum armor, maximum armor]\nIf minimum or maximum armor value is below 1, they don't take effect."],\ + [COMPONENT_NAME, FORMAT_1("Armor modifiers - %1",QUOTE(TYPE))],\ + QUOTE(DEFAULT_ARRAY),\ + true,\ + HITPOINT_SETTINGS_FUNCTION(HITPOINT,SIDE_CMD)\ +] call CBA_fnc_addSetting + +#define HITPOINT_CHECK_SETTING_SIDE(OBJECT,SIDE_CMD) HITPOINT_SETTINGS_SIDE(OBJECT,SIDE_CMD,head,FORMAT_1("%1 hitpoint damage reduction - head",QUOTE(OBJECT)),ARR_3([1,7,7]));\ +HITPOINT_SETTINGS_SIDE(OBJECT,SIDE_CMD,face,FORMAT_1("%1 hitpoint damage reduction - face",QUOTE(OBJECT)),ARR_3([1,0,1]));\ +HITPOINT_SETTINGS_SIDE(OBJECT,SIDE_CMD,neck,FORMAT_1("%1 hitpoint damage reduction - neck",QUOTE(OBJECT)),ARR_3([1,0,1]));\ +HITPOINT_SETTINGS_SIDE(OBJECT,SIDE_CMD,torso,FORMAT_1("%1 hitpoint damage reduction - torso",QUOTE(OBJECT)),ARR_3([1,14,14]));\ +HITPOINT_SETTINGS_SIDE(OBJECT,SIDE_CMD,pelvis,FORMAT_1("%1 hitpoint damage reduction - pelvis",QUOTE(OBJECT)),ARR_3([1,14,14]));\ +HITPOINT_SETTINGS_SIDE(OBJECT,SIDE_CMD,arms,FORMAT_1("%1 hitpoint damage reduction - arms",QUOTE(OBJECT)),ARR_3([1,0,1]));\ +HITPOINT_SETTINGS_SIDE(OBJECT,SIDE_CMD,legs,FORMAT_1("%1 hitpoint damage reduction - legs",QUOTE(OBJECT)),ARR_3([1,0,1])) + +HITPOINT_CHECK_SETTING_SIDE(BluFor,blufor); +HITPOINT_CHECK_SETTING_SIDE(OpFor,opfor); +HITPOINT_CHECK_SETTING_SIDE(Independent,independent); +HITPOINT_CHECK_SETTING_SIDE(Civilian,civilian); diff --git a/addons/armor_modifier_ace/script_component.hpp b/addons/armor_modifier_ace/script_component.hpp new file mode 100644 index 00000000..1bece87f --- /dev/null +++ b/addons/armor_modifier_ace/script_component.hpp @@ -0,0 +1,38 @@ +#define COMPONENT armor_modifier_ace +#include "\z\potato\addons\core\script_mod.hpp" + +// #define DEBUG_MODE_FULL +// #define DISABLE_COMPILE_CACHE +// #define DEBUG_SYNCHRONOUS +// #define ENABLE_PERFORMANCE_COUNTERS + +#ifdef DEBUG_ENABLED_ARMOR_MODIFIER_ACE + #define DEBUG_MODE_FULL +#endif + +#ifdef DEBUG_SETTINGS_ARMOR_MODIFIER_ACE + #define DEBUG_SETTINGS DEBUG_SETTINGS_ARMOR_MODIFIER_ACE +#endif + +#include "\z\potato\addons\core\script_macros.hpp" +#define GETMVAR(var1,var2) (missionNamespace getVariable [ARR_2(var1,var2)]) +#define SETMVAR(var1,var2,var3) (missionNamespace setVariable [ARR_3(var1,var2,var3)]) + +#define DEFAULT_SETTINGS [ARR_3(1,0,0)] +#define MINIMUM_SETTINGS [ARR_3(0.001,0,0)] +#define DEFAULT_HASH_SETTINGS createHashMapFromArray [["hithead",[1,0,0]],["hitdiaphragm",[1,0,0]],["hitleftarm",[1,0,0]],["hitleftleg",[1,0,0]],["hitneck",[1,0,0]],["hitpelvis",[1,0,0]],["hitrightleg",[1,0,0]],["hitchest",[1,0,0]],["hitabdomen",[1,0,0]],["hitrightarm",[1,0,0]],["hitface",[1,0,0]]] + +#define DFUNC(var1) TRIPLES(ADDON,fnc,var1) + +// #include "\z\ace\addons\medical_engine\script_component.hpp" +#define PRIORITY_HEAD 3 +#define PRIORITY_BODY 4 +#define PRIORITY_LEFT_ARM (1 + random 1) +#define PRIORITY_RIGHT_ARM (1 + random 1) +#define PRIORITY_LEFT_LEG (1 + random 1) +#define PRIORITY_RIGHT_LEG (1 + random 1) +#define PRIORITY_STRUCTURAL 1 + +#define GET_NUMBER(config,default) (if (isNumber (config)) then {getNumber (config)} else {default}) + +#define COMPONENT_NAME QUOTE(POTATO - Armor Modifier ACE) diff --git a/addons/assignGear/XEH_PREP.hpp b/addons/assignGear/XEH_PREP.hpp index cd9c71dc..5861213e 100644 --- a/addons/assignGear/XEH_PREP.hpp +++ b/addons/assignGear/XEH_PREP.hpp @@ -3,12 +3,13 @@ TRACE_1("",QUOTE(ADDON)); PREP(addItemsToContainer); PREP(addSupplyBoxActions); PREP(assignGearMan); -PREP(assignGearSupplyBox); PREP(assignGearPotatoBox); +PREP(assignGearSupplyBox); +PREP(assignGearVehicle_asBoxes); PREP(assignGearVehicle); -PREP(cleanPrefix); PREP(changeableOptics_getChildren); PREP(changeableOptics_setOptic); +PREP(cleanPrefix); PREP(getContainerInfo); PREP(getDisposableInfo); // temp?? for cba change to disposable hash maps PREP(getLinkedIndex); diff --git a/addons/assignGear/functions/fnc_assignGearSupplyBox.sqf b/addons/assignGear/functions/fnc_assignGearSupplyBox.sqf index 9869a273..7ed1f4c8 100644 --- a/addons/assignGear/functions/fnc_assignGearSupplyBox.sqf +++ b/addons/assignGear/functions/fnc_assignGearSupplyBox.sqf @@ -4,6 +4,8 @@ * Fills supply box with gear for a faction * Edit by Lambda.tiger * Supports boxes containing other boxes + * Edit by Lambda.tiger + * Supports boxes containing other boxes * * Arguments: * 0: Box diff --git a/addons/assignGear/functions/fnc_assignGearVehicle.sqf b/addons/assignGear/functions/fnc_assignGearVehicle.sqf index fe625c2b..3e7e0943 100644 --- a/addons/assignGear/functions/fnc_assignGearVehicle.sqf +++ b/addons/assignGear/functions/fnc_assignGearVehicle.sqf @@ -15,11 +15,6 @@ * * Public: Yes */ - -#define BAGS_PER_BOX 10 -#define WEAPONS_PER_BOX 5 -#define MAGAZINES_PER_BOX 100 - params ["_theVehicle", "_defaultLoadout"]; TRACE_2("assignGearVehicle",_theVehicle,_defaultLoadout); @@ -80,256 +75,12 @@ if (!isClass _path) exitWith { }; //Clean out starting inventory (even if there is no class) - switch (GVAR(setVehicleLoadouts)) do { case 1: { // ammo in vehicle inventory [_theVehicle, _path] call FUNC(setContainerContentsFromConfig); }; - case 2: { // ammo in boxes in vehicle from inventory - private _getMassLbs = { - params ["_config"]; - private _mass = getNumber (_config >> "mass"); - - if (_mass == 0 && {isClass (_config >> "itemInfo")}) then { - _mass = getNumber (_config >> "itemInfo" >> "mass"); - }; - - if (_mass == 0 && {isClass (_config >> "WeaponSlotsInfo")}) then { - _mass = getNumber (_config >> "WeaponSlotsInfo" >> "mass"); - }; - _mass / 10 - }; - - private _getShortName = { - params ["_displayName"]; - (_displayName splitString " ") params ["_f", "_s"]; - private _shortName = format ["%1 %2", _f, _s]; - if (isNil "_s") then { - _shortName = _f; - }; - _shortName - }; - - clearWeaponCargoGlobal _theVehicle; - clearMagazineCargoGlobal _theVehicle; - clearItemCargoGlobal _theVehicle; - clearBackpackCargoGlobal _theVehicle; - - private _transportMagazines = getArray(_path >> "TransportMagazines"); - private _transportItems = getArray(_path >> "TransportItems"); - private _transportWeapons = getArray(_path >> "TransportWeapons"); - private _transportBackpacks = getArray(_path >> "TransportBackpacks"); - private _transportBoxClassname = getText(_path >> "AmmoBox"); - if (_transportBoxClassname == "") then { - _transportBoxClassname = "Box_NATO_Ammo_F"; - }; - private _transportBoxWeight = getNumber(_path >> "AmmoBoxCapacity"); - if (_transportBoxWeight == 0) then { - _transportBoxWeight = 75; - }; - - private _loadoutInfo = createHashMap; - private _availableMagazines = []; - private _availableItems = []; - private _availableWeapons = []; - private _availableBackpacks = []; - // transportMagazines - { - (_x splitString ":") params ["_classname", ["_amount", "1", [""]]]; - _availableMagazines pushBackUnique _classname; - private _config = configFile >> "CfgMagazines" >> _classname; - (_loadoutInfo getOrDefault [_classname, [0, _config call _getMassLbs, getText (_config >> "displayName")]]) params ["_existingAmount", "_mass", "_name"]; - _loadoutInfo set [_classname, [_existingAmount + parseNumber _amount, _mass, _name]]; - nil - } count _transportMagazines; // count used here for speed, make sure nil is above this line - - // transportItems - { - (_x splitString ":") params ["_classname", ["_amount", "1", [""]]]; - _availableItems pushBackUnique _classname; - private _config = configFile >> "CfgWeapons" >> _classname; - (_loadoutInfo getOrDefault [_classname, [0, _config call _getMassLbs, getText (_config >> "displayName")]]) params ["_existingAmount", "_mass", "_name"]; - _loadoutInfo set [_classname, [_existingAmount + parseNumber _amount, _mass, _name]]; - nil - } count _transportItems; // count used here for speed, make sure nil is above this line - - // transportWeapons - { - (_x splitString ":") params ["_classname", ["_amount", "1", [""]]]; - private _disposableName = [cba_disposable_LoadedLaunchers, _classname, "get", ""] call FUNC(getDisposableInfo); - if (_disposableName != "") then { - TRACE_2("cba_disposable_LoadedLaunchers replace",_classname,_disposableName); - _classname = _disposableName; - }; - _availableWeapons pushBackUnique _classname; - private _config = configFile >> "CfgWeapons" >> _classname; - (_loadoutInfo getOrDefault [_classname, [0, _config call _getMassLbs, getText (_config >> "displayName")]]) params ["_existingAmount", "_mass", "_name"]; - _loadoutInfo set [_classname, [_existingAmount + parseNumber _amount, _mass, _name]]; - nil - } count _transportWeapons; // count used here for speed, make sure nil is above this line - - // transportBackpacks - { - (_x splitString ":") params ["_classname", ["_amount", "1", [""]]]; - _availableBackpacks pushBackUnique _classname; - private _config = configFile >> "CfgBackpacks" >> _classname; - (_loadoutInfo getOrDefault [_classname, [0, _config call _getMassLbs, getText (_config >> "displayName")]]) params ["_existingAmount", "_mass", "_name"]; - _loadoutInfo set [_classname, [_existingAmount + parseNumber _amount, _mass, _name]]; - nil - } count _transportBackpacks; // count used here for speed, make sure nil is above this line - - while { - _availableBackpacks isNotEqualTo [] || - { _availableItems isNotEqualTo [] } || - { _availableWeapons isNotEqualTo [] } || - { _availableMagazines isNotEqualTo [] } - } do { - scopeName "item_select_loop"; - private _currentWeight = 0; - private _box = createVehicle [_transportBoxClassname, [0, 0, 0], [], 0, "NONE"]; - clearWeaponCargoGlobal _box; - clearMagazineCargoGlobal _box; - clearItemCargoGlobal _box; - clearBackpackCargoGlobal _box; - [_box, 0] call ace_cargo_fnc_setSize; - [_box, _theVehicle, true] call ace_cargo_fnc_loadItem; - - private _name = []; - if (_currentWeight < _transportBoxWeight && _availableBackpacks isNotEqualTo []) then { - scopeName "add_Backpack"; - private _chosen = ""; - private _amounts = [0]; - for "_i" from 0 to BACKPACKS_PER_BOX do { - // check if Backpacks of this type remain - if ((_amounts select 0) == 0) then { - _loadoutInfo deleteAt _chosen; - if (_availableBackpacks isEqualTo []) exitWith { - breakTo "item_select_loop"; - }; - _chosen = _availableBackpacks deleteAt 0; - _amounts = _loadoutInfo get _chosen; - _name pushBackUnique ([_amounts select 2] call _getShortName); - }; - _amounts params ["_count", "_weight"]; - // always add at least one item - _currentWeight = _currentWeight + _weight; - _amounts set [0, _count - 1]; - _box addBackpackCargoGlobal [_chosen, 1]; - - if (_currentWeight >= _transportBoxWeight) exitWith { - breakTo "add_Backpack"; - }; - }; - // Since, if a bag still exists to add we exist here, we need to re-add it - _loadoutInfo set [_chosen, _amounts]; - _availableBackpacks pushBack _chosen; - }; - if (_currentWeight < _transportBoxWeight && _availableWeapons isNotEqualTo []) then { - scopeName "add_weapon"; - private _chosen = ""; - private _amounts = [0]; - for "_i" from 0 to WEAPONS_PER_BOX do { - // check if weapons of this type remain - if ((_amounts select 0) == 0) then { - _loadoutInfo deleteAt _chosen; - if (_availableWeapons isEqualTo []) exitWith { - breakTo "item_select_loop"; - }; - _chosen = _availableWeapons deleteAt 0; - _amounts = _loadoutInfo get _chosen; - _name pushBackUnique ([_amounts select 2] call _getShortName); - }; - _amounts params ["_count", "_weight"]; - // always add at least one item - _currentWeight = _currentWeight + _weight; - _amounts set [0, _count - 1]; - _box addWeaponCargoGlobal [_chosen, 1]; - - if (_currentWeight >= _transportBoxWeight) exitWith { - breakTo "add_weapon"; - }; - }; - // Since, if a bag still exists to add we exist here, we need to re-add it - _loadoutInfo set [_chosen, _amounts]; - _availableWeapons pushBack _chosen; - }; - if (_currentWeight < _transportBoxWeight && _availableMagazines isNotEqualTo []) then { - scopeName "add_magazine"; - private _chosen = ""; - private _amounts = [0]; - for "_i" from 0 to MAGAZINES_PER_BOX do { - // check if magazines of this type remain - if ((_amounts select 0) == 0) then { - _loadoutInfo deleteAt _chosen; - if (_availableMagazines isEqualTo []) exitWith { - breakTo "item_select_loop"; - }; - _chosen = _availableMagazines deleteAt 0; - _amounts = _loadoutInfo get _chosen; - _name pushBackUnique ([_amounts select 2] call _getShortName); - }; - _amounts params ["_count", "_weight"]; - private _toAdd = 1; - if (_weight == 0) then { - _toAdd = _count; - } else { - _toAdd = floor ((_transportBoxWeight - _currentWeight) / _weight); - }; - // always add at least one item - _toAdd = 1 max (_toAdd min _count); - - _currentWeight = _currentWeight + _weight * _toAdd; - _amounts set [0, _count - _toAdd]; - _box addMagazineCargoGlobal [_chosen, _toAdd]; - - if (_currentWeight >= _transportBoxWeight) exitWith { - breakTo "add_magazine"; - }; - }; - // Since, if a bag still exists to add we exist here, we need to re-add it - _loadoutInfo set [_chosen, _amounts]; - _availableMagazines pushBack _chosen; - }; - if (_currentWeight < _transportBoxWeight && _availableItems isNotEqualTo []) then { - scopeName "add_item"; - private _chosen = ""; - private _amounts = [0]; - for "_i" from 0 to MAGAZINES_PER_BOX do { - // check if items of this type remain - if ((_amounts select 0) == 0) then { - _loadoutInfo deleteAt _chosen; - if (_availableItems isEqualTo []) exitWith { - breakTo "item_select_loop"; - }; - _chosen = _availableItems deleteAt 0; - _amounts = _loadoutInfo get _chosen; - _name pushBackUnique ([_amounts select 2] call _getShortName); - }; - _amounts params ["_count", "_weight"]; - private _toAdd = 1; - if (_weight == 0) then { - _toAdd = _count; - } else { - _toAdd = floor ((_transportBoxWeight - _currentWeight) / _weight); - }; - // always add at least one item - _toAdd = 1 max (_toAdd min _count); - - _currentWeight = _currentWeight + _weight * _toAdd; - _amounts set [0, _count - _toAdd]; - _box addItemCargoGlobal [_chosen, _toAdd]; - - if (_currentWeight >= _transportBoxWeight) exitWith { - breakTo "add_item"; - }; - }; - // Since, if a bag still exists to add we exist here, we need to re-add it - _loadoutInfo set [_chosen, _amounts]; - _availableItems pushBack _chosen; - }; - - _box setVariable ["ace_cargo_customName", _name joinString ",", true]; - }; + case 2: { // ammo in boxes in vehicle + [_theVehicle, _path, _transportMagazines, _transportItems, _transportWeapons, _transportBackpacks] call FUNC(assignGearVehicle_asBoxes); }; case 3: { // ammo in boxes in vehicle from config private _boxes = "true" configClasses _path; @@ -358,9 +109,3 @@ switch (GVAR(setVehicleLoadouts)) do { }; }; - -//Add a Toolkit -if (GVAR(alwaysAddToolkits)) then { _theVehicle addItemCargoGlobal ["Toolkit", 1]; }; -if (GVAR(alwaysAddLandRopes) && {(_theVehicle isKindOf "Car") || {_theVehicle isKindOf "Tank"}}) then { - _theVehicle addItemCargoGlobal ["ACE_rope15", 1]; -}; diff --git a/addons/assignGear/functions/fnc_assignGearVehicle_asBoxes.sqf b/addons/assignGear/functions/fnc_assignGearVehicle_asBoxes.sqf new file mode 100644 index 00000000..5f16e01f --- /dev/null +++ b/addons/assignGear/functions/fnc_assignGearVehicle_asBoxes.sqf @@ -0,0 +1,214 @@ +#include "script_component.hpp" +/* + * Author: tcvm + * Applies a loadout to a vehicle as loaded ammo-boxes + * + * Arguments: + * 0: Vehicle + * 1: Default loadout type + * + * Return Value: + * Nothing + * + * Example: + * [cursorTarget] call potato_assignGear_fnc_assignGearVehicle_asBoxes; + * + * Public: No + */ + +params ["_theVehicle", "_loadoutPath", "_transportMagazines", "_transportItems", "_transportWeapons", "_transportBackpacks"]; + +#define BAGS_PER_BOX 10 +#define WEAPONS_PER_BOX 5 +#define MAGAZINES_PER_BOX 100 + +private _getMassLbs = { + params ["_config"]; + private _mass = getNumber (_config >> "mass"); + + if (_mass == 0 && {isClass (_config >> "itemInfo")}) then { + _mass = getNumber (_config >> "itemInfo" >> "mass"); + }; + + if (_mass == 0 && {isClass (_config >> "WeaponSlotsInfo")}) then { + _mass = getNumber (_config >> "WeaponSlotsInfo" >> "mass"); + }; + _mass / 10 +}; + +private _getShortName = { + params ["_displayName"]; + (_displayName splitString " ") params ["_f", "_s"]; + private _shortName = format ["%1 %2", _f, _s]; + if (isNil "_s") then { + _shortName = _f; + }; + _shortName +}; + +private _semiGreedyFill = { + params ["_currentWeight", "_maxWeight", "_available", "_loadoutInfo", "_max"]; + scopeName "greedy_pick"; + private _name = []; + private _pickedItems = []; + private _chosen = ""; + private _amounts = [0]; + for "_added" from 0 to _max do { + // check if item of this type remain + if ((_amounts select 0) == 0) then { + _loadoutInfo deleteAt _chosen; + if (_available isEqualTo []) exitWith { + _chosen = ""; + breakTo "greedy_pick"; + }; + _chosen = _available deleteAt 0; + _amounts = _loadoutInfo get _chosen; + _name pushBackUnique ([_amounts select 2] call _getShortName); + }; + + _amounts params ["_count", "_weight"]; + private _toAdd = 1; + if (_weight == 0) then { + _toAdd = _count; + } else { + _toAdd = floor ((_maxWeight - _currentWeight) / _weight); + }; + // always add at least one item, up to the specified bound + _toAdd = 1 max (_toAdd min _count min (_max - _added)); + _added = _added + _toAdd; + + _currentWeight = _currentWeight + _weight * _toAdd; + _amounts set [0, _count - _toAdd]; + _pickedItems pushBack [_chosen, _toAdd]; + + if (_currentWeight >= _maxWeight) exitWith { + breakTo "greedy_pick"; + }; + }; + if (_chosen isNotEqualTo "") then { + // Since, if an item still exists to add we exist here, we need to re-add it + _loadoutInfo set [_chosen, _amounts]; + _available pushBack _chosen; + }; + + [_name, _pickedItems, _currentWeight] +}; + +private _transportBoxClassname = getText (_loadoutPath >> "AmmoBox"); +if (_transportBoxClassname == "") then { + _transportBoxClassname = "Box_NATO_Ammo_F"; +}; +private _transportBoxWeight = getNumber (_loadoutPath >> "AmmoBoxCapacity"); +if (_transportBoxWeight == 0) then { + _transportBoxWeight = 75; +}; + +private _loadoutInfo = createHashMap; +private _availableMagazines = []; +private _availableItems = []; +private _availableWeapons = []; +private _availableBackpacks = []; +// transportMagazines +{ + (_x splitString ":") params ["_classname", ["_amount", "1", [""]]]; + _availableMagazines pushBackUnique _classname; + private _config = configFile >> "CfgMagazines" >> _classname; + (_loadoutInfo getOrDefault [_classname, [0, _config call _getMassLbs, getText (_config >> "displayName")]]) params ["_existingAmount", "_mass", "_name"]; + _loadoutInfo set [_classname, [_existingAmount + parseNumber _amount, _mass, _name]]; + nil +} count _transportMagazines; // count used here for speed, make sure nil is above this line + +// transportItems +{ + (_x splitString ":") params ["_classname", ["_amount", "1", [""]]]; + _availableItems pushBackUnique _classname; + private _config = configFile >> "CfgWeapons" >> _classname; + (_loadoutInfo getOrDefault [_classname, [0, _config call _getMassLbs, getText (_config >> "displayName")]]) params ["_existingAmount", "_mass", "_name"]; + _loadoutInfo set [_classname, [_existingAmount + parseNumber _amount, _mass, _name]]; + nil +} count _transportItems; // count used here for speed, make sure nil is above this line + +// transportWeapons +{ + (_x splitString ":") params ["_classname", ["_amount", "1", [""]]]; + private _disposableName = [cba_disposable_LoadedLaunchers, _classname, "get", ""] call FUNC(getDisposableInfo); + if (_disposableName != "") then { + TRACE_2("cba_disposable_LoadedLaunchers replace",_classname,_disposableName); + _classname = _disposableName; + }; + _availableWeapons pushBackUnique _classname; + private _config = configFile >> "CfgWeapons" >> _classname; + (_loadoutInfo getOrDefault [_classname, [0, _config call _getMassLbs, getText (_config >> "displayName")]]) params ["_existingAmount", "_mass", "_name"]; + _loadoutInfo set [_classname, [_existingAmount + parseNumber _amount, _mass, _name]]; + nil +} count _transportWeapons; // count used here for speed, make sure nil is above this line + +// transportBackpacks +{ + (_x splitString ":") params ["_classname", ["_amount", "1", [""]]]; + _availableBackpacks pushBackUnique _classname; + private _config = configFile >> "CfgBackpacks" >> _classname; + (_loadoutInfo getOrDefault [_classname, [0, _config call _getMassLbs, getText (_config >> "displayName")]]) params ["_existingAmount", "_mass", "_name"]; + _loadoutInfo set [_classname, [_existingAmount + parseNumber _amount, _mass, _name]]; + nil +} count _transportBackpacks; // count used here for speed, make sure nil is above this line + +while { + _availableBackpacks isNotEqualTo [] || + { _availableItems isNotEqualTo [] } || + { _availableWeapons isNotEqualTo [] } || + { _availableMagazines isNotEqualTo [] } +} do { + scopeName "item_select_loop"; + private _currentWeight = 0; + private _box = createVehicle [_transportBoxClassname, [0, 0, 0], [], 0, "NONE"]; + clearWeaponCargoGlobal _box; + clearMagazineCargoGlobal _box; + clearItemCargoGlobal _box; + clearBackpackCargoGlobal _box; + [_box, 0] call ACEFUNC(cargo,setSize); + [_box, _theVehicle, true] call ACEFUNC(cargo,loadItem); + [_box, true, [0, 1.5, 0], 0, true, true] call ACEFUNC(dragging,setDraggable); + [_box, true, [0, 1, 1], 0, true, true] call ACEFUNC(dragging,setCarryable); + + private _name = []; + if (_currentWeight < _transportBoxWeight && _availableBackpacks isNotEqualTo []) then { + private _fillInfo = [_currentWeight, _transportBoxWeight, _availableBackpacks, _loadoutInfo, BAGS_PER_BOX] call _semiGreedyFill; + _fillInfo params ["_newName", "_toAdd", "_newWeight"]; + _currentWeight = _newWeight; + _name = _name + _newName; + { + _box addBackpackCargoGlobal _x; + } forEach _toAdd; + }; + if (_currentWeight < _transportBoxWeight && _availableWeapons isNotEqualTo []) then { + private _fillInfo = [_currentWeight, _transportBoxWeight, _availableWeapons, _loadoutInfo, WEAPONS_PER_BOX] call _semiGreedyFill; + _fillInfo params ["_newName", "_toAdd", "_newWeight"]; + _currentWeight = _newWeight; + _name = _name + _newName; + { + _box addWeaponCargoGlobal _x; + } forEach _toAdd; + }; + if (_currentWeight < _transportBoxWeight && _availableMagazines isNotEqualTo []) then { + private _fillInfo = [_currentWeight, _transportBoxWeight, _availableMagazines, _loadoutInfo, MAGAZINES_PER_BOX] call _semiGreedyFill; + _fillInfo params ["_newName", "_toAdd", "_newWeight"]; + _currentWeight = _newWeight; + _name = _name + _newName; + { + _box addMagazineCargoGlobal _x; + } forEach _toAdd; + }; + if (_currentWeight < _transportBoxWeight && _availableItems isNotEqualTo []) then { + private _fillInfo = [_currentWeight, _transportBoxWeight, _availableItems, _loadoutInfo, MAGAZINES_PER_BOX] call _semiGreedyFill; + _fillInfo params ["_newName", "_toAdd", "_newWeight"]; + _currentWeight = _newWeight; + _name = _name + _newName; + { + _box addItemCargoGlobal _x; + } forEach _toAdd; + }; + + _box setVariable [QACEGVAR(cargo,customName), _name joinString ",", true]; +}; + diff --git a/addons/assignGear/functions/fnc_setBoxContentsFromConfig.sqf b/addons/assignGear/functions/fnc_setBoxContentsFromConfig.sqf index d02f336b..17a1f4b6 100644 --- a/addons/assignGear/functions/fnc_setBoxContentsFromConfig.sqf +++ b/addons/assignGear/functions/fnc_setBoxContentsFromConfig.sqf @@ -24,7 +24,6 @@ params ["_theBox", "_path", ["_nameFormatString", "%1", [""]]]; private _boxName = getText (_path >> "boxCustomName"); if (_boxName isNotEqualTo "") then { _theBox setVariable [QACEGVAR(cargo,customName), format [_nameFormatString, _boxName], true]; - _theBox setVariable [QACEGVAR(cargo,customName), format [_nameFormatString, _boxName], true]; }; private _overrideCarryWeight = 1 == (getNumber (_path >> "forceAllowCarry")); diff --git a/addons/cswCompat/patchGM/ACE_CSW_Groups.hpp b/addons/cswCompat/patchGM/ACE_CSW_Groups.hpp new file mode 100644 index 00000000..2408f9a4 --- /dev/null +++ b/addons/cswCompat/patchGM/ACE_CSW_Groups.hpp @@ -0,0 +1,26 @@ +class ACE_CSW_Groups { + //// MILAN + class gm_1Rnd_milan_heat_dm82_csw { + gm_1Rnd_milan_heat_dm82 = 1; + }; + class gm_1Rnd_milan_heat_dm92_csw { // Same name as the carryable magazine + gm_1Rnd_milan_heat_dm92 = 1; // Vehicle magazine that will be loaded when loading this magazine + }; + + //// Fagot + class gm_1Rnd_fagot_heat_9m111_csw { + gm_1Rnd_fagot_heat_9m111 = 1; + }; + + //// MG3 + class gm_120Rnd_762x51mm_b_t_DM21_mg3_grn { + gm_120Rnd_762x51mm_b_t_DM21_mg3_grn = 1; + }; + class gm_120Rnd_762x51mm_b_t_DM21A1_mg3_grn { + gm_120Rnd_762x51mm_b_t_DM21A1_mg3_grn = 1; + }; + class gm_120Rnd_762x51mm_b_t_DM21A2_mg3_grn { + gm_120Rnd_762x51mm_b_t_DM21A2_mg3_grn = 1; + }; + +}; diff --git a/addons/cswCompat/patchGM/CfgMagazines.hpp b/addons/cswCompat/patchGM/CfgMagazines.hpp new file mode 100644 index 00000000..af59a9a5 --- /dev/null +++ b/addons/cswCompat/patchGM/CfgMagazines.hpp @@ -0,0 +1,50 @@ +class CfgMagazines { + //// MILAN + class gm_1Rnd_milan_heat_dm82; + class gm_1Rnd_milan_heat_dm82_csw: gm_1Rnd_milan_heat_dm82 { + displayName = "[CSW] HEAT DM82 (MILAN 1)"; + scope = 2; + scopeArsenal = 2; + type = 256; + count = 1; + model = "\gm\gm_weapons\gm_launchers\gm_milan\gm_1rnd_milan_heat_dm92.p3d"; + ACE_isBelt = 0; + mass = 159; + }; + + class gm_1Rnd_milan_heat_dm92; + class gm_1Rnd_milan_heat_dm92_csw: gm_1Rnd_milan_heat_dm92 { + displayName = "[CSW] HEAT DM92 (MILAN 2)"; + scope = 2; + scopeArsenal = 2; + type = 256; + count = 1; + model = "\gm\gm_weapons\gm_launchers\gm_milan\gm_1rnd_milan_heat_dm92.p3d"; + ACE_isBelt = 0; + mass = 168; + }; + + //// Fagot + class gm_1Rnd_fagot_heat_9m111; + class gm_1Rnd_fagot_heat_9m111_csw: gm_1Rnd_fagot_heat_9m111 { + displayName = "[CSW] HEAT 9M111 (Fagot)"; + scope = 2; + scopeArsenal = 2; + type = 256; + picture = ACE_CSW_PATH(UI\StaticAT_Icon.paa); + ACE_isBelt = 0; + mass = 276; + }; + + //// MG3 + class gm_120rnd_762x51mm_mg3_grn; + class gm_120Rnd_762x51mm_b_t_DM21_mg3_grn: gm_120rnd_762x51mm_mg3_grn { + ACE_isBelt = 0; + }; + class gm_120Rnd_762x51mm_b_t_DM21A1_mg3_grn: gm_120rnd_762x51mm_mg3_grn { + ACE_isBelt = 0; + }; + class gm_120Rnd_762x51mm_b_t_DM21A2_mg3_grn: gm_120rnd_762x51mm_mg3_grn { + ACE_isBelt = 0; + }; +}; \ No newline at end of file diff --git a/addons/cswCompat/patchGM/CfgVehicles.hpp b/addons/cswCompat/patchGM/CfgVehicles.hpp new file mode 100644 index 00000000..91a1b52e --- /dev/null +++ b/addons/cswCompat/patchGM/CfgVehicles.hpp @@ -0,0 +1,264 @@ +class CfgVehicles { + class gm_staticATGM_base; + //// MILAN + class gm_milan_launcher_tripod_base: gm_staticATGM_base { + class ACE_Actions; + class Turrets; + }; + class gm_ge_army_milan_launcher_tripod_base: gm_milan_launcher_tripod_base { + class ACE_Actions: ACE_Actions { + class ACE_MainActions; + }; + class AnimationSources; + class Turrets: Turrets { + class MainTurret; + }; + }; + class gm_ge_army_milan_launcher_tripod: gm_ge_army_milan_launcher_tripod_base { + class ACE_Actions: ACE_Actions { + class ACE_MainActions: ACE_MainActions { + selection = "mainturret_elev"; + }; + }; + class AnimationSources: AnimationSources { + class MainTurret_realodMagazine_source; + class MainTurret_revolving_source; + }; + class assembleInfo; + class Turrets: Turrets { + class MainTurret: MainTurret { + class Components; + class GunClouds; + class GunFire; + class HitPoints; + class MGunClouds; + class Reflectors; + class TurnIn; + class TurnOut; + class Turrets; + class TurretSpec; + class ViewGunner; + class ViewOptics; + }; + }; + }; + class gm_ge_army_milan_launcher_tripod_csw: gm_ge_army_milan_launcher_tripod { + class ACE_Actions: ACE_Actions { + class ACE_MainActions: ACE_MainActions { + class ACE_csw_pickUp { + displayName = "Disassemble"; + condition = "call ace_csw_fnc_canPickupTripod"; + statement = "call ace_csw_fnc_assemble_pickupTripod"; + }; + }; + }; + class ACE_CSW { + enabled = 1; // Enables ACE CSW for this weaponmmo handling interaction point location (custom pos) + ammoLoadTime = 10 ; // How long it takes in + proxyWeapon = ""; // The proxy weapon created above. This can also be a function name that returns a proxy weapon - passed [_vehicle, _turret, _currentWeapon, _needed, _emptyWeapon] + disassembleWeapon = ""; // Carryable weapon created above + disassembleTurret = ""; // Which static tripod will appear when weapon is disassembled + disassembleTo = QGVAR(gm_milan_backpack); // Abuse the tripods + magazineLocation = "[0.204429,0.696469,-0.680236]"; // Aseconds to load ammo into the weapon + ammoUnloadTime = 10; // How long it takes in seconds to unload ammo from the weapon + desiredAmmo = 1; // When the weapon is reloaded it will try and reload to this ammo capacity + }; + class AnimationSources: AnimationSources { + class MainTurret_realodMagazine_source: MainTurret_realodMagazine_source { + source = "reloadmagazine"; + weapon = QGVAR(gm_milan_launcher_proxy); + }; + class MainTurret_revolving_source: MainTurret_revolving_source { + source = "revolving"; + weapon = QGVAR(gm_milan_launcher_proxy); + }; + }; + class assembleInfo: assembleInfo { + dissasembleTo[] = {}; + }; + class Turrets: Turrets { + class MainTurret: MainTurret { + class Components: Components; + class GunClouds: GunClouds; + class GunFire: GunFire; + class HitPoints: HitPoints; + class MGunClouds: MGunClouds; + class Reflectors: Reflectors; + class TurnIn: TurnIn; + class TurnOut: TurnOut; + class Turrets: Turrets; + class TurretSpec: TurretSpec; + class ViewGunner: ViewGunner; + class ViewOptics: ViewOptics; + weapons[] = {QGVAR(gm_milan_launcher_proxy)}; + magazines[] = {}; + }; + }; + displayName = "[CSW] MILAN"; + displayNameShort = "MILAN"; + }; + + //// Fagot + class gm_fagot_launcher_tripod_base: gm_staticATGM_base { + class ACE_Actions; + class Turrets; + }; + class gm_gc_army_fagot_launcher_tripod_base: gm_fagot_launcher_tripod_base { + class ACE_Actions: ACE_Actions { + class ACE_MainActions; + }; + class AnimationSources; + class Turrets: Turrets { + class MainTurret; + }; + }; + class gm_gc_army_fagot_launcher_tripod: gm_gc_army_fagot_launcher_tripod_base { + class ACE_Actions: ACE_Actions { + class ACE_MainActions: ACE_MainActions { + selection = "mainturret_elev"; + }; + }; + class AnimationSources: AnimationSources { + class MainTurret_realodMagazine_source; + class MainTurret_revolving_source; + }; + class assembleInfo; + class Turrets: Turrets { + class MainTurret: MainTurret { + class Components; + class GunClouds; + class GunFire; + class HitPoints; + class MGunClouds; + class Reflectors; + class TurnIn; + class TurnOut; + class Turrets; + class TurretSpec; + class ViewGunner; + class ViewOptics; + }; + }; + }; + class gm_gc_army_fagot_launcher_tripod_csw: gm_gc_army_fagot_launcher_tripod { + class ACE_Actions: ACE_Actions { + class ACE_MainActions: ACE_MainActions { + class ACE_csw_pickUp { + displayName = "Disassemble"; + condition = "call ace_csw_fnc_canPickupTripod"; + statement = "call ace_csw_fnc_assemble_pickupTripod"; + }; + }; + }; + class ACE_CSW { + enabled = 1; // Enables ACE CSW for this weaponmmo handling interaction point location (custom pos) + ammoLoadTime = 10 ; // How long it takes in + proxyWeapon = ""; // The proxy weapon created above. This can also be a function name that returns a proxy weapon - passed [_vehicle, _turret, _currentWeapon, _needed, _emptyWeapon] + disassembleWeapon = ""; // Carryable weapon created above + disassembleTurret = ""; // Which static tripod will appear when weapon is disassembled + disassembleTo = QGVAR(gm_fagot_backpack); // Abuse the tripods + magazineLocation = "[0,0.4,-0.7]"; // Aseconds to load ammo into the weapon + ammoUnloadTime = 10; // How long it takes in seconds to unload ammo from the weapon + desiredAmmo = 1; // When the weapon is reloaded it will try and reload to this ammo capacity + }; + class AnimationSources: AnimationSources { + class MainTurret_realodMagazine_source: MainTurret_realodMagazine_source { + source = "reloadmagazine"; + weapon = QGVAR(gm_fagot_launcher_proxy); + }; + class MainTurret_revolving_source: MainTurret_revolving_source { + source = "revolving"; + weapon = QGVAR(gm_fagot_launcher_proxy); + }; + }; + class assembleInfo: assembleInfo { + dissasembleTo[] = {}; + }; + class Turrets: Turrets { + class MainTurret: MainTurret { + class Components: Components; + class GunClouds: GunClouds; + class GunFire: GunFire; + class HitPoints: HitPoints; + class MGunClouds: MGunClouds; + class Reflectors: Reflectors; + class TurnIn: TurnIn; + class TurnOut: TurnOut; + class Turrets: Turrets; + class TurretSpec: TurretSpec; + class ViewGunner: ViewGunner; + class ViewOptics: ViewOptics; + weapons[] = {QGVAR(gm_fagot_launcher_proxy)}; + magazines[] = {}; + }; + }; + displayName = "[CSW] Fagot"; + displayNameShort = "Fagot"; + }; + + //// MG3 AA + // MG3 Tripod + class StaticWeapon; + class gm_staticWeapon_base: StaticWeapon { + class ACE_Actions; + }; + class gm_staticMG_base: gm_staticWeapon_base { + class ACE_Actions: ACE_Actions { + class ACE_MainActions; + }; + }; + class gm_mg3_aatripod_base: gm_staticMG_base { + class ACE_Actions: ACE_Actions { + class ACE_MainActions: ACE_MainActions { + selection = "machinegunturret_01_elev"; + }; + }; + }; + class gm_ge_army_mg3_aatripod_base: gm_mg3_aatripod_base { + class ACE_Actions: ACE_Actions; + }; + class gm_ge_army_mg3_aatripod: gm_ge_army_mg3_aatripod_base { + class ACE_Actions: ACE_Actions; + }; + class gm_ge_army_mg3_aatripod_csw: gm_ge_army_mg3_aatripod { + class ACE_Actions: ACE_Actions; + class ACE_CSW { + enabled = 1; // Enables ACE CSW for this weaponmmo handling interaction point location (custom pos) + ammoLoadTime = 0.1 ; // How long it takes in + proxyWeapon = ""; // The proxy weapon created above. This can also be a function name that returns a proxy weapon - passed [_vehicle, _turret, _currentWeapon, _needed, _emptyWeapon] + disassembleWeapon = "gm_mg3_blk"; // Carryable weapon created above + disassembleTurret = QGVAR(gm_MG3Tripod); // Which static tripod will appear when weapon is disassembled + magazineLocation = "_target selectionPosition 'machinegunturret_01_magazine'"; // Aseconds to load ammo into the weapon + ammoUnloadTime = 5; // How long it takes in seconds to unload ammo from the weapon + desiredAmmo = 120; // When the weapon is reloaded it will try and reload to this ammo capacity + }; + displayName = "[CSW] MG3 - Anti Air Tripod"; + }; + + // MG3 Tripod + class ThingX; + class ace_csw_baseTripod: ThingX { + class ACE_Actions; + }; + class ace_csw_m3Tripod: ace_csw_baseTripod { + class ACE_Actions: ACE_Actions { + class ACE_MainActions; + }; + }; + class GVAR(gm_MG3Tripod): ace_csw_m3Tripod { + class ACE_Actions: ACE_Actions { + class ACE_MainActions: ACE_MainActions { + selection = "machinegunturret_01_mounthide"; + }; + }; + class ACE_CSW { + disassembleTo = QGVAR(gm_MG3TripodCarry); + }; + displayName = "[CSW] MG3 AA Tripod (GM)"; + editorPreview = "gm\gm_weapons\gm_machineguns\gm_mg3\data\ui\preview_gm_mg3_aatripod_base.jpg"; + icon = "\gm\gm_weapons\gm_machineguns\gm_mg3\data\ui\map_gm_mg3_aatripod_ca"; + model = "\gm\gm_weapons\gm_machineguns\gm_mg3\gm_mg3_aatripod"; + picture = "\gm\gm_weapons\gm_machineguns\gm_mg3\data\ui\picture_gm_mg3_aatripod_ca"; + }; +}; +// spg9 model location selectionName: "mainturret_rear" diff --git a/addons/cswCompat/patchGM/CfgWeapons.hpp b/addons/cswCompat/patchGM/CfgWeapons.hpp new file mode 100644 index 00000000..483eb431 --- /dev/null +++ b/addons/cswCompat/patchGM/CfgWeapons.hpp @@ -0,0 +1,98 @@ +class CfgWeapons { + + //// Carryable weapons + class Launcher; + class Launcher_Base_F: Launcher { + class WeaponSlotsInfo; + }; + + /// Milan + class GVAR(gm_milan_backpack): Launcher_Base_F { + class ACE_CSW { + type = "mount"; + deployTime = 4; + pickupTime = 4; + deploy = "gm_ge_army_milan_launcher_tripod_csw"; + }; + class WeaponSlotsInfo: WeaponSlotsInfo { + class MuzzleSlot { + iconScale = 0.1; + }; + mass = 362; // 16.4 kg + }; + displayName = "[CSW] MILAN (GM)"; + author = "Lambda.Tiger"; + scope = 2; + scopeArsenal = 2; + model = ACE_APL_PATH(ACE_CSW_Bag.p3d); + modes[] = {}; + picture = "\gm\gm_weapons\gm_launchers\gm_milan\data\ui\picture_gm_milan_launcher_weaponBag_ca"; + }; + + /// Fagot + class GVAR(gm_fagot_backpack): Launcher_Base_F { + class ACE_CSW { + type = "mount"; + deployTime = 4; + pickupTime = 4; + deploy = "gm_gc_army_fagot_launcher_tripod_csw"; + }; + class WeaponSlotsInfo: WeaponSlotsInfo { + class MuzzleSlot { + iconScale = 0.1; + }; + mass = 496; // 22.5 kg + }; + displayName = "[CSW] Fagot (GM)"; + author = "Lambda.Tiger"; + scope = 2; + scopeArsenal = 2; + model = ACE_APL_PATH(ACE_CSW_Bag.p3d); + modes[] = {}; + picture = "\gm\gm_weapons\gm_launchers\gm_fagot\data\ui\picture_gm_fagot_launcher_weaponBag_ca"; + }; + + /// MG3 + // Weapon + class gm_mg3_base; + class gm_mg3_blk: gm_mg3_base { + class ACE_CSW { + type = "weapon"; + deployTime = 4; + pickupTime = 4; + class assembleTo { + GVAR(gm_MG3Tripod) = "gm_ge_army_mg3_aatripod_csw"; + }; + }; + }; + + // Tripod + class ace_csw_m3CarryTripod: Launcher_Base_F { + class WeaponSlotsInfo: WeaponSlotsInfo; + }; + class GVAR(gm_MG3TripodCarry): ace_csw_m3CarryTripod { + class ACE_CSW { + type = "mount"; + deployTime = 4; + pickupTime = 4; + deploy = QGVAR(gm_MG3Tripod); + }; + class WeaponSlotsInfo: WeaponSlotsInfo { + mass = 256; // fun number + }; + displayName = "[CSW] MG3 AA Tripod"; + icon = "\gm\gm_weapons\gm_machineguns\gm_mg3\data\ui\map_gm_mg3_aatripod_ca"; + picture = "\gm\gm_weapons\gm_machineguns\gm_mg3\data\ui\picture_gm_mg3_aatripod_weaponBag_ca"; + }; + + //// Proxy Weapons + class gm_milan_launcher; + class GVAR(gm_milan_launcher_proxy): gm_milan_launcher { + magazineReloadTime = 0.5; + }; + + class gm_fagot_launcher; + class GVAR(gm_fagot_launcher_proxy): gm_fagot_launcher { + magazineReloadTime = 0.5; + }; +}; diff --git a/addons/cswCompat/patchGM/config.cpp b/addons/cswCompat/patchGM/config.cpp new file mode 100644 index 00000000..cd96916d --- /dev/null +++ b/addons/cswCompat/patchGM/config.cpp @@ -0,0 +1,41 @@ +// "\gm\gm_weapons\gm_launchers\gm_milan\gm_milan_heat_dm92.p3d" +// "\gm\gm_weapons\gm_launchers\gm_fagot\gm_fagot_heat_9m111.p3d" +#include "\z\potato\addons\cswCompatCUP\script_component.hpp" +#undef COMPONENT +#define COMPONENT cswCompatCUP_patchGM + +class CfgPatches { + class ADDON { + units[] = { + "gm_ge_army_milan_launcher_tripod_csw", + "gm_gc_army_fagot_launcher_tripod_csw", + "gm_ge_army_mg3_aatripod_csw", + QGVAR(gm_MG3Tripod) + }; + weapons[] = { + QGVAR(gm_milan_backpack), + QGVAR(gm_fagot_backpack), + QGVAR(gm_MG3TripodCarry), + QGVAR(gm_milan_launcher_proxy), + QGVAR(gm_fagot_launcher_proxy) + }; + requiredVersion = REQUIRED_VERSION; + requiredAddons[] = { + "potato_cswCompatCUP", + "gm_weapons_ammo", + "gm_weapons_launchers_milan", + "gm_weapons_launchers_fagot", + "gm_weapons_machineguns_mg3_gm_ge_army_mg3", + "gm_weapons_launchers_fagot_gm_gc_army_fagot" + }; + skipWhenMissingDependencies = 1; + author = "Bourbon Warfare"; + authorUrl = "https://github.com/BourbonWarfare/POTATO"; + VERSION_CONFIG; + }; +}; + +#include "ACE_CSW_Groups.hpp" +#include "CfgMagazines.hpp" +#include "CfgWeapons.hpp" +#include "CfgVehicles.hpp" diff --git a/addons/miscFixes/XEH_preInit.sqf b/addons/miscFixes/XEH_preInit.sqf index d39f2b7d..0e8644d6 100644 --- a/addons/miscFixes/XEH_preInit.sqf +++ b/addons/miscFixes/XEH_preInit.sqf @@ -22,3 +22,46 @@ if (["WBK_ZombieCreatures"] call ACEFUNC(common,isModLoaded)) then { }] call CBA_fnc_addClassEventHandler; } forEach _wbkZombiesBase; }; + +//add EH to fix weapon lowering while walking fix +addUserActionEventHandler ["toggleRaiseWeapon","Activate",{ + private _lAnim = animationState ace_player; + if ("stp" in _lAnim || "non" in _lAnim) exitWith {}; + _lAnim = _lAnim splitString ""; + private _state = [_lAnim #13,_lAnim #14,_lAnim #15] joinString ""; + switch(_state)do{ + case "ras": { + _lAnim set [13,"l"]; + _lAnim set [14,"o"]; + _lAnim set [15,"w"]; + }; + case "low": { + _lAnim set [13,"r"]; + _lAnim set [14,"a"]; + _lAnim set [15,"s"]; + }; + }; + private _nAnim = _lAnim joinString ""; + [{ + params ["_nAnim"]; + if (!alive ace_player) exitWith {}; + private _f = inputAction "MoveForward"; + private _b = inputAction "MoveBack"; + private _l = inputAction "TurnLeft"; + private _r = inputAction "TurnRight"; + private _tot = _f + _b + _l + _r; + if (_tot == 0) then { + private _tAnim = _nAnim splitString "_"; + _nAnim = _tAnim #0 splitString ""; + _nAnim set [9,"s"]; + _nAnim set [10,"t"]; + _nAnim set [11,"p"]; + _nAnim set [21,"n"]; + _nAnim set [22,"o"]; + _nAnim set [23,"n"]; + _nAnim = _nAnim joinString ""; + INFO_2("weapon lowering stopping %1->%2",animationState ace_player,_nAnim); // temp debug logging for problems + [ace_player, _nAnim, 1] call ace_common_fnc_doAnimation; + }; + }, [_nAnim], 0.5] call CBA_fnc_waitAndExecute; +}]; diff --git a/addons/missileGuidanceCompat/CfgAmmo.hpp b/addons/missileGuidanceCompat/CfgAmmo.hpp index b25b7413..a9c5d89d 100644 --- a/addons/missileGuidanceCompat/CfgAmmo.hpp +++ b/addons/missileGuidanceCompat/CfgAmmo.hpp @@ -1,482 +1,6 @@ class CfgAmmo { - class M_Titan_AA; - class MissileBase; - class M_Titan_AT; - class Bo_GBU12_LGB; - class ShellBase; class ace_dragon_serviceCharge: ShellBase { - soundSetExplosion[] = {}; - }; - - class CUP_M_9K32_Strela_2_AA: M_Titan_AA { - maneuvrability = 0; - #include "CfgMissileStrela.hpp" - }; - - class CUP_M_9K38_Igla_AA: M_Titan_AA { - maneuvrability = 0; - #include "CfgMissileIgla.hpp" - }; - - class CUP_M_9M17P_AT2_Falanga_AT: MissileBase { - maneuvrability = 0; - #include "CfgMissileFalanga.hpp" - }; - - class CUP_M_9M17P_AT3_Sagger_AT: MissileBase { - maneuvrability = 0; - #include "CfgMissileFleyta.hpp" - }; - - class CUP_M_9M113_AT5_Spandrel_AT: M_Titan_AT { - maneuvrability = 0; - #include "CfgMissileKonkurs.hpp" - }; - - class CUP_M_Shturm_9M114_AT6_Spiral_AT: MissileBase { - maneuvrability = 0; - #include "CfgMissileShturm.hpp" - }; - - class CUP_M_Ataka_V_9M120_AT9_Spiral_2_AT: MissileBase { - maneuvrability = 0; - #include "CfgMissileAtaka.hpp" - }; - - class CUP_M_9K116_1_Bastion_AT10_Stabber_AT: MissileBase { - maneuvrability = 0; - #include "CfgMissileBastion.hpp" - }; - - class CUP_M_9M119M_Refleks_AT11_Sniper_AT: MissileBase { - maneuvrability = 0; - #include "CfgMissileRefleks.hpp" - }; - - class CUP_M_9K115_2_AT13_Saxhorn_2_AT: MissileBase { - maneuvrability = 0; - #include "CfgMissileMetis.hpp" - }; - - class CUP_M_9M133_1_AT14_Spriggan_AT: MissileBase { - maneuvrability = 0; - #include "CfgMissileKornet.hpp" - }; - - class CUP_M_9M133_1_AT14_Spriggan_HE: CUP_M_9M133_1_AT14_Spriggan_AT { - maneuvrability = 0; - #include "CfgMissileKornet.hpp" - }; - - class CUP_M_9K121_Vikhr_AT16_Scallion_AT: MissileBase { - maneuvrability = 0; - #include "CfgMissileVikhr.hpp" - }; - - class CUP_M_KH29L_AT: MissileBase { - maneuvrability = 0; - #include "CfgMissileKH29.hpp" - }; - - class CUP_M_AGM_114K_Hellfire_II_AT: MissileBase { - maneuvrability = 0; - class ace_missileguidance { - enabled = 1; - - pitchRate = 30; // degrees per second - yawRate = 30; - - canVanillaLock = 0; // Can this default vanilla lock? Only applicable to non-cadet mode - - // Guidance type for munitions - defaultSeekerType = "SALH"; - seekerTypes[] = { "SALH" }; - - defaultSeekerLockMode = "LOAL"; - seekerLockModes[] = { "LOAL", "LOBL" }; - - defaultNavigationType = "Direct"; - navigationTypes[] = { "Direct", "ZeroEffortMiss" }; - - seekLastTargetPos = 1; // seek last target position [if seeker loses LOS of target, continue to last known pos] - seekerAngle = 70; // Angle in front of the missile which can be searched - seekerAccuracy = 1; // seeker accuracy multiplier - - seekerMinRange = 1; - seekerMaxRange = 8000; // Range from the missile which the seeker can visually search - - // Attack profile type selection - defaultAttackProfile = "hellfire"; - attackProfiles[] = {"hellfire", "hellfire_hi", "hellfire_lo"}; - - class navigationStates { - class initial { - transitionCondition = "ace_hellfire_fnc_midCourseTransition"; - navigationType = "Direct"; - }; - class terminal { - transitionCondition = ""; - navigationType = "ZeroEffortMiss"; - }; - // transitions from initial -> termimal - states[] = {"initial", "terminal"}; - }; - }; - }; - - class CUP_M_AGM_114L_Hellfire_II_AT: MissileBase { - class ace_missileguidance { - enabled = 1; - - pitchRate = 30; // degrees per second - yawRate = 30; - - canVanillaLock = 1; // Can this default vanilla lock? Only applicable to non-cadet mode - - // Guidance type for munitions - defaultSeekerType = "MillimeterWaveRadar"; - seekerTypes[] = { "MillimeterWaveRadar" }; - - defaultSeekerLockMode = "LOBL"; - seekerLockModes[] = { "LOBL" }; - - defaultNavigationType = "Direct"; - navigationTypes[] = { "Direct", "ZeroEffortMiss" }; - - seekLastTargetPos = 0; // seek last target position [if seeker loses LOS of target, continue to last known pos] - seekerAngle = 70; // Angle in front of the missile which can be searched - seekerAccuracy = 1; // seeker accuracy multiplier - - seekerMinRange = 1; - activeRadarEngageDistance = 1000; - seekerMaxRange = 2000; // distance that the hellfire internal radar can scan - - // Attack profile type selection - defaultAttackProfile = "hellfire"; - attackProfiles[] = {"hellfire", "hellfire_hi", "hellfire_lo"}; - - class navigationStates { - class initial { - transitionCondition = "ace_hellfire_fnc_midCourseTransition"; - navigationType = "Direct"; - }; - class terminal { - transitionCondition = ""; - navigationType = "ZeroEffortMiss"; - }; - // transitions from initial -> termimal - states[] = {"initial", "terminal"}; - }; - }; - }; - - class CUP_M_AIM_9L_Sidewinder_AA: MissileBase { - maneuvrability = 0; - - class ace_missileguidance { - enabled = 1; - - pitchRate = 25; // Minium flap deflection for guidance - yawRate = 25; // Maximum flap deflection for guidance - - canVanillaLock = 1; // Can this default vanilla lock? Only applicable to non-cadet mode - - // Guidance type for munitions - defaultSeekerType = "IR"; - seekerTypes[] = { "IR" }; - - flareDistanceFilter = 100; - flareAngleFilter = 1.6; // can filter out flares that are >= flareAngleFilter to known target velocity - - defaultSeekerLockMode = "LOBL"; - seekerLockModes[] = { "LOBL" }; - - defaultNavigationType = "AugmentedProportionalNavigation"; - navigationTypes[] = { "AugmentedProportionalNavigation" }; - - seekLastTargetPos = 0; // seek last target position [if seeker loses LOS of target, continue to last known pos] - seekerAngle = 45; // Angle from the shooter's view that can track the missile - seekerAccuracy = 0.8; // seeker accuracy multiplier - - seekerMinRange = 75; - seekerMaxRange = 5000; // Range from the missile which the seeker can visually search - - // Attack profile type selection - defaultAttackProfile = "DIR"; - attackProfiles[] = {"DIR"}; - }; - }; - - class CUP_M_Stinger_AA: MissileBase { - maneuvrability = 0; - - class ace_missileguidance { - enabled = 1; - - pitchRate = 42; // Minium flap deflection for guidance - yawRate = 42; // Maximum flap deflection for guidance - - canVanillaLock = 1; // Can this default vanilla lock? Only applicable to non-cadet mode - - // Guidance type for munitions - defaultSeekerType = "IR"; - seekerTypes[] = { "IR" }; - - flareDistanceFilter = 100; - flareAngleFilter = 1.3; // can filter out flares that are >= flareAngleFilter to known target velocity - - defaultSeekerLockMode = "LOBL"; - seekerLockModes[] = { "LOBL" }; - - defaultNavigationType = "AugmentedProportionalNavigation"; - navigationTypes[] = { "AugmentedProportionalNavigation" }; - - seekLastTargetPos = 0; // seek last target position [if seeker loses LOS of target, continue to last known pos] - seekerAngle = 45; // Angle from the shooter's view that can track the missile - seekerAccuracy = 0.8; // seeker accuracy multiplier - - seekerMinRange = 75; - seekerMaxRange = 5000; // Range from the missile which the seeker can visually search - - // Attack profile type selection - defaultAttackProfile = "DIR"; - attackProfiles[] = {"DIR"}; - }; - }; - - class CUP_M_RBS70_AA: MissileBase { - maneuvrability = 0; - - class ace_missileguidance { - enabled = 1; - - pitchRate = 45; // Minium flap deflection for guidance - yawRate = 45; // Maximum flap deflection for guidance - - canVanillaLock = 0; // Can this default vanilla lock? Only applicable to non-cadet mode - - showTrail = 1; - - // Guidance type for munitions - defaultSeekerType = "SACLOS"; - seekerTypes[] = { "SACLOS" }; - - defaultSeekerLockMode = "LOAL"; - seekerLockModes[] = { "LOAL", "LOBL" }; - - defaultNavigationType = "Line"; - navigationTypes[] = { "Line" }; - - lineGainP = 20; - lineGainD = 16; - - initialPitch = 2; - - seekLastTargetPos = 0; // seek last target position [if seeker loses LOS of target, continue to last known pos] - seekerAngle = 30; // Angle from the shooter's view that can track the missile - seekerAccuracy = 1; // seeker accuracy multiplier - - seekerMinRange = 75; - seekerMaxRange = 5000; // Range from the missile which the seeker can visually search - - correctionDistance = 30; // distance from center of crosshair where missile slows down - offsetFromCrosshair[] = { 0, 0, 0 }; // where the missile wants to stay in relation to the center of the crosshair. - - // Attack profile type selection - defaultAttackProfile = "BEAM"; - attackProfiles[] = {"BEAM"}; - }; - }; - - class CUP_AGM65pod_AT: MissileBase { - maneuvrability = 0; - class ace_missileguidance { - enabled = 1; - - pitchRate = 15; - yawRate = 15; - - canVanillaLock = 1; - - defaultSeekerType = "Optic"; - seekerTypes[] = {"Optic"}; - - defaultSeekerLockMode = "LOBL"; - seekerLockModes[] = {"LOBL"}; - - defaultNavigationType = "AugmentedProportionalNavigation"; - navigationTypes[] = { "AugmentedProportionalNavigation" }; - - seekLastTargetPos = 1; - seekerAngle = 60; - seekerAccuracy = 1; - - seekerMinRange = 1; - seekerMaxRange = 14000; - - defaultAttackProfile = "maverick"; - attackProfiles[] = {"maverick"}; - }; - }; - - class CUP_R_TOW_AT: M_Titan_AT { - maneuvrability = 0; - class ace_missileguidance { - enabled = 1; - - pitchRate = 45; // Minium flap deflection for guidance - yawRate = 45; // Maximum flap deflection for guidance - - canVanillaLock = 0; // Can this default vanilla lock? Only applicable to non-cadet mode - - showTrail = 1; - - // Guidance type for munitions - defaultSeekerType = "SACLOS"; - seekerTypes[] = { "SACLOS" }; - - defaultSeekerLockMode = "LOAL"; - seekerLockModes[] = { "LOAL", "LOBL" }; - - defaultNavigationType = "Line"; - navigationTypes[] = { "Line" }; - - lineGainP = 20; - lineGainD = 7; - - initialPitch = 2; - - seekLastTargetPos = 0; // seek last target position [if seeker loses LOS of target, continue to last known pos] - seekerAngle = 30; // Angle from the shooter's view that can track the missile - seekerAccuracy = 1; // seeker accuracy multiplier - - seekerMinRange = 65; - seekerMaxRange = 3750; // Range from the missile which the seeker can visually search - - correctionDistance = 30; // distance from center of crosshair where missile slows down - offsetFromCrosshair[] = { 0, 0, 0 }; // where the missile wants to stay in relation to the center of the crosshair. - - // Attack profile type selection - defaultAttackProfile = "WIRE"; - attackProfiles[] = {"WIRE"}; - }; - }; - - class CUP_R_TOW2_AT: CUP_R_TOW_AT { - maneuvrability = 0; - class ace_missileguidance: ace_missileguidance { - enabled = 1; - }; - }; - - class CUP_Bo_GBU12_LGB: Bo_GBU12_LGB { - maneuvrability = 0; // no maneuvrability so that default guidance doesnt work - class ace_missileguidance { - enabled = 1; - - pitchRate = 5; - yawRate = 5; - - bangBangGuidance = 1; - stabilityCoefficient = 0.4; // how much this projectile likes to "weathervane" (keep direction toward velocity) - - canVanillaLock = 0; // Can this default vanilla lock? Only applicable to non-cadet mode - - // Guidance type for munitions - defaultSeekerType = "SALH"; - seekerTypes[] = { "SALH" }; - - defaultSeekerLockMode = "LOAL"; - seekerLockModes[] = { "LOAL" }; - - defaultNavigationType = "ProportionalNavigation"; - navigationTypes[] = { "ProportionalNavigation" }; - - seekLastTargetPos = 0; // seek last target position [if seeker loses LOS of target, continue to last known pos] - seekerAngle = 60; // Angle from the shooter's view that can track the missile - seekerAccuracy = 1; // seeker accuracy multiplier - - seekerMinRange = 5; - seekerMaxRange = 4000; // Range from the missile which the seeker can visually search - - // Attack profile type selection - defaultAttackProfile = "DIR"; - attackProfiles[] = {"DIR"}; - }; - }; - - class CUP_Bo_KAB250_LGB: Bo_GBU12_LGB { - maneuvrability = 0; // no maneuvrability so that default guidance doesnt work - class ace_missileguidance { - enabled = 1; - - pitchRate = 8; - yawRate = 8; - - bangBangGuidance = 1; - stabilityCoefficient = 0.4; // how much this projectile likes to "weathervane" (keep direction toward velocity) - - canVanillaLock = 0; // Can this default vanilla lock? Only applicable to non-cadet mode - - // Guidance type for munitions - defaultSeekerType = "SALH"; - seekerTypes[] = { "SALH" }; - - defaultSeekerLockMode = "LOAL"; - seekerLockModes[] = { "LOAL" }; - - defaultNavigationType = "ProportionalNavigation"; - navigationTypes[] = { "ProportionalNavigation" }; - - seekLastTargetPos = 0; // seek last target position [if seeker loses LOS of target, continue to last known pos] - seekerAngle = 60; // Angle from the shooter's view that can track the missile - seekerAccuracy = 1; // seeker accuracy multiplier - - seekerMinRange = 5; - seekerMaxRange = 4000; // Range from the missile which the seeker can visually search - - // Attack profile type selection - defaultAttackProfile = "DIR"; - attackProfiles[] = {"DIR"}; - }; - }; - - class GVAR(redeye): CUP_M_Stinger_AA { - maneuvrability = 0; - - class ace_missileguidance { - enabled = 1; - - pitchRate = 27; // Minium flap deflection for guidance - yawRate = 27; // Maximum flap deflection for guidance - - canVanillaLock = 1; // Can this default vanilla lock? Only applicable to non-cadet mode - - // Guidance type for munitions - defaultSeekerType = "IR"; - seekerTypes[] = { "IR" }; - - flareDistanceFilter = 100; - flareAngleFilter = 2.0; // can filter out flares that are >= flareAngleFilter to known target velocity - - defaultSeekerLockMode = "LOBL"; - seekerLockModes[] = { "LOBL" }; - - defaultNavigationType = "ProportionalNavigation"; - navigationTypes[] = { "ProportionalNavigation" }; - - seekLastTargetPos = 0; // seek last target position [if seeker loses LOS of target, continue to last known pos] - seekerAngle = 45; // Angle from the shooter's view that can track the missile - seekerAccuracy = 0.4; // seeker accuracy multiplier - - seekerMinRange = 75; - seekerMaxRange = 4500; // Range from the missile which the seeker can visually search - - // Attack profile type selection - defaultAttackProfile = "DIR"; - attackProfiles[] = {"DIR"}; - }; + soundSetExplosion[] = {}; // for JSRS }; }; - diff --git a/addons/missileGuidanceCompat/CfgMagazines.hpp b/addons/missileGuidanceCompat/CfgMagazines.hpp deleted file mode 100644 index 7fb9c15c..00000000 --- a/addons/missileGuidanceCompat/CfgMagazines.hpp +++ /dev/null @@ -1,7 +0,0 @@ -class CfgMagazines { - class CA_LauncherMagazine; - class CUP_Dragon_EP1_M: CA_LauncherMagazine { - ammo = "ace_dragon_super"; - initSpeed = 120; - }; -}; diff --git a/addons/missileGuidanceCompat/CfgMissileAtaka.hpp b/addons/missileGuidanceCompat/CfgMissileAtaka.hpp deleted file mode 100644 index 9bd47f51..00000000 --- a/addons/missileGuidanceCompat/CfgMissileAtaka.hpp +++ /dev/null @@ -1,38 +0,0 @@ -class ace_missileguidance { - enabled = 1; - - pitchRate = 45; // Minium flap deflection for guidance - yawRate = 45; // Maximum flap deflection for guidance - - canVanillaLock = 0; // Can this default vanilla lock? Only applicable to non-cadet mode - - showTrail = 1; - - // Guidance type for munitions - defaultSeekerType = "SACLOS"; - seekerTypes[] = { "SACLOS" }; - - defaultSeekerLockMode = "LOAL"; - seekerLockModes[] = { "LOAL", "LOBL" }; - - defaultNavigationType = "Line"; - navigationTypes[] = { "Line" }; - - lineGainP = 16; - lineGainD = 10.44; - - initialPitch = 2; - - seekLastTargetPos = 0; // seek last target position [if seeker loses LOS of target, continue to last known pos] - seekerAngle = 30; // Angle from the shooter's view that can track the missile - seekerAccuracy = 1; // seeker accuracy multiplier - - seekerMinRange = 75; - seekerMaxRange = 6000; // Range from the missile which the seeker can visually search - - offsetFromCrosshair[] = { 0, 0, 0 }; // where the missile wants to stay in relation to the center of the crosshair. - - // Attack profile type selection - defaultAttackProfile = "BEAM"; - attackProfiles[] = {"BEAM"}; -}; \ No newline at end of file diff --git a/addons/missileGuidanceCompat/CfgMissileBastion.hpp b/addons/missileGuidanceCompat/CfgMissileBastion.hpp deleted file mode 100644 index 9f0766fe..00000000 --- a/addons/missileGuidanceCompat/CfgMissileBastion.hpp +++ /dev/null @@ -1,39 +0,0 @@ -class ace_missileguidance { - enabled = 1; - - pitchRate = 45; // Minium flap deflection for guidance - yawRate = 45; // Maximum flap deflection for guidance - - canVanillaLock = 0; // Can this default vanilla lock? Only applicable to non-cadet mode - - showTrail = 1; - - // Guidance type for munitions - defaultSeekerType = "SACLOS"; - seekerTypes[] = { "SACLOS" }; - - defaultSeekerLockMode = "LOAL"; - seekerLockModes[] = { "LOAL", "LOBL" }; - - defaultNavigationType = "Line"; - navigationTypes[] = { "Line" }; - - lineGainP = 16; - lineGainD = 10.44; - - initialPitch = 2; - - seekLastTargetPos = 0; // seek last target position [if seeker loses LOS of target, continue to last known pos] - seekerAngle = 30; // Angle from the shooter's view that can track the missile - seekerAccuracy = 1; // seeker accuracy multiplier - - seekerMinRange = 75; - seekerMaxRange = 4000; // Range from the missile which the seeker can visually search - - correctionDistance = 30; // distance from center of crosshair where missile slows down - offsetFromCrosshair[] = { 0, 0, 0 }; // where the missile wants to stay in relation to the center of the crosshair. - - // Attack profile type selection - defaultAttackProfile = "BEAM"; - attackProfiles[] = {"BEAM"}; -}; \ No newline at end of file diff --git a/addons/missileGuidanceCompat/CfgMissileDrakon.hpp b/addons/missileGuidanceCompat/CfgMissileDrakon.hpp deleted file mode 100644 index 6b20c35b..00000000 --- a/addons/missileGuidanceCompat/CfgMissileDrakon.hpp +++ /dev/null @@ -1,39 +0,0 @@ -class ace_missileguidance { - enabled = 1; - - pitchRate = 25; // Minium flap deflection for guidance - yawRate = 25; // Maximum flap deflection for guidance - - canVanillaLock = 0; // Can this default vanilla lock? Only applicable to non-cadet mode - - showTrail = 1; - - // Guidance type for munitions - defaultSeekerType = "SACLOS"; - seekerTypes[] = { "SACLOS" }; - - defaultSeekerLockMode = "LOAL"; - seekerLockModes[] = { "LOAL", "LOBL" }; - - defaultNavigationType = "Line"; - navigationTypes[] = { "Line" }; - - lineGainP = 16; - lineGainD = 9.5; - - initialPitch = 2; - - seekLastTargetPos = 0; // seek last target position [if seeker loses LOS of target, continue to last known pos] - seekerAngle = 30; // Angle from the shooter's view that can track the missile - seekerAccuracy = 1; // seeker accuracy multiplier - - seekerMinRange = 75; - seekerMaxRange = 3300; // Range from the missile which the seeker can visually search - - correctionDistance = 30; // distance from center of crosshair where missile slows down - offsetFromCrosshair[] = { 0, 0, 0 }; // where the missile wants to stay in relation to the center of the crosshair. - - // Attack profile type selection - defaultAttackProfile = "BEAM"; - attackProfiles[] = {"BEAM"}; -}; \ No newline at end of file diff --git a/addons/missileGuidanceCompat/CfgMissileFagot.hpp b/addons/missileGuidanceCompat/CfgMissileFagot.hpp deleted file mode 100644 index 6402aac1..00000000 --- a/addons/missileGuidanceCompat/CfgMissileFagot.hpp +++ /dev/null @@ -1,39 +0,0 @@ -class ace_missileguidance { - enabled = 1; - - pitchRate = 45; // Minium flap deflection for guidance - yawRate = 45; // Maximum flap deflection for guidance - - canVanillaLock = 0; // Can this default vanilla lock? Only applicable to non-cadet mode - - showTrail = 1; - - // Guidance type for munitions - defaultSeekerType = "SACLOS"; - seekerTypes[] = { "SACLOS" }; - - defaultSeekerLockMode = "LOAL"; - seekerLockModes[] = { "LOAL", "LOBL" }; - - defaultNavigationType = "Line"; - navigationTypes[] = { "Line" }; - - lineGainP = 16; - lineGainD = 10.44; - - initialPitch = 2; - - seekLastTargetPos = 0; // seek last target position [if seeker loses LOS of target, continue to last known pos] - seekerAngle = 30; // Angle from the shooter's view that can track the missile - seekerAccuracy = 1; // seeker accuracy multiplier - - seekerMinRange = 75; - seekerMaxRange = 2000; // Range from the missile which the seeker can visually search - - correctionDistance = 30; // distance from center of crosshair where missile slows down - offsetFromCrosshair[] = { 0, 0, 0 }; // where the missile wants to stay in relation to the center of the crosshair. - - // Attack profile type selection - defaultAttackProfile = "BEAM"; - attackProfiles[] = {"BEAM"}; -}; \ No newline at end of file diff --git a/addons/missileGuidanceCompat/CfgMissileFalanga.hpp b/addons/missileGuidanceCompat/CfgMissileFalanga.hpp deleted file mode 100644 index a2ac5181..00000000 --- a/addons/missileGuidanceCompat/CfgMissileFalanga.hpp +++ /dev/null @@ -1,37 +0,0 @@ -class ace_missileguidance { - enabled = 1; - - pitchRate = 15; // Minium flap deflection for guidance - yawRate = 15; // Maximum flap deflection for guidance - - canVanillaLock = 0; // Can this default vanilla lock? Only applicable to non-cadet mode - - showTrail = 1; - - // Guidance type for munitions - defaultSeekerType = "MCLOS"; - seekerTypes[] = { "MCLOS" }; - - defaultSeekerLockMode = "LOAL"; - seekerLockModes[] = { "LOAL" }; - - defaultNavigationType = "Line"; - navigationTypes[] = { "Line" }; - - lineGainP = 5; - lineGainD = 0; - - seekLastTargetPos = 0; // seek last target position [if seeker loses LOS of target, continue to last known pos] - seekerAngle = 30; // Angle from the shooter's view that can track the missile - seekerAccuracy = 1; // seeker accuracy multiplier - - seekerMinRange = 0; - seekerMaxRange = 2500; // Range from the missile which the seeker can visually search - - correctionDistance = 0; // distance from center of crosshair where missile slows down - offsetFromCrosshair[] = { 0, 0, 0 }; // where the missile wants to stay in relation to the center of the crosshair. - - // Attack profile type selection - defaultAttackProfile = "WIRE"; - attackProfiles[] = {"WIRE"}; -}; \ No newline at end of file diff --git a/addons/missileGuidanceCompat/CfgMissileFleyta.hpp b/addons/missileGuidanceCompat/CfgMissileFleyta.hpp deleted file mode 100644 index cd08941e..00000000 --- a/addons/missileGuidanceCompat/CfgMissileFleyta.hpp +++ /dev/null @@ -1,37 +0,0 @@ -class ace_missileguidance { - enabled = 1; - - pitchRate = 15; // Minium flap deflection for guidance - yawRate = 15; // Maximum flap deflection for guidance - - canVanillaLock = 0; // Can this default vanilla lock? Only applicable to non-cadet mode - - showTrail = 1; - - // Guidance type for munitions - defaultSeekerType = "MCLOS"; - seekerTypes[] = { "MCLOS" }; - - defaultSeekerLockMode = "LOAL"; - seekerLockModes[] = { "LOAL" }; - - defaultNavigationType = "Line"; - navigationTypes[] = { "Line" }; - - lineGainP = 5; - lineGainD = 0; - - seekLastTargetPos = 0; // seek last target position [if seeker loses LOS of target, continue to last known pos] - seekerAngle = 30; // Angle from the shooter's view that can track the missile - seekerAccuracy = 1; // seeker accuracy multiplier - - seekerMinRange = 0; - seekerMaxRange = 3000; // Range from the missile which the seeker can visually search - - correctionDistance = 0; // distance from center of crosshair where missile slows down - offsetFromCrosshair[] = { 0, 0, 0 }; // where the missile wants to stay in relation to the center of the crosshair. - - // Attack profile type selection - defaultAttackProfile = "WIRE"; - attackProfiles[] = {"WIRE"}; -}; \ No newline at end of file diff --git a/addons/missileGuidanceCompat/CfgMissileHOT.hpp b/addons/missileGuidanceCompat/CfgMissileHOT.hpp deleted file mode 100644 index 9e2240bb..00000000 --- a/addons/missileGuidanceCompat/CfgMissileHOT.hpp +++ /dev/null @@ -1,38 +0,0 @@ -class ace_missileguidance { // reference https://github.com/acemod/ACE3/pull/10029 - enabled = 1; - - pitchRate = 45; // Minium flap deflection for guidance - yawRate = 45; // Maximum flap deflection for guidance - - canVanillaLock = 0; // Can this default vanilla lock? Only applicable to non-cadet mode - - showTrail = 1; - - // Guidance type for munitions - defaultSeekerType = "SACLOS"; - seekerTypes[] = { "SACLOS" }; - - defaultSeekerLockMode = "LOAL"; - seekerLockModes[] = { "LOAL", "LOBL" }; - - defaultNavigationType = "Line"; - navigationTypes[] = { "Line" }; - - lineGainP = 7; - lineGainD = 6; - - initialPitch = 2; - - seekLastTargetPos = 0; // seek last target position [if seeker loses LOS of target, continue to last known pos] - seekerAngle = 30; // Angle from the shooter's view that can track the missile - seekerAccuracy = 1; // seeker accuracy multiplier - - seekerMinRange = 75; - seekerMaxRange = 4000; // Range from the missile which the seeker can visually search - - offsetFromCrosshair[] = { 0, 0, 0 }; // where the missile wants to stay in relation to the center of the crosshair. - - // Attack profile type selection - defaultAttackProfile = "WIRE"; - attackProfiles[] = {"WIRE"}; -}; \ No newline at end of file diff --git a/addons/missileGuidanceCompat/CfgMissileIgla.hpp b/addons/missileGuidanceCompat/CfgMissileIgla.hpp deleted file mode 100644 index 37f1af50..00000000 --- a/addons/missileGuidanceCompat/CfgMissileIgla.hpp +++ /dev/null @@ -1,32 +0,0 @@ -class ace_missileguidance { - enabled = 1; - - pitchRate = 30; // Minium flap deflection for guidance - yawRate = 43; // Maximum flap deflection for guidance - - canVanillaLock = 1; // Can this default vanilla lock? Only applicable to non-cadet mode - - // Guidance type for munitions - defaultSeekerType = "IR"; - seekerTypes[] = { "IR" }; - - flareDistanceFilter = 100; - flareAngleFilter = 1.1; // can filter out flares that are >= flareAngleFilter to known target velocity - - defaultSeekerLockMode = "LOBL"; - seekerLockModes[] = { "LOBL" }; - - defaultNavigationType = "AugmentedProportionalNavigation"; - navigationTypes[] = { "AugmentedProportionalNavigation" }; - - seekLastTargetPos = 0; // seek last target position [if seeker loses LOS of target, continue to last known pos] - seekerAngle = 45; // Angle from the shooter's view that can track the missile - seekerAccuracy = 0.76; // seeker accuracy multiplier - - seekerMinRange = 5; - seekerMaxRange = 5200; // Range from the missile which the seeker can visually search - - // Attack profile type selection - defaultAttackProfile = "DIR"; - attackProfiles[] = {"DIR"}; -}; \ No newline at end of file diff --git a/addons/missileGuidanceCompat/CfgMissileKH25.hpp b/addons/missileGuidanceCompat/CfgMissileKH25.hpp deleted file mode 100644 index 884b71c5..00000000 --- a/addons/missileGuidanceCompat/CfgMissileKH25.hpp +++ /dev/null @@ -1,27 +0,0 @@ -class ace_missileguidance { - enabled = 1; - - pitchRate = 20; - yawRate = 20; - - canVanillaLock = 0; - - defaultSeekerType = "SALH"; - seekerTypes[] = {"SALH"}; - - defaultSeekerLockMode = "LOAL"; - seekerLockModes[] = {"LOAL"}; - - defaultNavigationType = "AugmentedProportionalNavigation"; - navigationTypes[] = { "AugmentedProportionalNavigation" }; - - seekLastTargetPos = 1; - seekerAngle = 40; - seekerAccuracy = 1; - - seekerMinRange = 1; - seekerMaxRange = 10000; - - defaultAttackProfile = "maverick"; - attackProfiles[] = {"maverick"}; -}; \ No newline at end of file diff --git a/addons/missileGuidanceCompat/CfgMissileKH29.hpp b/addons/missileGuidanceCompat/CfgMissileKH29.hpp deleted file mode 100644 index 884b71c5..00000000 --- a/addons/missileGuidanceCompat/CfgMissileKH29.hpp +++ /dev/null @@ -1,27 +0,0 @@ -class ace_missileguidance { - enabled = 1; - - pitchRate = 20; - yawRate = 20; - - canVanillaLock = 0; - - defaultSeekerType = "SALH"; - seekerTypes[] = {"SALH"}; - - defaultSeekerLockMode = "LOAL"; - seekerLockModes[] = {"LOAL"}; - - defaultNavigationType = "AugmentedProportionalNavigation"; - navigationTypes[] = { "AugmentedProportionalNavigation" }; - - seekLastTargetPos = 1; - seekerAngle = 40; - seekerAccuracy = 1; - - seekerMinRange = 1; - seekerMaxRange = 10000; - - defaultAttackProfile = "maverick"; - attackProfiles[] = {"maverick"}; -}; \ No newline at end of file diff --git a/addons/missileGuidanceCompat/CfgMissileKobra.hpp b/addons/missileGuidanceCompat/CfgMissileKobra.hpp deleted file mode 100644 index d628565d..00000000 --- a/addons/missileGuidanceCompat/CfgMissileKobra.hpp +++ /dev/null @@ -1,39 +0,0 @@ -class ace_missileguidance { - enabled = 1; - - pitchRate = 45; // Minium flap deflection for guidance - yawRate = 45; // Maximum flap deflection for guidance - - canVanillaLock = 0; // Can this default vanilla lock? Only applicable to non-cadet mode - - showTrail = 1; - - // Guidance type for munitions - defaultSeekerType = "SACLOS"; - seekerTypes[] = { "SACLOS" }; - - defaultSeekerLockMode = "LOAL"; - seekerLockModes[] = { "LOAL", "LOBL" }; - - defaultNavigationType = "Line"; - navigationTypes[] = { "Line" }; - - lineGainP = 16; - lineGainD = 9.5; - - initialPitch = 2; - - seekLastTargetPos = 0; // seek last target position [if seeker loses LOS of target, continue to last known pos] - seekerAngle = 30; // Angle from the shooter's view that can track the missile - seekerAccuracy = 1; // seeker accuracy multiplier - - seekerMinRange = 75; - seekerMaxRange = 5000; // Range from the missile which the seeker can visually search - - correctionDistance = 30; // distance from center of crosshair where missile slows down - offsetFromCrosshair[] = { 0, 0, 0 }; // where the missile wants to stay in relation to the center of the crosshair. - - // Attack profile type selection - defaultAttackProfile = "BEAM"; - attackProfiles[] = {"BEAM"}; -}; \ No newline at end of file diff --git a/addons/missileGuidanceCompat/CfgMissileKonkurs.hpp b/addons/missileGuidanceCompat/CfgMissileKonkurs.hpp deleted file mode 100644 index 44446d5f..00000000 --- a/addons/missileGuidanceCompat/CfgMissileKonkurs.hpp +++ /dev/null @@ -1,38 +0,0 @@ -class ace_missileguidance { - enabled = 1; - - pitchRate = 45; // Minium flap deflection for guidance - yawRate = 45; // Maximum flap deflection for guidance - - canVanillaLock = 0; // Can this default vanilla lock? Only applicable to non-cadet mode - - showTrail = 1; - - // Guidance type for munitions - defaultSeekerType = "SACLOS"; - seekerTypes[] = { "SACLOS" }; - - defaultSeekerLockMode = "LOAL"; - seekerLockModes[] = { "LOAL", "LOBL" }; - - defaultNavigationType = "Line"; - navigationTypes[] = { "Line" }; - - lineGainP = 10; - lineGainD = 8.5; - - initialPitch = 2; - - seekLastTargetPos = 0; // seek last target position [if seeker loses LOS of target, continue to last known pos] - seekerAngle = 30; // Angle from the shooter's view that can track the missile - seekerAccuracy = 1; // seeker accuracy multiplier - - seekerMinRange = 75; - seekerMaxRange = 4000; // Range from the missile which the seeker can visually search - - offsetFromCrosshair[] = { 0, 0, 0 }; // where the missile wants to stay in relation to the center of the crosshair. - - // Attack profile type selection - defaultAttackProfile = "WIRE"; - attackProfiles[] = {"WIRE"}; -}; \ No newline at end of file diff --git a/addons/missileGuidanceCompat/CfgMissileKornet.hpp b/addons/missileGuidanceCompat/CfgMissileKornet.hpp deleted file mode 100644 index d69eefb8..00000000 --- a/addons/missileGuidanceCompat/CfgMissileKornet.hpp +++ /dev/null @@ -1,39 +0,0 @@ -class ace_missileguidance { - enabled = 1; - - pitchRate = 45; // Minium flap deflection for guidance - yawRate = 45; // Maximum flap deflection for guidance - - canVanillaLock = 0; // Can this default vanilla lock? Only applicable to non-cadet mode - - showTrail = 1; - - // Guidance type for munitions - defaultSeekerType = "SACLOS"; - seekerTypes[] = { "SACLOS" }; - - defaultSeekerLockMode = "LOAL"; - seekerLockModes[] = { "LOAL", "LOBL" }; - - defaultNavigationType = "Line"; - navigationTypes[] = { "Line" }; - - lineGainP = 16; - lineGainD = 10.44; - - initialPitch = 2; - - seekLastTargetPos = 0; // seek last target position [if seeker loses LOS of target, continue to last known pos] - seekerAngle = 30; // Angle from the shooter's view that can track the missile - seekerAccuracy = 1; // seeker accuracy multiplier - - seekerMinRange = 75; - seekerMaxRange = 5000; // Range from the missile which the seeker can visually search - - correctionDistance = 30; // distance from center of crosshair where missile slows down - offsetFromCrosshair[] = { 0, 0, 0 }; // where the missile wants to stay in relation to the center of the crosshair. - - // Attack profile type selection - defaultAttackProfile = "BEAM"; - attackProfiles[] = {"BEAM"}; -}; \ No newline at end of file diff --git a/addons/missileGuidanceCompat/CfgMissileMalyutka.hpp b/addons/missileGuidanceCompat/CfgMissileMalyutka.hpp deleted file mode 100644 index a2ac5181..00000000 --- a/addons/missileGuidanceCompat/CfgMissileMalyutka.hpp +++ /dev/null @@ -1,37 +0,0 @@ -class ace_missileguidance { - enabled = 1; - - pitchRate = 15; // Minium flap deflection for guidance - yawRate = 15; // Maximum flap deflection for guidance - - canVanillaLock = 0; // Can this default vanilla lock? Only applicable to non-cadet mode - - showTrail = 1; - - // Guidance type for munitions - defaultSeekerType = "MCLOS"; - seekerTypes[] = { "MCLOS" }; - - defaultSeekerLockMode = "LOAL"; - seekerLockModes[] = { "LOAL" }; - - defaultNavigationType = "Line"; - navigationTypes[] = { "Line" }; - - lineGainP = 5; - lineGainD = 0; - - seekLastTargetPos = 0; // seek last target position [if seeker loses LOS of target, continue to last known pos] - seekerAngle = 30; // Angle from the shooter's view that can track the missile - seekerAccuracy = 1; // seeker accuracy multiplier - - seekerMinRange = 0; - seekerMaxRange = 2500; // Range from the missile which the seeker can visually search - - correctionDistance = 0; // distance from center of crosshair where missile slows down - offsetFromCrosshair[] = { 0, 0, 0 }; // where the missile wants to stay in relation to the center of the crosshair. - - // Attack profile type selection - defaultAttackProfile = "WIRE"; - attackProfiles[] = {"WIRE"}; -}; \ No newline at end of file diff --git a/addons/missileGuidanceCompat/CfgMissileMetis.hpp b/addons/missileGuidanceCompat/CfgMissileMetis.hpp deleted file mode 100644 index 55b2b2b8..00000000 --- a/addons/missileGuidanceCompat/CfgMissileMetis.hpp +++ /dev/null @@ -1,38 +0,0 @@ -class ace_missileguidance { - enabled = 1; - - pitchRate = 50; // Minium flap deflection for guidance - yawRate = 50; // Maximum flap deflection for guidance - initialPitch = 2; - - canVanillaLock = 0; // Can this default vanilla lock? Only applicable to non-cadet mode - - showTrail = 1; - - // Guidance type for munitions - defaultSeekerType = "SACLOS"; - seekerTypes[] = { "SACLOS" }; - - defaultSeekerLockMode = "LOAL"; - seekerLockModes[] = { "LOAL", "LOBL" }; - - defaultNavigationType = "Line"; - navigationTypes[] = { "Line" }; - - lineGainP = 16; - lineGainD = 10.44; - - seekLastTargetPos = 0; // seek last target position [if seeker loses LOS of target, continue to last known pos] - seekerAngle = 15; // Angle from the shooter's view that can track the missile - seekerAccuracy = 1; // seeker accuracy multiplier - - seekerMinRange = 80; - seekerMaxRange = 1000; // Range from the missile which the seeker can visually search - - correctionDistance = 3; // distance from center of crosshair where missile slows down - offsetFromCrosshair[] = { 0, 0, 0 }; // where the missile wants to stay in relation to the center of the crosshair. - - // Attack profile type selection - defaultAttackProfile = "WIRE"; - attackProfiles[] = {"WIRE"}; -}; \ No newline at end of file diff --git a/addons/missileGuidanceCompat/CfgMissileMilan.hpp b/addons/missileGuidanceCompat/CfgMissileMilan.hpp deleted file mode 100644 index 52bb862d..00000000 --- a/addons/missileGuidanceCompat/CfgMissileMilan.hpp +++ /dev/null @@ -1,38 +0,0 @@ -class ace_missileguidance { - enabled = 1; - - pitchRate = 60; // Minium flap deflection for guidance - yawRate = 60; // Maximum flap deflection for guidance - - canVanillaLock = 0; // Can this default vanilla lock? Only applicable to non-cadet mode - - showTrail = 0; - - // Guidance type for munitions - defaultSeekerType = "SACLOS"; - seekerTypes[] = { "SACLOS" }; - - defaultSeekerLockMode = "LOAL"; - seekerLockModes[] = { "LOAL", "LOBL" }; - - defaultNavigationType = "Line"; - navigationTypes[] = { "Line" }; - - lineGainP = 25; - lineGainD = 12; - - initialPitch = -0.4; - - seekLastTargetPos = 0; // seek last target position [if seeker loses LOS of target, continue to last known pos] - seekerAngle = 5; // Angle from the shooter's view that can track the missile, implemented - seekerAccuracy = 1; // seeker accuracy multiplier, not implemented? - - seekerMinRange = 100; - seekerMaxRange = 2000; // Range from the missile which the seeker can visually search - - offsetFromCrosshair[] = { 0, 0, 0 }; // where the missile wants to stay in relation to the center of the crosshair. - - // Attack profile type selection - defaultAttackProfile = "WIRE"; - attackProfiles[] = {"WIRE"}; -}; \ No newline at end of file diff --git a/addons/missileGuidanceCompat/CfgMissileMolniya.hpp b/addons/missileGuidanceCompat/CfgMissileMolniya.hpp deleted file mode 100644 index 0dc7b50d..00000000 --- a/addons/missileGuidanceCompat/CfgMissileMolniya.hpp +++ /dev/null @@ -1,32 +0,0 @@ -class ace_missileguidance { - enabled = 1; - - pitchRate = 45; // Minium flap deflection for guidance - yawRate = 45; // Maximum flap deflection for guidance - - canVanillaLock = 1; // Can this default vanilla lock? Only applicable to non-cadet mode - - // Guidance type for munitions - defaultSeekerType = "IR"; - seekerTypes[] = { "IR" }; - - flareDistanceFilter = 50; - flareAngleFilter = 0.8; // can filter out flares that are >= flareAngleFilter to known target velocity - - defaultSeekerLockMode = "LOBL"; - seekerLockModes[] = { "LOBL" }; - - defaultNavigationType = "AugmentedProportionalNavigation"; - navigationTypes[] = { "AugmentedProportionalNavigation" }; - - seekLastTargetPos = 0; // seek last target position [if seeker loses LOS of target, continue to last known pos] - seekerAngle = 40; // Angle from the shooter's view that can track the missile - seekerAccuracy = 0.85; // seeker accuracy multiplier - - seekerMinRange = 75; - seekerMaxRange = 5000; // Range from the missile which the seeker can visually search - - // Attack profile type selection - defaultAttackProfile = "DIR"; - attackProfiles[] = {"DIR"}; -}; \ No newline at end of file diff --git a/addons/missileGuidanceCompat/CfgMissileR73.hpp b/addons/missileGuidanceCompat/CfgMissileR73.hpp deleted file mode 100644 index d1da548c..00000000 --- a/addons/missileGuidanceCompat/CfgMissileR73.hpp +++ /dev/null @@ -1,32 +0,0 @@ -class ace_missileguidance { - enabled = 1; - - pitchRate = 35; // Minium flap deflection for guidance - yawRate = 35; // Maximum flap deflection for guidance - - canVanillaLock = 1; // Can this default vanilla lock? Only applicable to non-cadet mode - - // Guidance type for munitions - defaultSeekerType = "IR"; - seekerTypes[] = { "IR" }; - - flareDistanceFilter = 50; - flareAngleFilter = 0.8; // can filter out flares that are >= flareAngleFilter to known target velocity - - defaultSeekerLockMode = "LOBL"; - seekerLockModes[] = { "LOBL" }; - - defaultNavigationType = "AugmentedProportionalNavigation"; - navigationTypes[] = { "AugmentedProportionalNavigation" }; - - seekLastTargetPos = 0; // seek last target position [if seeker loses LOS of target, continue to last known pos] - seekerAngle = 40; // Angle from the shooter's view that can track the missile - seekerAccuracy = 0.85; // seeker accuracy multiplier - - seekerMinRange = 75; - seekerMaxRange = 5000; // Range from the missile which the seeker can visually search - - // Attack profile type selection - defaultAttackProfile = "DIR"; - attackProfiles[] = {"DIR"}; -}; \ No newline at end of file diff --git a/addons/missileGuidanceCompat/CfgMissileR77.hpp b/addons/missileGuidanceCompat/CfgMissileR77.hpp deleted file mode 100644 index a7d5b3ba..00000000 --- a/addons/missileGuidanceCompat/CfgMissileR77.hpp +++ /dev/null @@ -1,38 +0,0 @@ -flightProfiles[] = {"Direct", "TopDown"}; -class Direct {}; // dummy to allow for F cycling of missile mode -class TopDown {}; -class ace_missileguidance { - enabled = 1; - - pitchRate = 40; // Minium flap deflection for guidance - yawRate = 40; // Maximum flap deflection for guidance - - canVanillaLock = 1; // Can this default vanilla lock? Only applicable to non-cadet mode - - // Guidance type for munitions - defaultSeekerType = "DopplerRadar"; - seekerTypes[] = { "DopplerRadar" }; - lockableTypes[] = {"Air"}; - - minimumSpeedFilter = 15; // filter out targets that have a closing velocity less than this - minimumTimeFilter = 0.00005; // filter out targets that are this close to the ground (speed of light) - maxTerrainCheck = 16000; // How far we should check for terrain - - defaultSeekerLockMode = "LOAL"; - seekerLockModes[] = { "LOAL", "LOBL" }; - - defaultNavigationType = "ZeroEffortMiss"; - navigationTypes[] = { "ZeroEffortMiss" }; - - seekLastTargetPos = 0; // seek last target position [if seeker loses LOS of target, continue to last known pos] - seekerAngle = 50; // Angle from the shooter's view that can track the missile - seekerAccuracy = 1; // seeker accuracy multiplier - - seekerMinRange = 75; - seekerMaxRange = 2500; // Range from the missile which the seeker can visually search - - // Attack profile type selection - defaultAttackProfile = "DIR"; - attackProfiles[] = {"DIR", "LOFT"}; - useModeForAttackProfile = 1; -}; \ No newline at end of file diff --git a/addons/missileGuidanceCompat/CfgMissileRefleks.hpp b/addons/missileGuidanceCompat/CfgMissileRefleks.hpp deleted file mode 100644 index d69eefb8..00000000 --- a/addons/missileGuidanceCompat/CfgMissileRefleks.hpp +++ /dev/null @@ -1,39 +0,0 @@ -class ace_missileguidance { - enabled = 1; - - pitchRate = 45; // Minium flap deflection for guidance - yawRate = 45; // Maximum flap deflection for guidance - - canVanillaLock = 0; // Can this default vanilla lock? Only applicable to non-cadet mode - - showTrail = 1; - - // Guidance type for munitions - defaultSeekerType = "SACLOS"; - seekerTypes[] = { "SACLOS" }; - - defaultSeekerLockMode = "LOAL"; - seekerLockModes[] = { "LOAL", "LOBL" }; - - defaultNavigationType = "Line"; - navigationTypes[] = { "Line" }; - - lineGainP = 16; - lineGainD = 10.44; - - initialPitch = 2; - - seekLastTargetPos = 0; // seek last target position [if seeker loses LOS of target, continue to last known pos] - seekerAngle = 30; // Angle from the shooter's view that can track the missile - seekerAccuracy = 1; // seeker accuracy multiplier - - seekerMinRange = 75; - seekerMaxRange = 5000; // Range from the missile which the seeker can visually search - - correctionDistance = 30; // distance from center of crosshair where missile slows down - offsetFromCrosshair[] = { 0, 0, 0 }; // where the missile wants to stay in relation to the center of the crosshair. - - // Attack profile type selection - defaultAttackProfile = "BEAM"; - attackProfiles[] = {"BEAM"}; -}; \ No newline at end of file diff --git a/addons/missileGuidanceCompat/CfgMissileShturm.hpp b/addons/missileGuidanceCompat/CfgMissileShturm.hpp deleted file mode 100644 index 5b81860f..00000000 --- a/addons/missileGuidanceCompat/CfgMissileShturm.hpp +++ /dev/null @@ -1,38 +0,0 @@ -class ace_missileguidance { - enabled = 1; - - pitchRate = 45; // Minium flap deflection for guidance - yawRate = 45; // Maximum flap deflection for guidance - - canVanillaLock = 0; // Can this default vanilla lock? Only applicable to non-cadet mode - - showTrail = 1; - - // Guidance type for munitions - defaultSeekerType = "SACLOS"; - seekerTypes[] = { "SACLOS" }; - - defaultSeekerLockMode = "LOAL"; - seekerLockModes[] = { "LOAL", "LOBL" }; - - defaultNavigationType = "Line"; - navigationTypes[] = { "Line" }; - - lineGainP = 16; - lineGainD = 10.44; - - initialPitch = 2; - - seekLastTargetPos = 0; // seek last target position [if seeker loses LOS of target, continue to last known pos] - seekerAngle = 30; // Angle from the shooter's view that can track the missile - seekerAccuracy = 1; // seeker accuracy multiplier - - seekerMinRange = 75; - seekerMaxRange = 4000; // Range from the missile which the seeker can visually search - - offsetFromCrosshair[] = { 0, 0, 0 }; // where the missile wants to stay in relation to the center of the crosshair. - - // Attack profile type selection - defaultAttackProfile = "BEAM"; - attackProfiles[] = {"BEAM"}; -}; \ No newline at end of file diff --git a/addons/missileGuidanceCompat/CfgMissileStrela.hpp b/addons/missileGuidanceCompat/CfgMissileStrela.hpp deleted file mode 100644 index dc127778..00000000 --- a/addons/missileGuidanceCompat/CfgMissileStrela.hpp +++ /dev/null @@ -1,32 +0,0 @@ -class ace_missileguidance { - enabled = 1; - - pitchRate = 30; // Minium flap deflection for guidance - yawRate = 30; // Maximum flap deflection for guidance - - canVanillaLock = 1; // Can this default vanilla lock? Only applicable to non-cadet mode - - // Guidance type for munitions - defaultSeekerType = "IR"; - seekerTypes[] = { "IR" }; - - flareDistanceFilter = 100; - flareAngleFilter = 1.6; // can filter out flares that are >= flareAngleFilter to known target velocity - - defaultSeekerLockMode = "LOBL"; - seekerLockModes[] = { "LOBL" }; - - defaultNavigationType = "ProportionalNavigation"; - navigationTypes[] = { "ProportionalNavigation" }; - - seekLastTargetPos = 0; // seek last target position [if seeker loses LOS of target, continue to last known pos] - seekerAngle = 45; // Angle from the shooter's view that can track the missile - seekerAccuracy = 0.6; // seeker accuracy multiplier - - seekerMinRange = 10; - seekerMaxRange = 3700; // Range from the missile which the seeker can visually search - - // Attack profile type selection - defaultAttackProfile = "DIR"; - attackProfiles[] = {"DIR"}; -}; \ No newline at end of file diff --git a/addons/missileGuidanceCompat/CfgMissileTypesNato.hpp b/addons/missileGuidanceCompat/CfgMissileTypesNato.hpp new file mode 100644 index 00000000..1d1af0ab --- /dev/null +++ b/addons/missileGuidanceCompat/CfgMissileTypesNato.hpp @@ -0,0 +1,20 @@ +class ACEGVAR(missileguidance,type_AMRAAM); +class ACEGVAR(missileguidance,type_ASRAAM); +class ACEGVAR(missileguidance,type_Dagr); +class ACEGVAR(missileguidance,type_Dragon); +class ACEGVAR(missileguidance,type_ESSM); +class ACEGVAR(missileguidance,type_Hellfire); +class ACEGVAR(missileguidance,type_Hot); +class ACEGVAR(missileguidance,type_Javelin); +class ACEGVAR(missileguidance,type_Jdam); +class ACEGVAR(missileguidance,type_Maverick); +class ACEGVAR(missileguidance,type_Milan); +class ACEGVAR(missileguidance,type_Nlaw); +class ACEGVAR(missileguidance,type_Patriot); +class ACEGVAR(missileguidance,type_Paveway); +class ACEGVAR(missileguidance,type_RAM); +class ACEGVAR(missileguidance,type_RBS70); +class ACEGVAR(missileguidance,type_Redeye); +class ACEGVAR(missileguidance,type_Sidewinder); +class ACEGVAR(missileguidance,type_Stinger); +class ACEGVAR(missileguidance,type_TOW); \ No newline at end of file diff --git a/addons/missileGuidanceCompat/CfgMissileTypesWarsaw.hpp b/addons/missileGuidanceCompat/CfgMissileTypesWarsaw.hpp new file mode 100644 index 00000000..b110265e --- /dev/null +++ b/addons/missileGuidanceCompat/CfgMissileTypesWarsaw.hpp @@ -0,0 +1,25 @@ +class ACEGVAR(missileguidance,type_Ataka); +class ACEGVAR(missileguidance,type_Bastion); +class ACEGVAR(missileguidance,type_Drakon); +class ACEGVAR(missileguidance,type_Fagot); +class ACEGVAR(missileguidance,type_Falanga); +class ACEGVAR(missileguidance,type_Fleyta); +class ACEGVAR(missileguidance,type_Igla); +class ACEGVAR(missileguidance,type_KAB); +class ACEGVAR(missileguidance,type_KH25); +class ACEGVAR(missileguidance,type_KH29); +class ACEGVAR(missileguidance,type_Kobra); +class ACEGVAR(missileguidance,type_Konkurs); +class ACEGVAR(missileguidance,type_Kornet); +class ACEGVAR(missileguidance,type_Malyutka); +class ACEGVAR(missileguidance,type_Metis); +class ACEGVAR(missileguidance,type_Molniya); +class ACEGVAR(missileguidance,type_R73); +class ACEGVAR(missileguidance,type_R74); +class ACEGVAR(missileguidance,type_R77); +class ACEGVAR(missileguidance,type_Refleks); +class ACEGVAR(missileguidance,type_S400); +class ACEGVAR(missileguidance,type_Shturm); +class ACEGVAR(missileguidance,type_Strela); +class ACEGVAR(missileguidance,type_Vikhr); +class ACEGVAR(missileguidance,type_Vympel); \ No newline at end of file diff --git a/addons/missileGuidanceCompat/CfgMissileVikhr.hpp b/addons/missileGuidanceCompat/CfgMissileVikhr.hpp deleted file mode 100644 index d68e4bad..00000000 --- a/addons/missileGuidanceCompat/CfgMissileVikhr.hpp +++ /dev/null @@ -1,34 +0,0 @@ -class ace_missileguidance { - enabled = 1; - showTrail = 1; - - pitchRate = 60; // Minium flap deflection for guidance - yawRate = 60; // Maximum flap deflection for guidance - - canVanillaLock = 1; // Can this default vanilla lock? Only applicable to non-cadet mode - - // Guidance type for munitions - defaultSeekerType = "SACLOS"; - seekerTypes[] = { "SACLOS" }; - - defaultSeekerLockMode = "LOBL"; - seekerLockModes[] = { "LOBL" }; - - defaultNavigationType = "Line"; - navigationTypes[] = { "Line" }; - - lineGainP = 20; - lineGainD = 16; - correctionDistance = 5; - - seekLastTargetPos = 0; // seek last target position [if seeker loses LOS of target, continue to last known pos] - seekerAngle = 15; // Angle from the shooter's view that can track the missile - seekerAccuracy = 1; // seeker accuracy multiplier - - seekerMinRange = 30; - seekerMaxRange = 12000; // Range from the missile which the seeker can visually search - - // Attack profile type selection - defaultAttackProfile = "BEAM"; - attackProfiles[] = {"BEAM"}; -}; \ No newline at end of file diff --git a/addons/missileGuidanceCompat/CfgMissileVympel.hpp b/addons/missileGuidanceCompat/CfgMissileVympel.hpp deleted file mode 100644 index d1da548c..00000000 --- a/addons/missileGuidanceCompat/CfgMissileVympel.hpp +++ /dev/null @@ -1,32 +0,0 @@ -class ace_missileguidance { - enabled = 1; - - pitchRate = 35; // Minium flap deflection for guidance - yawRate = 35; // Maximum flap deflection for guidance - - canVanillaLock = 1; // Can this default vanilla lock? Only applicable to non-cadet mode - - // Guidance type for munitions - defaultSeekerType = "IR"; - seekerTypes[] = { "IR" }; - - flareDistanceFilter = 50; - flareAngleFilter = 0.8; // can filter out flares that are >= flareAngleFilter to known target velocity - - defaultSeekerLockMode = "LOBL"; - seekerLockModes[] = { "LOBL" }; - - defaultNavigationType = "AugmentedProportionalNavigation"; - navigationTypes[] = { "AugmentedProportionalNavigation" }; - - seekLastTargetPos = 0; // seek last target position [if seeker loses LOS of target, continue to last known pos] - seekerAngle = 40; // Angle from the shooter's view that can track the missile - seekerAccuracy = 0.85; // seeker accuracy multiplier - - seekerMinRange = 75; - seekerMaxRange = 5000; // Range from the missile which the seeker can visually search - - // Attack profile type selection - defaultAttackProfile = "DIR"; - attackProfiles[] = {"DIR"}; -}; \ No newline at end of file diff --git a/addons/missileGuidanceCompat/config.cpp b/addons/missileGuidanceCompat/config.cpp index 2a57892e..23b65070 100644 --- a/addons/missileGuidanceCompat/config.cpp +++ b/addons/missileGuidanceCompat/config.cpp @@ -4,7 +4,7 @@ class CfgPatches { class ADDON { units[] = {}; requiredVersion = REQUIRED_VERSION; - requiredAddons[] = {"potato_core", "ace_missileguidance", "CUP_Weapons_LoadOrder"}; + requiredAddons[] = {"potato_core", "ace_missileguidance"}; skipWhenMissingDependencies = 1; author = "Potato"; authors[] = {"Dani (TCVM)"}; @@ -13,5 +13,6 @@ class CfgPatches { }; }; +#include "CfgMissileTypesWarsaw.hpp" +#include "CfgMissileTypesNato.hpp" #include "CfgAmmo.hpp" -#include "CfgMagazines.hpp" diff --git a/addons/missileGuidanceCompat/patchCUP/config.cpp b/addons/missileGuidanceCompat/patchCUP/config.cpp new file mode 100644 index 00000000..e0dce54e --- /dev/null +++ b/addons/missileGuidanceCompat/patchCUP/config.cpp @@ -0,0 +1,172 @@ +#include "\z\potato\addons\missileGuidanceCompat\script_component.hpp" +#undef COMPONENT +#define COMPONENT missileGuidanceCompat_patchCUP + +class CfgPatches { + class ADDON { + units[] = {}; + weapons[] = {}; + requiredVersion = REQUIRED_VERSION; + requiredAddons[] = {"potato_missileGuidanceCompat", "CUP_Weapons_LoadOrder"}; + skipWhenMissingDependencies = 1; + author = "Bourbon Warfare"; + authorUrl = "https://github.com/BourbonWarfare/POTATO"; + VERSION_CONFIG; + }; +}; + +#include "../CfgMissileTypesWarsaw.hpp" +#include "../CfgMissileTypesNato.hpp" + +class CfgMagazines { + class CA_LauncherMagazine; + class CUP_Dragon_EP1_M: CA_LauncherMagazine { + ammo = "ace_dragon_super"; + initSpeed = 120; + }; +}; + +class CfgAmmo { + class M_Titan_AA; + class MissileBase; + class M_Titan_AT; + class Bo_GBU12_LGB; + + class CUP_M_9K32_Strela_2_AA: M_Titan_AA { + maneuvrability = 0; + ACE_MISSILE(Strela); + }; + + class CUP_M_9K38_Igla_AA: M_Titan_AA { + maneuvrability = 0; + ACE_MISSILE(Igla); + }; + + class CUP_M_9M17P_AT2_Falanga_AT: MissileBase { + maneuvrability = 0; + ACE_MISSILE(Falanga); + }; + + class CUP_M_9M17P_AT3_Sagger_AT: MissileBase { + maneuvrability = 0; + ACE_MISSILE(Fleyta); + }; + + class CUP_M_9M113_AT5_Spandrel_AT: M_Titan_AT { + maneuvrability = 0; + ACE_MISSILE(Konkurs); + }; + + class CUP_M_Shturm_9M114_AT6_Spiral_AT: MissileBase { + maneuvrability = 0; + ACE_MISSILE(Shturm); + }; + + class CUP_M_Ataka_V_9M120_AT9_Spiral_2_AT: MissileBase { + maneuvrability = 0; + ACE_MISSILE(Ataka); + }; + + class CUP_M_9K116_1_Bastion_AT10_Stabber_AT: MissileBase { + maneuvrability = 0; + ACE_MISSILE(Bastion); + }; + + class CUP_M_9M119M_Refleks_AT11_Sniper_AT: MissileBase { + maneuvrability = 0; + ACE_MISSILE(Refleks); + }; + + class CUP_M_9K115_2_AT13_Saxhorn_2_AT: MissileBase { + maneuvrability = 0; + ACE_MISSILE(Metis); + }; + + class CUP_M_9M133_1_AT14_Spriggan_AT: MissileBase { + maneuvrability = 0; + ACE_MISSILE(Kornet); + }; + + class CUP_M_9M133_1_AT14_Spriggan_HE: CUP_M_9M133_1_AT14_Spriggan_AT { + maneuvrability = 0; + ACE_MISSILE(Kornet); + }; + + class CUP_M_9K121_Vikhr_AT16_Scallion_AT: MissileBase { + maneuvrability = 0; + ACE_MISSILE(Vikhr); + }; + + class CUP_M_KH29L_AT: MissileBase { + maneuvrability = 0; + ACE_MISSILE(KH29); + }; + + class CUP_M_AGM_114K_Hellfire_II_AT: MissileBase { + maneuvrability = 0; + ACE_MISSILE(Hellfire); + }; + + class CUP_M_AGM_114L_Hellfire_II_AT: MissileBase { + class ace_missileguidance: ACEGVAR(missileguidance,type_Hellfire) { + enabled = 1; + // Guidance type for munitions + defaultSeekerType = "MillimeterWaveRadar"; + seekerTypes[] = { "MillimeterWaveRadar" }; + + seekLastTargetPos = 0; // seek last target position [if seeker loses LOS of target, continue to last known pos] + seekerAngle = 70; // Angle in front of the missile which can be searched + seekerAccuracy = 1; // seeker accuracy multiplier + + seekerMinRange = 1; + activeRadarEngageDistance = 1000; + seekerMaxRange = 2000; // distance that the hellfire internal radar can scan + }; + }; + + class CUP_M_AIM_9L_Sidewinder_AA: MissileBase { + maneuvrability = 0; + ACE_MISSILE(Sidewinder); + }; + + class CUP_M_Stinger_AA: MissileBase { + maneuvrability = 0; + ACE_MISSILE(Stinger); + }; + + class EGVAR(missileGuidanceCompat,redeye): CUP_M_Stinger_AA { // BWC naming, used in CWR + maneuvrability = 0; + ACE_MISSILE(Redeye); + }; + + class CUP_M_RBS70_AA: MissileBase { + maneuvrability = 0; + ACE_MISSILE(RBS70); + }; + + class CUP_AGM65pod_AT: MissileBase { + maneuvrability = 0; + ACE_MISSILE(Maverick); + }; + + class CUP_R_TOW_AT: M_Titan_AT { + maneuvrability = 0; + ACE_MISSILE(TOW); + }; + + class CUP_R_TOW2_AT: CUP_R_TOW_AT { + maneuvrability = 0; + ACE_MISSILE(TOW); + }; + + class CUP_Bo_GBU12_LGB: Bo_GBU12_LGB { + maneuvrability = 0; // no maneuvrability so that default guidance doesnt work + ACE_MISSILE(Paveway); + }; + + class CUP_Bo_KAB250_LGB: Bo_GBU12_LGB { + maneuvrability = 0; // no maneuvrability so that default guidance doesnt work + ACE_MISSILE(KAB); + }; +}; + diff --git a/addons/missileGuidanceCompat/patchGM/config.cpp b/addons/missileGuidanceCompat/patchGM/config.cpp index c41cefda..f9246f40 100644 --- a/addons/missileGuidanceCompat/patchGM/config.cpp +++ b/addons/missileGuidanceCompat/patchGM/config.cpp @@ -22,12 +22,15 @@ class CfgPatches { }; }; +#include "../CfgMissileTypesNato.hpp" +#include "../CfgMissileTypesWarsaw.hpp" + class CfgAmmo { class gm_missile_saclos_base; // Bastion class gm_missile_bastion_base: gm_missile_saclos_base { maneuvrability = 0; - #include "../CfgMissileBastion.hpp" + ACE_MISSILE(Bastion); }; class gm_missile_bastion_heat_9M117: gm_missile_bastion_base { class ace_missileguidance: ace_missileguidance { @@ -52,7 +55,7 @@ class CfgAmmo { // Fagot missile class gm_missile_fagot_base: gm_missile_saclos_base { maneuvrability = 0; - #include "../CfgMissileFagot.hpp" + ACE_MISSILE(Fagot); }; class gm_missile_fagot_heat_9m111: gm_missile_fagot_base { class ace_missileguidance: ace_missileguidance { @@ -60,7 +63,6 @@ class CfgAmmo { showTrail = 0; pitchRate = 25; yawRate = 25; - initialPitch = 0; lineGainP = 7; lineGainD = 4; }; @@ -68,7 +70,7 @@ class CfgAmmo { // HOT missile class gm_missile_hot_base: gm_missile_saclos_base { maneuvrability = 0; - #include "../CfgMissileHOT.hpp" + ACE_MISSILE(Hot); }; class gm_missile_hot_heat_dm72: gm_missile_hot_base { class ace_missileguidance: ace_missileguidance { @@ -85,7 +87,7 @@ class CfgAmmo { // Malyutka class gm_missile_maljutka_base: gm_missile_saclos_base { maneuvrability = 0; - #include "../CfgMissileMalyutka.hpp" + ACE_MISSILE(Malyutka); }; class gm_missile_maljutka_heat_9m14: gm_missile_maljutka_base { class ace_missileguidance: ace_missileguidance { @@ -102,57 +104,28 @@ class CfgAmmo { // Milan class gm_missile_milan_base: gm_missile_saclos_base { maneuvrability = 0; - #include "../CfgMissileMilan.hpp" + ACE_MISSILE(Milan); }; class gm_missile_milan_heat_dm82: gm_missile_milan_base { class ace_missileguidance: ace_missileguidance { enabled = 1; + initialPitch = 0.4; }; }; class gm_missile_milan_heat_dm92: gm_missile_milan_base { class ace_missileguidance: ace_missileguidance { enabled = 1; + initialPitch = 0.4; }; }; // AA Missiles class gm_rocket_72mm_HE_9m32m_base; class gm_rocket_72mm_HE_9m32m: gm_rocket_72mm_HE_9m32m_base { maneuvrability = 0; - #include "../CfgMissileStrela.hpp" + ACE_MISSILE(Strela); }; class gm_rocket_70mm_HE_m585_base; class gm_rocket_70mm_HE_m585: gm_rocket_70mm_HE_m585_base { - class ace_missileguidance { // from main CfgAmmo.hpp - enabled = 1; - - pitchRate = 27; // Minium flap deflection for guidance - yawRate = 27; // Maximum flap deflection for guidance - - canVanillaLock = 1; // Can this default vanilla lock? Only applicable to non-cadet mode - - // Guidance type for munitions - defaultSeekerType = "IR"; - seekerTypes[] = { "IR" }; - - flareDistanceFilter = 100; - flareAngleFilter = 2.0; // can filter out flares that are >= flareAngleFilter to known target velocity - - defaultSeekerLockMode = "LOBL"; - seekerLockModes[] = { "LOBL" }; - - defaultNavigationType = "ProportionalNavigation"; - navigationTypes[] = { "ProportionalNavigation" }; - - seekLastTargetPos = 0; // seek last target position [if seeker loses LOS of target, continue to last known pos] - seekerAngle = 45; // Angle from the shooter's view that can track the missile - seekerAccuracy = 0.4; // seeker accuracy multiplier - - seekerMinRange = 75; - seekerMaxRange = 4500; // Range from the missile which the seeker can visually search - - // Attack profile type selection - defaultAttackProfile = "DIR"; - attackProfiles[] = {"DIR"}; - }; + ACE_MISSILE(Redeye); }; }; diff --git a/addons/missileGuidanceCompat/patchMELB/config.cpp b/addons/missileGuidanceCompat/patchMELB/config.cpp index 8d9167d5..8163f217 100644 --- a/addons/missileGuidanceCompat/patchMELB/config.cpp +++ b/addons/missileGuidanceCompat/patchMELB/config.cpp @@ -15,6 +15,7 @@ class CfgPatches { }; }; +class ACEGVAR(missileguidance,type_Hellfire); class CfgAmmo { class Missile_AGM_02_F; @@ -23,47 +24,6 @@ class CfgAmmo { laserLock = 0; manualControl = 0; - class ace_missileguidance { - enabled = 1; - - pitchRate = 30; // degrees per second - yawRate = 30; - - canVanillaLock = 0; // Can this default vanilla lock? Only applicable to non-cadet mode - - // Guidance type for munitions - defaultSeekerType = "SALH"; - seekerTypes[] = { "SALH" }; - - defaultSeekerLockMode = "LOAL"; - seekerLockModes[] = { "LOAL", "LOBL" }; - - defaultNavigationType = "Direct"; - navigationTypes[] = { "Direct", "ZeroEffortMiss" }; - - seekLastTargetPos = 1; // seek last target position [if seeker loses LOS of target, continue to last known pos] - seekerAngle = 70; // Angle in front of the missile which can be searched - seekerAccuracy = 1; // seeker accuracy multiplier - - seekerMinRange = 1; - seekerMaxRange = 8000; // Range from the missile which the seeker can visually search - - // Attack profile type selection - defaultAttackProfile = "hellfire"; - attackProfiles[] = {"hellfire", "hellfire_hi", "hellfire_lo"}; - - class navigationStates { - class initial { - transitionCondition = "ace_hellfire_fnc_midCourseTransition"; - navigationType = "Direct"; - }; - class terminal { - transitionCondition = ""; - navigationType = "ZeroEffortMiss"; - }; - // transitions from initial -> termimal - states[] = {"initial", "terminal"}; - }; - }; + ACE_MISSILE(Hellfire); }; }; diff --git a/addons/missileGuidanceCompat/patchRHSAFRF/config.cpp b/addons/missileGuidanceCompat/patchRHSAFRF/config.cpp index c64f53e8..cf88c0db 100644 --- a/addons/missileGuidanceCompat/patchRHSAFRF/config.cpp +++ b/addons/missileGuidanceCompat/patchRHSAFRF/config.cpp @@ -15,6 +15,7 @@ class CfgPatches { }; }; +#include "../CfgMissileTypesWarsaw.hpp" class CfgAmmo { class Missile_AGM_01_F; @@ -32,15 +33,15 @@ class CfgAmmo { }; class rhs_ammo_9k32: M_Titan_AA { maneuvrability = 0; - #include "../CfgMissileStrela.hpp" + ACE_MISSILE(Strela); }; class rhs_ammo_9k38: rhs_ammo_9k32 { maneuvrability = 0; - #include "../CfgMissileIgla.hpp" + ACE_MISSILE(Igla); }; class rhs_ammo_9m114: rhs_ammo_atgmBase_base { maneuvrability = 0; - #include "../CfgMissileShturm.hpp" + ACE_MISSILE(Shturm); class EventHandlers: EventHandlers { class RHS_Guidance {}; }; @@ -69,7 +70,7 @@ class CfgAmmo { }; class rhs_ammo_9m120: rhs_ammo_atgmBase_base { maneuvrability = 0; - #include "../CfgMissileAtaka.hpp" + ACE_MISSILE(Ataka); class EventHandlers: EventHandlers { class RHS_Guidance {}; }; @@ -92,7 +93,7 @@ class CfgAmmo { }; class rhs_ammo_9m127: rhs_ammo_9m120 { maneuvrability = 0; - #include "../CfgMissileVikhr.hpp" + ACE_MISSILE(Vikhr); class EventHandlers: EventHandlers { class RHS_Guidance {}; }; @@ -104,7 +105,7 @@ class CfgAmmo { }; class rhs_ammo_r27t: rhs_ammo_r27_base { maneuvrability = 0; - #include "../CfgMissileVympel.hpp" + ACE_MISSILE(Vympel); }; class rhs_ammo_r27et: rhs_ammo_r27t { class ace_missileguidance: ace_missileguidance { @@ -113,7 +114,7 @@ class CfgAmmo { }; class rhs_ammo_r60_base: Missile_AA_04_F { maneuvrability = 0; - #include "../CfgMissileMolniya.hpp" + ACE_MISSILE(Molniya); }; class rhs_ammo_r60: rhs_ammo_r60_base { class ace_missileguidance: ace_missileguidance { @@ -128,7 +129,7 @@ class CfgAmmo { }; class rhs_ammo_r73: Missile_AA_04_F { maneuvrability = 0; - #include "../CfgMissileR73.hpp" + ACE_MISSILE(R73); }; class rhs_ammo_r73m: rhs_ammo_r73 { class ace_missileguidance: ace_missileguidance { @@ -147,7 +148,7 @@ class CfgAmmo { }; class rhs_ammo_r77: rhs_ammo_r73 { maneuvrability = 0; - #include "../CfgMissileR77.hpp" + ACE_MISSILE(R77); }; class rhs_ammo_r77m: rhs_ammo_r77 { class ace_missileguidance: ace_missileguidance { @@ -156,7 +157,7 @@ class CfgAmmo { }; class rhs_ammo_kh25_base: Missile_AGM_01_F { maneuvrability = 0; - #include "../CfgMissileKH25.hpp" + ACE_MISSILE(KH25); }; class rhs_ammo_kh25: rhs_ammo_kh25_base { class ace_missileguidance: ace_missileguidance { @@ -187,7 +188,7 @@ class CfgAmmo { }; class rhs_ammo_kh29_base: Missile_AGM_02_F { maneuvrability = 0; - #include "../CfgMissileKH29.hpp" + ACE_MISSILE(KH29); }; class rhs_ammo_kh29l: rhs_ammo_kh29_base { class ace_missileguidance: ace_missileguidance { @@ -216,7 +217,7 @@ class CfgAmmo { }; class rhs_ammo_9m14: rhs_ammo_atgmBase_base { maneuvrability = 0; - #include "../CfgMissileMalyutka.hpp" + ACE_MISSILE(Malyutka); class EventHandlers: EventHandlers { class RHS_Guidance {}; }; @@ -233,7 +234,7 @@ class CfgAmmo { }; class rhs_ammo_9m17: rhs_ammo_atgmBase_base { maneuvrability = 0; - #include "../CfgMissileFleyta.hpp" + ACE_MISSILE(Fleyta); class EventHandlers: EventHandlers { class RHS_Guidance {}; }; @@ -247,7 +248,7 @@ class CfgAmmo { }; class rhs_ammo_9m112: rhs_ammo_atgmCore_base { maneuvrability = 0; - #include "../CfgMissileRefleks.hpp" + ACE_MISSILE(Refleks); class EventHandlers: EventHandlers { class RHS_Guidance {}; }; @@ -269,11 +270,11 @@ class CfgAmmo { }; class rhs_ammo_9m128: rhs_ammo_atgmCore_base { maneuvrability = 0; - #include "../CfgMissileKobra.hpp" + ACE_MISSILE(Kobra); }; class rhs_ammo_9m111: rhs_ammo_atgmBase_base { maneuvrability = 0; - #include "../CfgMissileFagot.hpp" + ACE_MISSILE(Fagot); class EventHandlers: EventHandlers { class RHS_Guidance {}; }; @@ -286,7 +287,7 @@ class CfgAmmo { }; class rhs_ammo_9m113: rhs_ammo_atgmBase_base { maneuvrability = 0; - #include "../CfgMissileKonkurs.hpp" + ACE_MISSILE(Konkurs); class EventHandlers: EventHandlers { class RHS_Guidance {}; }; @@ -298,7 +299,7 @@ class CfgAmmo { }; class rhs_ammo_9m117: rhs_ammo_atgmCore_base { maneuvrability = 0; - #include "../CfgMissileBastion.hpp" + ACE_MISSILE(Bastion); class EventHandlers: EventHandlers { class RHS_Guidance {}; }; @@ -322,7 +323,7 @@ class CfgAmmo { }; class rhs_ammo_9m119: rhs_ammo_atgmCore_base { maneuvrability = 0; - #include "../CfgMissileRefleks.hpp" + ACE_MISSILE(Refleks); class EventHandlers: EventHandlers { class RHS_Guidance {}; }; @@ -339,7 +340,7 @@ class CfgAmmo { }; class rhs_ammo_9m115: rhs_ammo_9m119 { maneuvrability = 0; - #include "../CfgMissileMetis.hpp" + ACE_MISSILE(Metis); class EventHandlers: EventHandlers { class RHS_Guidance {}; }; @@ -363,14 +364,14 @@ class CfgAmmo { }; class rhs_ammo_9m133f: rhs_ammo_9m131f { maneuvrability = 0; - #include "../CfgMissileKonkurs.hpp" + ACE_MISSILE(Konkurs); class EventHandlers: EventHandlers { class RHS_Guidance {}; }; }; class rhs_ammo_9m133: rhs_ammo_atgmBase_base { maneuvrability = 0; - #include "../CfgMissileKonkurs.hpp" + ACE_MISSILE(Konkurs); class EventHandlers: EventHandlers { class RHS_Guidance {}; }; @@ -387,7 +388,7 @@ class CfgAmmo { }; class rhs_ammo_3m7: rhs_ammo_atgmBase_base { maneuvrability = 0; - #include "../CfgMissileDrakon.hpp" + ACE_MISSILE(Drakon); class EventHandlers: EventHandlers { class RHS_Guidance {}; }; diff --git a/addons/missileGuidanceCompat/script_component.hpp b/addons/missileGuidanceCompat/script_component.hpp index c9b7f00c..0c7f26ea 100644 --- a/addons/missileGuidanceCompat/script_component.hpp +++ b/addons/missileGuidanceCompat/script_component.hpp @@ -6,4 +6,5 @@ // #define ENABLE_PERFORMANCE_COUNTERS #include "\z\potato\addons\core\script_macros.hpp" +#include "script_macros.hpp" diff --git a/addons/missileGuidanceCompat/script_macros.hpp b/addons/missileGuidanceCompat/script_macros.hpp new file mode 100644 index 00000000..a2b6c703 --- /dev/null +++ b/addons/missileGuidanceCompat/script_macros.hpp @@ -0,0 +1,2 @@ +#define SCORE_2(a,b) a##_##b +#define ACE_MISSILE(missile) class ace_missileguidance: ACEGVAR(missileguidance,SCORE_2(type,missile)) { enabled = 1; } \ No newline at end of file diff --git a/addons/settings/XEH_preInit.sqf b/addons/settings/XEH_preInit.sqf index c625bc47..2d9dba4d 100644 --- a/addons/settings/XEH_preInit.sqf +++ b/addons/settings/XEH_preInit.sqf @@ -37,7 +37,7 @@ if (isServer) then { } forEach _settings; // report specific medical settings - private _log = format ["[AAA=%1] [aDmgPass=%2]", AAA_VAR_MOD_ENABLED, ace_medical_engine_damagePassThroughEffect toFixed 2]; + private _log = format ["[AMA=%1] [aDmgPass=%2]", potato_armor_modifier_ace, ace_medical_engine_damagePassThroughEffect toFixed 2]; ["potato_adminMsg", [_log, "Mission"]] call CBA_fnc_globalEvent; }, [_settings], 4] call CBA_fnc_waitAndExecute; From 5fea95d92366df67728ae2cb90197863dc1c73e2 Mon Sep 17 00:00:00 2001 From: lambdatiger Date: Thu, 19 Sep 2024 23:02:51 -0500 Subject: [PATCH 15/18] Revert "Merge remote-tracking branch 'upstream/master' into vehicleBoxes" This reverts commit 0505bae2576e644cd204c55696e1bdb97f55780b. --- addons/armor_modifier_ace/$PBOPREFIX$ | 1 - .../armor_modifier_ace/CfgEventHandlers.hpp | 17 - addons/armor_modifier_ace/LICENSE | 19 - .../armor_modifier_ace/LICENSE_FOR_ACE_CODE | 379 -------------- addons/armor_modifier_ace/XEH_PREP.hpp | 4 - addons/armor_modifier_ace/XEH_postInit.sqf | 38 -- addons/armor_modifier_ace/XEH_preInit.sqf | 12 - addons/armor_modifier_ace/XEH_preStart.sqf | 3 - addons/armor_modifier_ace/config.cpp | 22 - .../functions/fnc_handleDamage.sqf | 257 ---------- .../functions/fnc_resolveHitPoints.sqf | 37 -- .../functions/fnc_setClassArmor.sqf | 39 -- .../functions/fnc_setUnitArmor.sqf | 40 -- .../armor_modifier_ace/initSettings.inc.sqf | 61 --- .../armor_modifier_ace/script_component.hpp | 38 -- addons/assignGear/XEH_PREP.hpp | 5 +- .../functions/fnc_assignGearSupplyBox.sqf | 2 - .../functions/fnc_assignGearVehicle.sqf | 259 +++++++++- .../fnc_assignGearVehicle_asBoxes.sqf | 214 -------- .../fnc_setBoxContentsFromConfig.sqf | 1 + addons/cswCompat/patchGM/ACE_CSW_Groups.hpp | 26 - addons/cswCompat/patchGM/CfgMagazines.hpp | 50 -- addons/cswCompat/patchGM/CfgVehicles.hpp | 264 ---------- addons/cswCompat/patchGM/CfgWeapons.hpp | 98 ---- addons/cswCompat/patchGM/config.cpp | 41 -- addons/miscFixes/XEH_preInit.sqf | 43 -- addons/missileGuidanceCompat/CfgAmmo.hpp | 478 +++++++++++++++++- addons/missileGuidanceCompat/CfgMagazines.hpp | 7 + .../missileGuidanceCompat/CfgMissileAtaka.hpp | 38 ++ .../CfgMissileBastion.hpp | 39 ++ .../CfgMissileDrakon.hpp | 39 ++ .../missileGuidanceCompat/CfgMissileFagot.hpp | 39 ++ .../CfgMissileFalanga.hpp | 37 ++ .../CfgMissileFleyta.hpp | 37 ++ .../missileGuidanceCompat/CfgMissileHOT.hpp | 38 ++ .../missileGuidanceCompat/CfgMissileIgla.hpp | 32 ++ .../missileGuidanceCompat/CfgMissileKH25.hpp | 27 + .../missileGuidanceCompat/CfgMissileKH29.hpp | 27 + .../missileGuidanceCompat/CfgMissileKobra.hpp | 39 ++ .../CfgMissileKonkurs.hpp | 38 ++ .../CfgMissileKornet.hpp | 39 ++ .../CfgMissileMalyutka.hpp | 37 ++ .../missileGuidanceCompat/CfgMissileMetis.hpp | 38 ++ .../missileGuidanceCompat/CfgMissileMilan.hpp | 38 ++ .../CfgMissileMolniya.hpp | 32 ++ .../missileGuidanceCompat/CfgMissileR73.hpp | 32 ++ .../missileGuidanceCompat/CfgMissileR77.hpp | 38 ++ .../CfgMissileRefleks.hpp | 39 ++ .../CfgMissileShturm.hpp | 38 ++ .../CfgMissileStrela.hpp | 32 ++ .../CfgMissileTypesNato.hpp | 20 - .../CfgMissileTypesWarsaw.hpp | 25 - .../missileGuidanceCompat/CfgMissileVikhr.hpp | 34 ++ .../CfgMissileVympel.hpp | 32 ++ addons/missileGuidanceCompat/config.cpp | 5 +- .../missileGuidanceCompat/patchCUP/config.cpp | 172 ------- .../missileGuidanceCompat/patchGM/config.cpp | 51 +- .../patchMELB/config.cpp | 44 +- .../patchRHSAFRF/config.cpp | 47 +- .../script_component.hpp | 1 - .../missileGuidanceCompat/script_macros.hpp | 2 - addons/settings/XEH_preInit.sqf | 2 +- 62 files changed, 1710 insertions(+), 1973 deletions(-) delete mode 100644 addons/armor_modifier_ace/$PBOPREFIX$ delete mode 100644 addons/armor_modifier_ace/CfgEventHandlers.hpp delete mode 100644 addons/armor_modifier_ace/LICENSE delete mode 100644 addons/armor_modifier_ace/LICENSE_FOR_ACE_CODE delete mode 100644 addons/armor_modifier_ace/XEH_PREP.hpp delete mode 100644 addons/armor_modifier_ace/XEH_postInit.sqf delete mode 100644 addons/armor_modifier_ace/XEH_preInit.sqf delete mode 100644 addons/armor_modifier_ace/XEH_preStart.sqf delete mode 100644 addons/armor_modifier_ace/config.cpp delete mode 100644 addons/armor_modifier_ace/functions/fnc_handleDamage.sqf delete mode 100644 addons/armor_modifier_ace/functions/fnc_resolveHitPoints.sqf delete mode 100644 addons/armor_modifier_ace/functions/fnc_setClassArmor.sqf delete mode 100644 addons/armor_modifier_ace/functions/fnc_setUnitArmor.sqf delete mode 100644 addons/armor_modifier_ace/initSettings.inc.sqf delete mode 100644 addons/armor_modifier_ace/script_component.hpp delete mode 100644 addons/assignGear/functions/fnc_assignGearVehicle_asBoxes.sqf delete mode 100644 addons/cswCompat/patchGM/ACE_CSW_Groups.hpp delete mode 100644 addons/cswCompat/patchGM/CfgMagazines.hpp delete mode 100644 addons/cswCompat/patchGM/CfgVehicles.hpp delete mode 100644 addons/cswCompat/patchGM/CfgWeapons.hpp delete mode 100644 addons/cswCompat/patchGM/config.cpp create mode 100644 addons/missileGuidanceCompat/CfgMagazines.hpp create mode 100644 addons/missileGuidanceCompat/CfgMissileAtaka.hpp create mode 100644 addons/missileGuidanceCompat/CfgMissileBastion.hpp create mode 100644 addons/missileGuidanceCompat/CfgMissileDrakon.hpp create mode 100644 addons/missileGuidanceCompat/CfgMissileFagot.hpp create mode 100644 addons/missileGuidanceCompat/CfgMissileFalanga.hpp create mode 100644 addons/missileGuidanceCompat/CfgMissileFleyta.hpp create mode 100644 addons/missileGuidanceCompat/CfgMissileHOT.hpp create mode 100644 addons/missileGuidanceCompat/CfgMissileIgla.hpp create mode 100644 addons/missileGuidanceCompat/CfgMissileKH25.hpp create mode 100644 addons/missileGuidanceCompat/CfgMissileKH29.hpp create mode 100644 addons/missileGuidanceCompat/CfgMissileKobra.hpp create mode 100644 addons/missileGuidanceCompat/CfgMissileKonkurs.hpp create mode 100644 addons/missileGuidanceCompat/CfgMissileKornet.hpp create mode 100644 addons/missileGuidanceCompat/CfgMissileMalyutka.hpp create mode 100644 addons/missileGuidanceCompat/CfgMissileMetis.hpp create mode 100644 addons/missileGuidanceCompat/CfgMissileMilan.hpp create mode 100644 addons/missileGuidanceCompat/CfgMissileMolniya.hpp create mode 100644 addons/missileGuidanceCompat/CfgMissileR73.hpp create mode 100644 addons/missileGuidanceCompat/CfgMissileR77.hpp create mode 100644 addons/missileGuidanceCompat/CfgMissileRefleks.hpp create mode 100644 addons/missileGuidanceCompat/CfgMissileShturm.hpp create mode 100644 addons/missileGuidanceCompat/CfgMissileStrela.hpp delete mode 100644 addons/missileGuidanceCompat/CfgMissileTypesNato.hpp delete mode 100644 addons/missileGuidanceCompat/CfgMissileTypesWarsaw.hpp create mode 100644 addons/missileGuidanceCompat/CfgMissileVikhr.hpp create mode 100644 addons/missileGuidanceCompat/CfgMissileVympel.hpp delete mode 100644 addons/missileGuidanceCompat/patchCUP/config.cpp delete mode 100644 addons/missileGuidanceCompat/script_macros.hpp diff --git a/addons/armor_modifier_ace/$PBOPREFIX$ b/addons/armor_modifier_ace/$PBOPREFIX$ deleted file mode 100644 index eaf793ab..00000000 --- a/addons/armor_modifier_ace/$PBOPREFIX$ +++ /dev/null @@ -1 +0,0 @@ -z\potato\addons\armor_modifier_ace diff --git a/addons/armor_modifier_ace/CfgEventHandlers.hpp b/addons/armor_modifier_ace/CfgEventHandlers.hpp deleted file mode 100644 index f6503c24..00000000 --- a/addons/armor_modifier_ace/CfgEventHandlers.hpp +++ /dev/null @@ -1,17 +0,0 @@ -class Extended_PreStart_EventHandlers { - class ADDON { - init = QUOTE(call COMPILE_SCRIPT(XEH_preStart)); - }; -}; - -class Extended_PreInit_EventHandlers { - class ADDON { - init = QUOTE(call COMPILE_SCRIPT(XEH_preInit)); - }; -}; - -class Extended_PostInit_EventHandlers { - class ADDON { - init = QUOTE(call COMPILE_SCRIPT(XEH_postInit)); - }; -}; diff --git a/addons/armor_modifier_ace/LICENSE b/addons/armor_modifier_ace/LICENSE deleted file mode 100644 index 6f4c47cd..00000000 --- a/addons/armor_modifier_ace/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2023 johnb432 - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE -OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/addons/armor_modifier_ace/LICENSE_FOR_ACE_CODE b/addons/armor_modifier_ace/LICENSE_FOR_ACE_CODE deleted file mode 100644 index 50be717e..00000000 --- a/addons/armor_modifier_ace/LICENSE_FOR_ACE_CODE +++ /dev/null @@ -1,379 +0,0 @@ -This license only applies to the file "fnc_handleDamage.sqf": - -============================================================================ - -Copyright (C) 2015 Felix "KoffeinFlummi" Wiegand - -This program is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License along -with this program; if not, write to the Free Software Foundation, Inc., -51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - -Additionally to the conditions of the GPL, you are granted the right to -redistribute any combination of the .pbo-files of the finished product -without having to share your source code, as long as you do not modify the -source code of the individual modules. - -When publishing a derivative of this product you may not use a name that -might create the impression that your version is an official release. - -Some folders of this project may contain a separate LICENSE file. Should -that be the case, everything in that folder and all subfolders is subject -to that license instead. - - - ARMA PUBLIC LICENSE (\addons\apl) - - CreativeCommons Attributions 3.0 (\addons\fastroping\data\sounds) - -============================================================================ - Full GNU General Public License Text -============================================================================ - - -GNU GENERAL PUBLIC LICENSE - Version 2, June 1991 - - Copyright (C) 1989, 1991 Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The licenses for most software are designed to take away your -freedom to share and change it. By contrast, the GNU General Public -License is intended to guarantee your freedom to share and change free -software--to make sure the software is free for all its users. This -General Public License applies to most of the Free Software -Foundation's software and to any other program whose authors commit to -using it. (Some other Free Software Foundation software is covered by -the GNU Lesser General Public License instead.) You can apply it to -your programs, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -this service if you wish), that you receive source code or can get it -if you want it, that you can change the software or use pieces of it -in new free programs; and that you know you can do these things. - - To protect your rights, we need to make restrictions that forbid -anyone to deny you these rights or to ask you to surrender the rights. -These restrictions translate to certain responsibilities for you if you -distribute copies of the software, or if you modify it. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must give the recipients all the rights that -you have. You must make sure that they, too, receive or can get the -source code. And you must show them these terms so they know their -rights. - - We protect your rights with two steps: (1) copyright the software, and -(2) offer you this license which gives you legal permission to copy, -distribute and/or modify the software. - - Also, for each author's protection and ours, we want to make certain -that everyone understands that there is no warranty for this free -software. If the software is modified by someone else and passed on, we -want its recipients to know that what they have is not the original, so -that any problems introduced by others will not reflect on the original -authors' reputations. - - Finally, any free program is threatened constantly by software -patents. We wish to avoid the danger that redistributors of a free -program will individually obtain patent licenses, in effect making the -program proprietary. To prevent this, we have made it clear that any -patent must be licensed for everyone's free use or not licensed at all. - - The precise terms and conditions for copying, distribution and -modification follow. - - GNU GENERAL PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - - 0. This License applies to any program or other work which contains -a notice placed by the copyright holder saying it may be distributed -under the terms of this General Public License. The "Program", below, -refers to any such program or work, and a "work based on the Program" -means either the Program or any derivative work under copyright law: -that is to say, a work containing the Program or a portion of it, -either verbatim or with modifications and/or translated into another -language. (Hereinafter, translation is included without limitation in -the term "modification".) Each licensee is addressed as "you". - -Activities other than copying, distribution and modification are not -covered by this License; they are outside its scope. The act of -running the Program is not restricted, and the output from the Program -is covered only if its contents constitute a work based on the -Program (independent of having been made by running the Program). -Whether that is true depends on what the Program does. - - 1. You may copy and distribute verbatim copies of the Program's -source code as you receive it, in any medium, provided that you -conspicuously and appropriately publish on each copy an appropriate -copyright notice and disclaimer of warranty; keep intact all the -notices that refer to this License and to the absence of any warranty; -and give any other recipients of the Program a copy of this License -along with the Program. - -You may charge a fee for the physical act of transferring a copy, and -you may at your option offer warranty protection in exchange for a fee. - - 2. You may modify your copy or copies of the Program or any portion -of it, thus forming a work based on the Program, and copy and -distribute such modifications or work under the terms of Section 1 -above, provided that you also meet all of these conditions: - - a) You must cause the modified files to carry prominent notices - stating that you changed the files and the date of any change. - - b) You must cause any work that you distribute or publish, that in - whole or in part contains or is derived from the Program or any - part thereof, to be licensed as a whole at no charge to all third - parties under the terms of this License. - - c) If the modified program normally reads commands interactively - when run, you must cause it, when started running for such - interactive use in the most ordinary way, to print or display an - announcement including an appropriate copyright notice and a - notice that there is no warranty (or else, saying that you provide - a warranty) and that users may redistribute the program under - these conditions, and telling the user how to view a copy of this - License. (Exception: if the Program itself is interactive but - does not normally print such an announcement, your work based on - the Program is not required to print an announcement.) - -These requirements apply to the modified work as a whole. If -identifiable sections of that work are not derived from the Program, -and can be reasonably considered independent and separate works in -themselves, then this License, and its terms, do not apply to those -sections when you distribute them as separate works. But when you -distribute the same sections as part of a whole which is a work based -on the Program, the distribution of the whole must be on the terms of -this License, whose permissions for other licensees extend to the -entire whole, and thus to each and every part regardless of who wrote it. - -Thus, it is not the intent of this section to claim rights or contest -your rights to work written entirely by you; rather, the intent is to -exercise the right to control the distribution of derivative or -collective works based on the Program. - -In addition, mere aggregation of another work not based on the Program -with the Program (or with a work based on the Program) on a volume of -a storage or distribution medium does not bring the other work under -the scope of this License. - - 3. You may copy and distribute the Program (or a work based on it, -under Section 2) in object code or executable form under the terms of -Sections 1 and 2 above provided that you also do one of the following: - - a) Accompany it with the complete corresponding machine-readable - source code, which must be distributed under the terms of Sections - 1 and 2 above on a medium customarily used for software interchange; or, - - b) Accompany it with a written offer, valid for at least three - years, to give any third party, for a charge no more than your - cost of physically performing source distribution, a complete - machine-readable copy of the corresponding source code, to be - distributed under the terms of Sections 1 and 2 above on a medium - customarily used for software interchange; or, - - c) Accompany it with the information you received as to the offer - to distribute corresponding source code. (This alternative is - allowed only for noncommercial distribution and only if you - received the program in object code or executable form with such - an offer, in accord with Subsection b above.) - -The source code for a work means the preferred form of the work for -making modifications to it. For an executable work, complete source -code means all the source code for all modules it contains, plus any -associated interface definition files, plus the scripts used to -control compilation and installation of the executable. However, as a -special exception, the source code distributed need not include -anything that is normally distributed (in either source or binary -form) with the major components (compiler, kernel, and so on) of the -operating system on which the executable runs, unless that component -itself accompanies the executable. - -If distribution of executable or object code is made by offering -access to copy from a designated place, then offering equivalent -access to copy the source code from the same place counts as -distribution of the source code, even though third parties are not -compelled to copy the source along with the object code. - - 4. You may not copy, modify, sublicense, or distribute the Program -except as expressly provided under this License. Any attempt -otherwise to copy, modify, sublicense or distribute the Program is -void, and will automatically terminate your rights under this License. -However, parties who have received copies, or rights, from you under -this License will not have their licenses terminated so long as such -parties remain in full compliance. - - 5. You are not required to accept this License, since you have not -signed it. However, nothing else grants you permission to modify or -distribute the Program or its derivative works. These actions are -prohibited by law if you do not accept this License. Therefore, by -modifying or distributing the Program (or any work based on the -Program), you indicate your acceptance of this License to do so, and -all its terms and conditions for copying, distributing or modifying -the Program or works based on it. - - 6. Each time you redistribute the Program (or any work based on the -Program), the recipient automatically receives a license from the -original licensor to copy, distribute or modify the Program subject to -these terms and conditions. You may not impose any further -restrictions on the recipients' exercise of the rights granted herein. -You are not responsible for enforcing compliance by third parties to -this License. - - 7. If, as a consequence of a court judgment or allegation of patent -infringement or for any other reason (not limited to patent issues), -conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot -distribute so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you -may not distribute the Program at all. For example, if a patent -license would not permit royalty-free redistribution of the Program by -all those who receive copies directly or indirectly through you, then -the only way you could satisfy both it and this License would be to -refrain entirely from distribution of the Program. - -If any portion of this section is held invalid or unenforceable under -any particular circumstance, the balance of the section is intended to -apply and the section as a whole is intended to apply in other -circumstances. - -It is not the purpose of this section to induce you to infringe any -patents or other property right claims or to contest validity of any -such claims; this section has the sole purpose of protecting the -integrity of the free software distribution system, which is -implemented by public license practices. Many people have made -generous contributions to the wide range of software distributed -through that system in reliance on consistent application of that -system; it is up to the author/donor to decide if he or she is willing -to distribute software through any other system and a licensee cannot -impose that choice. - -This section is intended to make thoroughly clear what is believed to -be a consequence of the rest of this License. - - 8. If the distribution and/or use of the Program is restricted in -certain countries either by patents or by copyrighted interfaces, the -original copyright holder who places the Program under this License -may add an explicit geographical distribution limitation excluding -those countries, so that distribution is permitted only in or among -countries not thus excluded. In such case, this License incorporates -the limitation as if written in the body of this License. - - 9. The Free Software Foundation may publish revised and/or new versions -of the General Public License from time to time. Such new versions will -be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - -Each version is given a distinguishing version number. If the Program -specifies a version number of this License which applies to it and "any -later version", you have the option of following the terms and conditions -either of that version or of any later version published by the Free -Software Foundation. If the Program does not specify a version number of -this License, you may choose any version ever published by the Free Software -Foundation. - - 10. If you wish to incorporate parts of the Program into other free -programs whose distribution conditions are different, write to the author -to ask for permission. For software which is copyrighted by the Free -Software Foundation, write to the Free Software Foundation; we sometimes -make exceptions for this. Our decision will be guided by the two goals -of preserving the free status of all derivatives of our free software and -of promoting the sharing and reuse of software generally. - - NO WARRANTY - - 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY -FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN -OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES -PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED -OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS -TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE -PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, -REPAIR OR CORRECTION. - - 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR -REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, -INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING -OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED -TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY -YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER -PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE -POSSIBILITY OF SUCH DAMAGES. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -convey the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. - - {description} - Copyright (C) {year} {fullname} - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along - with this program; if not, write to the Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - -Also add information on how to contact you by electronic and paper mail. - -If the program is interactive, make it output a short notice like this -when it starts in an interactive mode: - - Gnomovision version 69, Copyright (C) year name of author - Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. - This is free software, and you are welcome to redistribute it - under certain conditions; type `show c' for details. - -The hypothetical commands `show w' and `show c' should show the appropriate -parts of the General Public License. Of course, the commands you use may -be called something other than `show w' and `show c'; they could even be -mouse-clicks or menu items--whatever suits your program. - -You should also get your employer (if you work as a programmer) or your -school, if any, to sign a "copyright disclaimer" for the program, if -necessary. Here is a sample; alter the names: - - Yoyodyne, Inc., hereby disclaims all copyright interest in the program - `Gnomovision' (which makes passes at compilers) written by James Hacker. - - {signature of Ty Coon}, 1 April 1989 - Ty Coon, President of Vice - -This General Public License does not permit incorporating your program into -proprietary programs. If your program is a subroutine library, you may -consider it more useful to permit linking proprietary applications with the -library. If this is what you want to do, use the GNU Lesser General -Public License instead of this License. diff --git a/addons/armor_modifier_ace/XEH_PREP.hpp b/addons/armor_modifier_ace/XEH_PREP.hpp deleted file mode 100644 index b2322204..00000000 --- a/addons/armor_modifier_ace/XEH_PREP.hpp +++ /dev/null @@ -1,4 +0,0 @@ -PREP(handleDamage); -PREP(resolveHitPoints); -PREP(setClassArmor); -PREP(setUnitArmor); \ No newline at end of file diff --git a/addons/armor_modifier_ace/XEH_postInit.sqf b/addons/armor_modifier_ace/XEH_postInit.sqf deleted file mode 100644 index ad446146..00000000 --- a/addons/armor_modifier_ace/XEH_postInit.sqf +++ /dev/null @@ -1,38 +0,0 @@ -#include "script_component.hpp" - -// Call in post init, so that we are sure to overwrite default ACE damage handling and any other mods interfering with ACE medical -["CAManBase", "initPost", { - params ["_unit"]; - - private _ehID = _unit getVariable [QACEGVAR(medical,HandleDamageEHID), -1]; - - // If no EH exists, don't add one - if (_ehID == -1) exitWith {}; - - // Replace existing ace medical damage event handler - _unit removeEventHandler ["HandleDamage", _ehID]; - - _ehID = _unit addEventHandler ["HandleDamage", {[_this] call FUNC(handleDamage)}]; - - _unit setVariable [QACEGVAR(medical,HandleDamageEHID), _ehID]; -}, true, [], true] call CBA_fnc_addClassEventHandler; - -[QGVAR(updateUnitArmor), { - params ["_unit", "_hitPoint", "_armorArray"]; - if (!alive _unit) exitWith {}; - private _newHash = +(_unit getVariable [QGVAR(armorHash), GVAR(defaultArmorHash)]); - {_newHash set [_x, _armorArray]} forEach (_hitPoint call FUNC(resolveHitPoints)); - _unit setVariable [QGVAR(armorHash), _newHash]; -}] call CBA_fnc_addEventHandler; - -[QGVAR(updateClassArmor), { - params ["_class", "_hitPoint", "_armorArray"]; - private _classHashMap = GVAR(classArmorHash) getOrDefaultCall [_class, { - [_class, "init", { - params ["_unit"]; - _unit setVariable [QGVAR(armorHash), GVAR(classArmorHash) getOrDefault [(typeOf _unit), DEFAULT_HASH_SETTINGS]]; - }, false] call CBA_fnc_addClassEventHandler; - +GVAR(defaultArmorHash) - }, true]; - {_classHashMap set [_x, _armorArray]} forEach (_hitPoint call FUNC(resolveHitPoints)); -}] call CBA_fnc_addEventHandler; diff --git a/addons/armor_modifier_ace/XEH_preInit.sqf b/addons/armor_modifier_ace/XEH_preInit.sqf deleted file mode 100644 index a9a106a1..00000000 --- a/addons/armor_modifier_ace/XEH_preInit.sqf +++ /dev/null @@ -1,12 +0,0 @@ -#include "script_component.hpp" - -ADDON = false; - -#include "XEH_PREP.hpp" -GVAR(armorValueHash) = createHashMap; -GVAR(classArmorHash) = createHashMap; -GVAR(defaultArmorHash) = DEFAULT_HASH_SETTINGS; -// CBA Settings -#include "initSettings.inc.sqf" - -ADDON = true; diff --git a/addons/armor_modifier_ace/XEH_preStart.sqf b/addons/armor_modifier_ace/XEH_preStart.sqf deleted file mode 100644 index 02288857..00000000 --- a/addons/armor_modifier_ace/XEH_preStart.sqf +++ /dev/null @@ -1,3 +0,0 @@ -#include "script_component.hpp" - -#include "XEH_PREP.hpp" diff --git a/addons/armor_modifier_ace/config.cpp b/addons/armor_modifier_ace/config.cpp deleted file mode 100644 index d66b108e..00000000 --- a/addons/armor_modifier_ace/config.cpp +++ /dev/null @@ -1,22 +0,0 @@ -#include "script_component.hpp" - -class CfgPatches { - class ADDON { - units[] = {}; - weapons[] = {}; - requiredVersion = REQUIRED_VERSION; - requiredAddons[] = { - "ace_medical_engine" - }; - author = "johnb43"; - authors[] = { - "johnb43", - "Lambda.Tiger" - }; - skipWhenMissingDependencies = 1; - authorUrl = "https://github.com/BourbonWarfare/POTATO"; - VERSION_CONFIG; - }; -}; - -#include "CfgEventHandlers.hpp" diff --git a/addons/armor_modifier_ace/functions/fnc_handleDamage.sqf b/addons/armor_modifier_ace/functions/fnc_handleDamage.sqf deleted file mode 100644 index 1742b869..00000000 --- a/addons/armor_modifier_ace/functions/fnc_handleDamage.sqf +++ /dev/null @@ -1,257 +0,0 @@ -#include "..\script_component.hpp" - -/* - * Author: commy2, kymckay, modified by johnb43 & Lambda.Tiger - * Original: - * HandleDamage EH where wound events are raised based on incoming damage. - * Be aware that for each source of damage, the EH can fire multiple times (once for each hitpoint). - * We store these incoming damages and compare them on our final hitpoint: "ace_hdbracket". - * Added: - * Handling of damage to allow armor modifcation. - * - * Arguments: - * Handle damage EH - * - * Return Value: - * Damage to be inflicted - * - * Public: No - */ - -params ["_args", ["_ignoreAllowDamageACE", false]]; -_args params ["_unit", "_selection", "_damage", "_shooter", "_ammo", "_hitPointIndex", "_instigator", "_hitpoint", "_directHit", "_context"]; - -// HD sometimes triggers for remote units - ignore. -if !(local _unit) exitWith {nil}; - -// Get missing meta info -private _oldDamage = 0; -private _structuralDamage = _context == 0; - -if (_hitPoint isEqualTo "") then { - _hitPoint = "#structural"; - _oldDamage = damage _unit; -} else { - _oldDamage = _unit getHitIndex _hitPointIndex; -}; - -// Damage can be disabled with old variable or via sqf command allowDamage -if !(isDamageAllowed _unit && {_unit getVariable ["ace_medical_allowDamage", true] || _ignoreAllowDamageACE}) exitWith {_oldDamage}; - -private _newDamage = _damage - _oldDamage; - -// _newDamage == 0 happens occasionally for vehiclehit events (see line 80 onwards), just exit early to save some frametime -// context 4 is engine "bleeding". For us, it's just a duplicate event for #structural which we can ignore without any issues -if (_context != 2 && {_context == 4 || _newDamage == 0}) exitWith { - TRACE_4("Skipping engine bleeding or zero damage",_ammo,_newDamage,_directHit,_context); - _oldDamage -}; - -// Get scaled armor value of hitpoint and calculate damage before armor -// We scale using passThrough to handle explosive-resistant armor properly (#9063) -// We need realDamage to determine which limb was hit correctly -[_unit, _hitpoint] call ace_medical_engine_fnc_getHitpointArmor params ["_armor", "_armorScaled"]; -private _realDamage = _newDamage * _armor; -if (!_structuralDamage) then { - private _armorCoef = _armor/_armorScaled; - private _damageCoef = linearConversion [0, 1, ace_medical_engine_damagePassThroughEffect, 1, _armorCoef]; - _newDamage = _newDamage * _damageCoef; -}; -TRACE_6("Received hit",_hitpoint,_ammo,_newDamage,_realDamage,_directHit,_context); - -// Drowning doesn't fire the EH for each hitpoint so the "ace_hdbracket" code never runs -// Damage occurs in consistent increments -if ( - _structuralDamage && - {getOxygenRemaining _unit <= 0.5} && - {_damage isEqualTo (_oldDamage + 0.005)} -) exitWith { - TRACE_5("Drowning",_unit,_shooter,_instigator,_damage,_newDamage); - ["ace_medical_woundReceived", [_unit, [[_newDamage, "Body", _newDamage]], _unit, "drowning"]] call CBA_fnc_localEvent; - - 0 -}; - -// Faster than (vehicle _unit), also handles dead units -private _vehicle = objectParent _unit; -private _inVehicle = !isNull _vehicle; -private _environmentDamage = _ammo == ""; - -// Crashing a vehicle doesn't fire the EH for each hitpoint so the "ace_hdbracket" code never runs -// It does fire the EH multiple times, but this seems to scale with the intensity of the crash -if ( - ace_medical_enableVehicleCrashes && - {_environmentDamage && _inVehicle && _structuralDamage} && - {vectorMagnitude (velocity _vehicle) > 5} - // todo: no way to detect if stationary and another vehicle hits you -) exitWith { - TRACE_5("Crash",_unit,_shooter,_instigator,_damage,_newDamage); - ["ace_medical_woundReceived", [_unit, [[_newDamage, _hitPoint, _newDamage]], _unit, "vehiclecrash"]] call CBA_fnc_localEvent; - - 0 -}; - -// Receiving explosive damage inside a vehicle doesn't trigger for each hitpoint -// This is the case for mines, explosives, artillery, and catasthrophic vehicle explosions -if ( - (!_environmentDamage && _inVehicle && _structuralDamage) && - { - private _ammoCfg = configFile >> "CfgAmmo" >> _ammo; - GET_NUMBER(_ammoCfg >> "explosive",0) > 0 || - {GET_NUMBER(_ammoCfg >> "indirectHit",0) > 0} - } -) exitWith { - TRACE_5("Vehicle hit",_unit,_shooter,_instigator,_damage,_newDamage); - - _unit setVariable ["ace_medical_lastDamageSource", _shooter]; - _unit setVariable ["ace_medical_lastInstigator", _instigator]; - - ["ace_medical_woundReceived", [_unit, [[_newDamage, _hitPoint, _newDamage]], _shooter, "vehiclehit"]] call CBA_fnc_localEvent; - - 0 -}; - -// Get setting for particular unit -private _multiplierArray = _unit getVariable [QGVAR(armorHash), - GVAR(armorValueHash) getOrDefault [ - side _unit, - GVAR(defaultArmorHash) - ] -] getOrDefault [_hitPoint, DEFAULT_SETTINGS, true]; - -private _modifiedNewDamage = _newDamage; -private _modifiedRealDamage = _realDamage; - -// If default settings, we don't need to change anything, so skip calculcations and let ace handle damage -if (_multiplierArray isNotEqualTo DEFAULT_SETTINGS) then { - _multiplierArray params ["_hitPointTimeser", "_armorMin", "_armorMax"]; - - switch (true) do { - case (_armorMin >= 1 && {_armor < _armorMin}): { - // This will decrease damage - _modifiedNewDamage = _newDamage * _armor / _armorMin; - _modifiedRealDamage = _realDamage * _armor / _armorMin; - - TRACE_6("Under min armor",_armor,_armorMin,_newDamage,_modifiedNewDamage,_realDamage,_modifiedRealDamage); - }; - case (_armorMax >= 1 && {_armor > _armorMax}): { - // This will increase damage - _modifiedNewDamage = _newDamage * _armor / _armorMax; - _modifiedRealDamage = _realDamage * _armor / _armorMax; - - TRACE_6("Over max armor",_armor,_armorMax,_newDamage,_modifiedNewDamage,_realDamage,_modifiedRealDamage); - }; - }; - - _modifiedNewDamage = _modifiedNewDamage / _hitPointTimeser; - _modifiedRealDamage = _modifiedRealDamage / _hitPointTimeser; - - TRACE_5("Hitpoint damage multiplied",_armor,_newDamage,_modifiedNewDamage,_realDamage,_modifiedRealDamage); -}; - -// Damages are stored for last iteration of the HandleDamage event (_context == 2) -_unit setVariable [format ["ace_medical_engine_$%1", _hitPoint], [_realDamage, _newDamage, _modifiedRealDamage, _modifiedNewDamage]]; - -// Ref https://community.bistudio.com/wiki/Arma_3:_Event_Handlers#HandleDamage -// Context 2 means this is the last iteration of HandleDamage, so figure out which hitpoint took the most real damage and send wound event -// Don't exit, as the last iteration can be one of the hitpoints that we need to keep _oldDamage for -if (_context == 2) then { - _unit setVariable ["ace_medical_lastDamageSource", _shooter]; - _unit setVariable ["ace_medical_lastInstigator", _instigator]; - - private _damageStructural = _unit getVariable ["ace_medical_engine_$#structural", [0,0,0,0]]; - - // --- Head - private _damageHead = [ - _unit getVariable ["ace_medical_engine_$HitFace", [0,0,0,0]], - _unit getVariable ["ace_medical_engine_$HitNeck", [0,0,0,0]], - _unit getVariable ["ace_medical_engine_$HitHead", [0,0,0,0]] - ]; - _damageHead sort false; - _damageHead = _damageHead select 0; - - // --- Body - private _damageBody = [ - _unit getVariable ["ace_medical_engine_$HitPelvis", [0,0,0,0]], - _unit getVariable ["ace_medical_engine_$HitAbdomen", [0,0,0,0]], - _unit getVariable ["ace_medical_engine_$HitDiaphragm", [0,0,0,0]], - _unit getVariable ["ace_medical_engine_$HitChest", [0,0,0,0]] - // HitBody removed as it's a placeholder hitpoint and the high armor value (1000) throws the calculations off - ]; - _damageBody sort false; - _damageBody = _damageBody select 0; - - // --- Arms and Legs - private _damageLeftArm = _unit getVariable ["ace_medical_engine_$HitLeftArm", [0,0,0,0]]; - private _damageRightArm = _unit getVariable ["ace_medical_engine_$HitRightArm", [0,0,0,0]]; - private _damageLeftLeg = _unit getVariable ["ace_medical_engine_$HitLeftLeg", [0,0,0,0]]; - private _damageRightLeg = _unit getVariable ["ace_medical_engine_$HitRightLeg", [0,0,0,0]]; - - // Find hit point that received the maxium damage - // Priority used for sorting if incoming damage is equal - private _allDamages = [ - // Real damage (ignoring armor), Actual damage (with armor), Real damage modified (ignoring armor), Modified damage (with armor) - [_damageHead select 0, PRIORITY_HEAD, _damageHead select 1, "Head", _damageHead param [2, _damageHead select 0], _damageHead param [3, _damageHead select 1]], - [_damageBody select 0, PRIORITY_BODY, _damageBody select 1, "Body", _damageBody param [2, _damageBody select 0], _damageBody param [3, _damageBody select 1]], - [_damageLeftArm select 0, PRIORITY_LEFT_ARM, _damageLeftArm select 1, "LeftArm", _damageLeftArm param [2, _damageLeftArm select 0], _damageLeftArm param [3, _damageLeftArm select 1]], - [_damageRightArm select 0, PRIORITY_RIGHT_ARM, _damageRightArm select 1, "RightArm", _damageRightArm param [2, _damageRightArm select 0], _damageRightArm param [3, _damageRightArm select 1]], - [_damageLeftLeg select 0, PRIORITY_LEFT_LEG, _damageLeftLeg select 1, "LeftLeg", _damageLeftLeg param [2, _damageLeftLeg select 0], _damageLeftLeg param [3, _damageLeftLeg select 1]], - [_damageRightLeg select 0, PRIORITY_RIGHT_LEG, _damageRightLeg select 1, "RightLeg", _damageRightLeg param [2, _damageRightLeg select 0], _damageRightLeg param [3, _damageRightLeg select 1]], - [_damageStructural select 0, PRIORITY_STRUCTURAL, _damageStructural select 1, "#structural", _damageStructural param [2, _damageStructural select 0], _damageStructural param [3, _damageStructural select 1]] - ]; - TRACE_2("incoming",_allDamages,_damageStructural); - - _allDamages sort false; - // Use modified damages instead of initial ones - _allDamages = _allDamages apply {[_x select 5, _x select 3, _x select 4]}; - - // Environmental damage sources all have empty ammo string - // No explicit source given, we infer from differences between them - if (_environmentDamage) then { - // Any collision with terrain/vehicle/object has a shooter - // Check this first because burning can happen at any velocity - if !(isNull _shooter) then { - /* - If shooter != unit then they hit unit, otherwise it could be: - - Unit hitting anything at speed - - An empty vehicle hitting unit - - A physX object hitting unit - Assume fall damage for downward velocity because it's most common - */ - if (_shooter == _unit && {(velocity _unit select 2) < -2}) then { - _ammo = "falling"; - TRACE_5("Fall",_unit,_shooter,_instigator,_damage,_allDamages); - } else { - _ammo = "collision"; - TRACE_5("Collision",_unit,_shooter,_instigator,_damage,_allDamages); - }; - } else { - // Anything else is almost guaranteed to be fire damage - _ammo = "fire"; - TRACE_5("Fire Damage",_unit,_shooter,_instigator,_damage,_allDamages); - }; - }; - - // No wounds for minor damage - // TODO check if this needs to be changed for burning damage (occurs as lots of small events that we add together) - if ((_allDamages select 0 select 0) > 1E-3) then { - TRACE_1("received",_allDamages); - ["ace_medical_woundReceived", [_unit, _allDamages, _shooter, _ammo]] call CBA_fnc_localEvent; - }; - - // Clear stored damages otherwise they will influence future damage events - // (aka wounds will pile onto the historically most damaged hitpoint) - { - _unit setVariable [_x, nil]; - } forEach [ - "ace_medical_engine_$HitFace","ace_medical_engine_$HitNeck","ace_medical_engine_$HitHead", - "ace_medical_engine_$HitPelvis","ace_medical_engine_$HitAbdomen","ace_medical_engine_$HitDiaphragm","ace_medical_engine_$HitChest","ace_medical_engine_$HitBody", - "ace_medical_engine_$HitLeftArm","ace_medical_engine_$HitRightArm","ace_medical_engine_$HitLeftLeg","ace_medical_engine_$HitRightLeg", - "ace_medical_engine_$#structural" - ]; -}; - -// Engine damage to these hitpoints controls blood visuals, limping, weapon sway -// Handled in fnc_damageBodyPart, persist here -// For all other hitpoints, we store our own damage values, so engine damage is unnecessary -[0, _oldDamage] select (_hitPoint in ["hithead", "hitbody", "hithands", "hitlegs"]) diff --git a/addons/armor_modifier_ace/functions/fnc_resolveHitPoints.sqf b/addons/armor_modifier_ace/functions/fnc_resolveHitPoints.sqf deleted file mode 100644 index cd6ceb21..00000000 --- a/addons/armor_modifier_ace/functions/fnc_resolveHitPoints.sqf +++ /dev/null @@ -1,37 +0,0 @@ -#include "../script_component.hpp" -/* - * Author: Lambda.Tiger - * Sets the armor value for a specific class. - * - * Arguments: - * 0: Hit point to resolve to one or more hitpoints - * - * Return Value: - * Array of hitpoints - * - * Public: Yes - */ -params [["_hitPoint", "", [""]]]; - -_hitPoint = toLowerANSI _hitPoint; - -switch (_hitPoint) do { - case "ama_hitbody": { - ["hitabdomen", "hitdiaphragm", "hitchest", "hitpelvis"] - }; - case "ama_hittorso": { - ["hitabdomen", "hitdiaphragm", "hitchest"] - }; - case "ama_hitarms": { - ["hitleftarm", "hitrightarm"] - }; - case "ama_hitlegs": { - ["hitleftleg", "hitrightleg"] - }; - case "ama_hitlimbs": { - ["hitleftarm", "hitrightarm", "hitleftleg", "hitrightleg"] - }; - default { - [_hitPoint] - }; -} diff --git a/addons/armor_modifier_ace/functions/fnc_setClassArmor.sqf b/addons/armor_modifier_ace/functions/fnc_setClassArmor.sqf deleted file mode 100644 index 5d60c312..00000000 --- a/addons/armor_modifier_ace/functions/fnc_setClassArmor.sqf +++ /dev/null @@ -1,39 +0,0 @@ -#include "..\script_component.hpp" -/* - * Author: Lambda.Tiger - * Sets the armor value for a specific class. This is not retroactive or inherited. - * - * Arguments: - * 0: Unit classname to set hit point armor values - * 1: Hit point to apply armor value to - * 2: Armor array in format [multiplier, minimum, maximum] - * - * Return Value: - * None - * - * Example: - * [typeOf player, "hitFace", [1, 2, 2]] call potato_armor_modifier_ace_fnc_setClassArmor; - * [typeOf player, "ama_hitTorso", [1, 2, 2]] call potato_armor_modifier_ace_fnc_setClassArmor; - * - * Public: Yes - */ -params [ - ["_classname", "", [""]], - ["_hitPoint", "", [""]], - ["_armorArray", [1, 0, 0], [[]], [3]] -]; - -_hitPoint = toLowerANSI _hitPoint; - -if (_classname == "") exitWith { - ["No classname given",2] call ace_common_fnc_displayTextStructured; -}; -if (_hitPoint == "") exitWith { - ["No hitpoint given",2] call ace_common_fnc_displayTextStructured; -}; -if (false in (_armorArray apply {_x isEqualType 0})) exitWith { - [format ["Invalid format for _armorArray: %1", _armorArray],2] call ace_common_fnc_displayTextStructured; -}; - -_this set [1, _hitPoint]; -[QGVAR(updateClassArmor), _this] call CBA_fnc_globalEventJIP; diff --git a/addons/armor_modifier_ace/functions/fnc_setUnitArmor.sqf b/addons/armor_modifier_ace/functions/fnc_setUnitArmor.sqf deleted file mode 100644 index 4fd160f6..00000000 --- a/addons/armor_modifier_ace/functions/fnc_setUnitArmor.sqf +++ /dev/null @@ -1,40 +0,0 @@ -#include "..\script_component.hpp" -/* - * Author: Lambda.Tiger - * Sets the armor value for a specific unit. - * - * Arguments: - * 0: Unit to set hit point armor values - * 1: Hit point to apply armor value to - * 2: Armor array in format [multiplier, minimum, maximum] - * - * Return Value: - * None - * - * Example: - * [cursorObject, "hitFace", [1, 2, 2]] call potato_armor_modifier_ace_fnc_setUnitArmor; - * [player, "ama_hitTorso", [1, 2, 2]] call potato_armor_modifier_ace_fnc_setUnitArmor; - * - * Public: Yes - */ -params [ - ["_unit", objNull, [objNull]], - ["_hitPoint", "", [""]], - ["_armorArray", [1, 0, 0], [[]], [3]] -]; - -_hitPoint = toLowerANSI _hitPoint; - -if (isNull _unit) exitWith { - ["Null unit given",2] call ace_common_fnc_displayTextStructured; -}; -if (_hitPoint == "") exitWith { - ["No hitpoint given",2] call ace_common_fnc_displayTextStructured; -}; -if (false in (_armorArray apply {_x isEqualType 0})) exitWith { - [format ["Invalid format for _armorArray: %1", _armorArray],2] call ace_common_fnc_displayTextStructured; -}; - -_this set [1, _hitPoint]; -private _jipID = [QGVAR(updateUnitArmor), _this] call CBA_fnc_globalEventJIP; -[_jipID, _unit] call CBA_fnc_removeGlobalEventJIP; diff --git a/addons/armor_modifier_ace/initSettings.inc.sqf b/addons/armor_modifier_ace/initSettings.inc.sqf deleted file mode 100644 index 6a152ec3..00000000 --- a/addons/armor_modifier_ace/initSettings.inc.sqf +++ /dev/null @@ -1,61 +0,0 @@ -//#pragma hemtt suppress command_case file -#define HITPOINT_SETTINGS_FUNCTION(HITPOINT,SIDE_CMD) {\ - private _newSettings = parseSimpleArray _this;\ - private _parsedSettings = [];\ - \ - {\ - if (_x isEqualType 0) then {\ - _parsedSettings pushBack (_x max (MINIMUM_SETTINGS select _forEachIndex));\ - } else {\ - _parsedSettings pushBack (DEFAULT_SETTINGS select _forEachIndex);\ - };\ - } forEach _newSettings;\ - \ - if (_parsedSettings isNotEqualTo _newSettings) then {\ - [ARR_2("A setting was set too low or otherwise incorrectly, reverting to default setting.",3)] call ace_common_fnc_displayTextStructured;\ - };\ - \ - private _hitPointHashMap = GVAR(armorValueHash) getOrDefault [SIDE_CMD, createHashMap, true];\ - switch (QUOTE(HITPOINT)) do {\ - case QUOTE(torso): {\ - _hitPointHashMap set ["hitabdomen", _parsedSettings];\ - _hitPointHashMap set ["hitdiaphragm", _parsedSettings];\ - _hitPointHashMap set ["hitchest", _parsedSettings];\ - };\ - case QUOTE(arms): {\ - _hitPointHashMap set ["hitleftarm", _parsedSettings];\ - _hitPointHashMap set ["hitrightarm", _parsedSettings];\ - };\ - case QUOTE(legs): {\ - _hitPointHashMap set ["hitleftleg", _parsedSettings];\ - _hitPointHashMap set ["hitrightleg", _parsedSettings];\ - };\ - default {\ - _hitPointHashMap set [FORMAT_1("hit%1",QUOTE(HITPOINT)), _parsedSettings];\ - };\ - };\ -} - -#define HITPOINT_SETTINGS_SIDE(TYPE,SIDE_CMD,HITPOINT,TEXT,DEFAULT_ARRAY)\ -[\ - QGVAR(DOUBLES(TYPE,HITPOINT)),\ - "EDITBOX",\ - [TEXT, "Allows the tuning the effectiveness of groups of armor hitpoints.\n[hitpoint multiplier, minimum armor, maximum armor]\nIf minimum or maximum armor value is below 1, they don't take effect."],\ - [COMPONENT_NAME, FORMAT_1("Armor modifiers - %1",QUOTE(TYPE))],\ - QUOTE(DEFAULT_ARRAY),\ - true,\ - HITPOINT_SETTINGS_FUNCTION(HITPOINT,SIDE_CMD)\ -] call CBA_fnc_addSetting - -#define HITPOINT_CHECK_SETTING_SIDE(OBJECT,SIDE_CMD) HITPOINT_SETTINGS_SIDE(OBJECT,SIDE_CMD,head,FORMAT_1("%1 hitpoint damage reduction - head",QUOTE(OBJECT)),ARR_3([1,7,7]));\ -HITPOINT_SETTINGS_SIDE(OBJECT,SIDE_CMD,face,FORMAT_1("%1 hitpoint damage reduction - face",QUOTE(OBJECT)),ARR_3([1,0,1]));\ -HITPOINT_SETTINGS_SIDE(OBJECT,SIDE_CMD,neck,FORMAT_1("%1 hitpoint damage reduction - neck",QUOTE(OBJECT)),ARR_3([1,0,1]));\ -HITPOINT_SETTINGS_SIDE(OBJECT,SIDE_CMD,torso,FORMAT_1("%1 hitpoint damage reduction - torso",QUOTE(OBJECT)),ARR_3([1,14,14]));\ -HITPOINT_SETTINGS_SIDE(OBJECT,SIDE_CMD,pelvis,FORMAT_1("%1 hitpoint damage reduction - pelvis",QUOTE(OBJECT)),ARR_3([1,14,14]));\ -HITPOINT_SETTINGS_SIDE(OBJECT,SIDE_CMD,arms,FORMAT_1("%1 hitpoint damage reduction - arms",QUOTE(OBJECT)),ARR_3([1,0,1]));\ -HITPOINT_SETTINGS_SIDE(OBJECT,SIDE_CMD,legs,FORMAT_1("%1 hitpoint damage reduction - legs",QUOTE(OBJECT)),ARR_3([1,0,1])) - -HITPOINT_CHECK_SETTING_SIDE(BluFor,blufor); -HITPOINT_CHECK_SETTING_SIDE(OpFor,opfor); -HITPOINT_CHECK_SETTING_SIDE(Independent,independent); -HITPOINT_CHECK_SETTING_SIDE(Civilian,civilian); diff --git a/addons/armor_modifier_ace/script_component.hpp b/addons/armor_modifier_ace/script_component.hpp deleted file mode 100644 index 1bece87f..00000000 --- a/addons/armor_modifier_ace/script_component.hpp +++ /dev/null @@ -1,38 +0,0 @@ -#define COMPONENT armor_modifier_ace -#include "\z\potato\addons\core\script_mod.hpp" - -// #define DEBUG_MODE_FULL -// #define DISABLE_COMPILE_CACHE -// #define DEBUG_SYNCHRONOUS -// #define ENABLE_PERFORMANCE_COUNTERS - -#ifdef DEBUG_ENABLED_ARMOR_MODIFIER_ACE - #define DEBUG_MODE_FULL -#endif - -#ifdef DEBUG_SETTINGS_ARMOR_MODIFIER_ACE - #define DEBUG_SETTINGS DEBUG_SETTINGS_ARMOR_MODIFIER_ACE -#endif - -#include "\z\potato\addons\core\script_macros.hpp" -#define GETMVAR(var1,var2) (missionNamespace getVariable [ARR_2(var1,var2)]) -#define SETMVAR(var1,var2,var3) (missionNamespace setVariable [ARR_3(var1,var2,var3)]) - -#define DEFAULT_SETTINGS [ARR_3(1,0,0)] -#define MINIMUM_SETTINGS [ARR_3(0.001,0,0)] -#define DEFAULT_HASH_SETTINGS createHashMapFromArray [["hithead",[1,0,0]],["hitdiaphragm",[1,0,0]],["hitleftarm",[1,0,0]],["hitleftleg",[1,0,0]],["hitneck",[1,0,0]],["hitpelvis",[1,0,0]],["hitrightleg",[1,0,0]],["hitchest",[1,0,0]],["hitabdomen",[1,0,0]],["hitrightarm",[1,0,0]],["hitface",[1,0,0]]] - -#define DFUNC(var1) TRIPLES(ADDON,fnc,var1) - -// #include "\z\ace\addons\medical_engine\script_component.hpp" -#define PRIORITY_HEAD 3 -#define PRIORITY_BODY 4 -#define PRIORITY_LEFT_ARM (1 + random 1) -#define PRIORITY_RIGHT_ARM (1 + random 1) -#define PRIORITY_LEFT_LEG (1 + random 1) -#define PRIORITY_RIGHT_LEG (1 + random 1) -#define PRIORITY_STRUCTURAL 1 - -#define GET_NUMBER(config,default) (if (isNumber (config)) then {getNumber (config)} else {default}) - -#define COMPONENT_NAME QUOTE(POTATO - Armor Modifier ACE) diff --git a/addons/assignGear/XEH_PREP.hpp b/addons/assignGear/XEH_PREP.hpp index 5861213e..cd9c71dc 100644 --- a/addons/assignGear/XEH_PREP.hpp +++ b/addons/assignGear/XEH_PREP.hpp @@ -3,13 +3,12 @@ TRACE_1("",QUOTE(ADDON)); PREP(addItemsToContainer); PREP(addSupplyBoxActions); PREP(assignGearMan); -PREP(assignGearPotatoBox); PREP(assignGearSupplyBox); -PREP(assignGearVehicle_asBoxes); +PREP(assignGearPotatoBox); PREP(assignGearVehicle); +PREP(cleanPrefix); PREP(changeableOptics_getChildren); PREP(changeableOptics_setOptic); -PREP(cleanPrefix); PREP(getContainerInfo); PREP(getDisposableInfo); // temp?? for cba change to disposable hash maps PREP(getLinkedIndex); diff --git a/addons/assignGear/functions/fnc_assignGearSupplyBox.sqf b/addons/assignGear/functions/fnc_assignGearSupplyBox.sqf index 7ed1f4c8..9869a273 100644 --- a/addons/assignGear/functions/fnc_assignGearSupplyBox.sqf +++ b/addons/assignGear/functions/fnc_assignGearSupplyBox.sqf @@ -4,8 +4,6 @@ * Fills supply box with gear for a faction * Edit by Lambda.tiger * Supports boxes containing other boxes - * Edit by Lambda.tiger - * Supports boxes containing other boxes * * Arguments: * 0: Box diff --git a/addons/assignGear/functions/fnc_assignGearVehicle.sqf b/addons/assignGear/functions/fnc_assignGearVehicle.sqf index 3e7e0943..fe625c2b 100644 --- a/addons/assignGear/functions/fnc_assignGearVehicle.sqf +++ b/addons/assignGear/functions/fnc_assignGearVehicle.sqf @@ -15,6 +15,11 @@ * * Public: Yes */ + +#define BAGS_PER_BOX 10 +#define WEAPONS_PER_BOX 5 +#define MAGAZINES_PER_BOX 100 + params ["_theVehicle", "_defaultLoadout"]; TRACE_2("assignGearVehicle",_theVehicle,_defaultLoadout); @@ -75,12 +80,256 @@ if (!isClass _path) exitWith { }; //Clean out starting inventory (even if there is no class) + switch (GVAR(setVehicleLoadouts)) do { case 1: { // ammo in vehicle inventory [_theVehicle, _path] call FUNC(setContainerContentsFromConfig); }; - case 2: { // ammo in boxes in vehicle - [_theVehicle, _path, _transportMagazines, _transportItems, _transportWeapons, _transportBackpacks] call FUNC(assignGearVehicle_asBoxes); + case 2: { // ammo in boxes in vehicle from inventory + private _getMassLbs = { + params ["_config"]; + private _mass = getNumber (_config >> "mass"); + + if (_mass == 0 && {isClass (_config >> "itemInfo")}) then { + _mass = getNumber (_config >> "itemInfo" >> "mass"); + }; + + if (_mass == 0 && {isClass (_config >> "WeaponSlotsInfo")}) then { + _mass = getNumber (_config >> "WeaponSlotsInfo" >> "mass"); + }; + _mass / 10 + }; + + private _getShortName = { + params ["_displayName"]; + (_displayName splitString " ") params ["_f", "_s"]; + private _shortName = format ["%1 %2", _f, _s]; + if (isNil "_s") then { + _shortName = _f; + }; + _shortName + }; + + clearWeaponCargoGlobal _theVehicle; + clearMagazineCargoGlobal _theVehicle; + clearItemCargoGlobal _theVehicle; + clearBackpackCargoGlobal _theVehicle; + + private _transportMagazines = getArray(_path >> "TransportMagazines"); + private _transportItems = getArray(_path >> "TransportItems"); + private _transportWeapons = getArray(_path >> "TransportWeapons"); + private _transportBackpacks = getArray(_path >> "TransportBackpacks"); + private _transportBoxClassname = getText(_path >> "AmmoBox"); + if (_transportBoxClassname == "") then { + _transportBoxClassname = "Box_NATO_Ammo_F"; + }; + private _transportBoxWeight = getNumber(_path >> "AmmoBoxCapacity"); + if (_transportBoxWeight == 0) then { + _transportBoxWeight = 75; + }; + + private _loadoutInfo = createHashMap; + private _availableMagazines = []; + private _availableItems = []; + private _availableWeapons = []; + private _availableBackpacks = []; + // transportMagazines + { + (_x splitString ":") params ["_classname", ["_amount", "1", [""]]]; + _availableMagazines pushBackUnique _classname; + private _config = configFile >> "CfgMagazines" >> _classname; + (_loadoutInfo getOrDefault [_classname, [0, _config call _getMassLbs, getText (_config >> "displayName")]]) params ["_existingAmount", "_mass", "_name"]; + _loadoutInfo set [_classname, [_existingAmount + parseNumber _amount, _mass, _name]]; + nil + } count _transportMagazines; // count used here for speed, make sure nil is above this line + + // transportItems + { + (_x splitString ":") params ["_classname", ["_amount", "1", [""]]]; + _availableItems pushBackUnique _classname; + private _config = configFile >> "CfgWeapons" >> _classname; + (_loadoutInfo getOrDefault [_classname, [0, _config call _getMassLbs, getText (_config >> "displayName")]]) params ["_existingAmount", "_mass", "_name"]; + _loadoutInfo set [_classname, [_existingAmount + parseNumber _amount, _mass, _name]]; + nil + } count _transportItems; // count used here for speed, make sure nil is above this line + + // transportWeapons + { + (_x splitString ":") params ["_classname", ["_amount", "1", [""]]]; + private _disposableName = [cba_disposable_LoadedLaunchers, _classname, "get", ""] call FUNC(getDisposableInfo); + if (_disposableName != "") then { + TRACE_2("cba_disposable_LoadedLaunchers replace",_classname,_disposableName); + _classname = _disposableName; + }; + _availableWeapons pushBackUnique _classname; + private _config = configFile >> "CfgWeapons" >> _classname; + (_loadoutInfo getOrDefault [_classname, [0, _config call _getMassLbs, getText (_config >> "displayName")]]) params ["_existingAmount", "_mass", "_name"]; + _loadoutInfo set [_classname, [_existingAmount + parseNumber _amount, _mass, _name]]; + nil + } count _transportWeapons; // count used here for speed, make sure nil is above this line + + // transportBackpacks + { + (_x splitString ":") params ["_classname", ["_amount", "1", [""]]]; + _availableBackpacks pushBackUnique _classname; + private _config = configFile >> "CfgBackpacks" >> _classname; + (_loadoutInfo getOrDefault [_classname, [0, _config call _getMassLbs, getText (_config >> "displayName")]]) params ["_existingAmount", "_mass", "_name"]; + _loadoutInfo set [_classname, [_existingAmount + parseNumber _amount, _mass, _name]]; + nil + } count _transportBackpacks; // count used here for speed, make sure nil is above this line + + while { + _availableBackpacks isNotEqualTo [] || + { _availableItems isNotEqualTo [] } || + { _availableWeapons isNotEqualTo [] } || + { _availableMagazines isNotEqualTo [] } + } do { + scopeName "item_select_loop"; + private _currentWeight = 0; + private _box = createVehicle [_transportBoxClassname, [0, 0, 0], [], 0, "NONE"]; + clearWeaponCargoGlobal _box; + clearMagazineCargoGlobal _box; + clearItemCargoGlobal _box; + clearBackpackCargoGlobal _box; + [_box, 0] call ace_cargo_fnc_setSize; + [_box, _theVehicle, true] call ace_cargo_fnc_loadItem; + + private _name = []; + if (_currentWeight < _transportBoxWeight && _availableBackpacks isNotEqualTo []) then { + scopeName "add_Backpack"; + private _chosen = ""; + private _amounts = [0]; + for "_i" from 0 to BACKPACKS_PER_BOX do { + // check if Backpacks of this type remain + if ((_amounts select 0) == 0) then { + _loadoutInfo deleteAt _chosen; + if (_availableBackpacks isEqualTo []) exitWith { + breakTo "item_select_loop"; + }; + _chosen = _availableBackpacks deleteAt 0; + _amounts = _loadoutInfo get _chosen; + _name pushBackUnique ([_amounts select 2] call _getShortName); + }; + _amounts params ["_count", "_weight"]; + // always add at least one item + _currentWeight = _currentWeight + _weight; + _amounts set [0, _count - 1]; + _box addBackpackCargoGlobal [_chosen, 1]; + + if (_currentWeight >= _transportBoxWeight) exitWith { + breakTo "add_Backpack"; + }; + }; + // Since, if a bag still exists to add we exist here, we need to re-add it + _loadoutInfo set [_chosen, _amounts]; + _availableBackpacks pushBack _chosen; + }; + if (_currentWeight < _transportBoxWeight && _availableWeapons isNotEqualTo []) then { + scopeName "add_weapon"; + private _chosen = ""; + private _amounts = [0]; + for "_i" from 0 to WEAPONS_PER_BOX do { + // check if weapons of this type remain + if ((_amounts select 0) == 0) then { + _loadoutInfo deleteAt _chosen; + if (_availableWeapons isEqualTo []) exitWith { + breakTo "item_select_loop"; + }; + _chosen = _availableWeapons deleteAt 0; + _amounts = _loadoutInfo get _chosen; + _name pushBackUnique ([_amounts select 2] call _getShortName); + }; + _amounts params ["_count", "_weight"]; + // always add at least one item + _currentWeight = _currentWeight + _weight; + _amounts set [0, _count - 1]; + _box addWeaponCargoGlobal [_chosen, 1]; + + if (_currentWeight >= _transportBoxWeight) exitWith { + breakTo "add_weapon"; + }; + }; + // Since, if a bag still exists to add we exist here, we need to re-add it + _loadoutInfo set [_chosen, _amounts]; + _availableWeapons pushBack _chosen; + }; + if (_currentWeight < _transportBoxWeight && _availableMagazines isNotEqualTo []) then { + scopeName "add_magazine"; + private _chosen = ""; + private _amounts = [0]; + for "_i" from 0 to MAGAZINES_PER_BOX do { + // check if magazines of this type remain + if ((_amounts select 0) == 0) then { + _loadoutInfo deleteAt _chosen; + if (_availableMagazines isEqualTo []) exitWith { + breakTo "item_select_loop"; + }; + _chosen = _availableMagazines deleteAt 0; + _amounts = _loadoutInfo get _chosen; + _name pushBackUnique ([_amounts select 2] call _getShortName); + }; + _amounts params ["_count", "_weight"]; + private _toAdd = 1; + if (_weight == 0) then { + _toAdd = _count; + } else { + _toAdd = floor ((_transportBoxWeight - _currentWeight) / _weight); + }; + // always add at least one item + _toAdd = 1 max (_toAdd min _count); + + _currentWeight = _currentWeight + _weight * _toAdd; + _amounts set [0, _count - _toAdd]; + _box addMagazineCargoGlobal [_chosen, _toAdd]; + + if (_currentWeight >= _transportBoxWeight) exitWith { + breakTo "add_magazine"; + }; + }; + // Since, if a bag still exists to add we exist here, we need to re-add it + _loadoutInfo set [_chosen, _amounts]; + _availableMagazines pushBack _chosen; + }; + if (_currentWeight < _transportBoxWeight && _availableItems isNotEqualTo []) then { + scopeName "add_item"; + private _chosen = ""; + private _amounts = [0]; + for "_i" from 0 to MAGAZINES_PER_BOX do { + // check if items of this type remain + if ((_amounts select 0) == 0) then { + _loadoutInfo deleteAt _chosen; + if (_availableItems isEqualTo []) exitWith { + breakTo "item_select_loop"; + }; + _chosen = _availableItems deleteAt 0; + _amounts = _loadoutInfo get _chosen; + _name pushBackUnique ([_amounts select 2] call _getShortName); + }; + _amounts params ["_count", "_weight"]; + private _toAdd = 1; + if (_weight == 0) then { + _toAdd = _count; + } else { + _toAdd = floor ((_transportBoxWeight - _currentWeight) / _weight); + }; + // always add at least one item + _toAdd = 1 max (_toAdd min _count); + + _currentWeight = _currentWeight + _weight * _toAdd; + _amounts set [0, _count - _toAdd]; + _box addItemCargoGlobal [_chosen, _toAdd]; + + if (_currentWeight >= _transportBoxWeight) exitWith { + breakTo "add_item"; + }; + }; + // Since, if a bag still exists to add we exist here, we need to re-add it + _loadoutInfo set [_chosen, _amounts]; + _availableItems pushBack _chosen; + }; + + _box setVariable ["ace_cargo_customName", _name joinString ",", true]; + }; }; case 3: { // ammo in boxes in vehicle from config private _boxes = "true" configClasses _path; @@ -109,3 +358,9 @@ switch (GVAR(setVehicleLoadouts)) do { }; }; + +//Add a Toolkit +if (GVAR(alwaysAddToolkits)) then { _theVehicle addItemCargoGlobal ["Toolkit", 1]; }; +if (GVAR(alwaysAddLandRopes) && {(_theVehicle isKindOf "Car") || {_theVehicle isKindOf "Tank"}}) then { + _theVehicle addItemCargoGlobal ["ACE_rope15", 1]; +}; diff --git a/addons/assignGear/functions/fnc_assignGearVehicle_asBoxes.sqf b/addons/assignGear/functions/fnc_assignGearVehicle_asBoxes.sqf deleted file mode 100644 index 5f16e01f..00000000 --- a/addons/assignGear/functions/fnc_assignGearVehicle_asBoxes.sqf +++ /dev/null @@ -1,214 +0,0 @@ -#include "script_component.hpp" -/* - * Author: tcvm - * Applies a loadout to a vehicle as loaded ammo-boxes - * - * Arguments: - * 0: Vehicle - * 1: Default loadout type - * - * Return Value: - * Nothing - * - * Example: - * [cursorTarget] call potato_assignGear_fnc_assignGearVehicle_asBoxes; - * - * Public: No - */ - -params ["_theVehicle", "_loadoutPath", "_transportMagazines", "_transportItems", "_transportWeapons", "_transportBackpacks"]; - -#define BAGS_PER_BOX 10 -#define WEAPONS_PER_BOX 5 -#define MAGAZINES_PER_BOX 100 - -private _getMassLbs = { - params ["_config"]; - private _mass = getNumber (_config >> "mass"); - - if (_mass == 0 && {isClass (_config >> "itemInfo")}) then { - _mass = getNumber (_config >> "itemInfo" >> "mass"); - }; - - if (_mass == 0 && {isClass (_config >> "WeaponSlotsInfo")}) then { - _mass = getNumber (_config >> "WeaponSlotsInfo" >> "mass"); - }; - _mass / 10 -}; - -private _getShortName = { - params ["_displayName"]; - (_displayName splitString " ") params ["_f", "_s"]; - private _shortName = format ["%1 %2", _f, _s]; - if (isNil "_s") then { - _shortName = _f; - }; - _shortName -}; - -private _semiGreedyFill = { - params ["_currentWeight", "_maxWeight", "_available", "_loadoutInfo", "_max"]; - scopeName "greedy_pick"; - private _name = []; - private _pickedItems = []; - private _chosen = ""; - private _amounts = [0]; - for "_added" from 0 to _max do { - // check if item of this type remain - if ((_amounts select 0) == 0) then { - _loadoutInfo deleteAt _chosen; - if (_available isEqualTo []) exitWith { - _chosen = ""; - breakTo "greedy_pick"; - }; - _chosen = _available deleteAt 0; - _amounts = _loadoutInfo get _chosen; - _name pushBackUnique ([_amounts select 2] call _getShortName); - }; - - _amounts params ["_count", "_weight"]; - private _toAdd = 1; - if (_weight == 0) then { - _toAdd = _count; - } else { - _toAdd = floor ((_maxWeight - _currentWeight) / _weight); - }; - // always add at least one item, up to the specified bound - _toAdd = 1 max (_toAdd min _count min (_max - _added)); - _added = _added + _toAdd; - - _currentWeight = _currentWeight + _weight * _toAdd; - _amounts set [0, _count - _toAdd]; - _pickedItems pushBack [_chosen, _toAdd]; - - if (_currentWeight >= _maxWeight) exitWith { - breakTo "greedy_pick"; - }; - }; - if (_chosen isNotEqualTo "") then { - // Since, if an item still exists to add we exist here, we need to re-add it - _loadoutInfo set [_chosen, _amounts]; - _available pushBack _chosen; - }; - - [_name, _pickedItems, _currentWeight] -}; - -private _transportBoxClassname = getText (_loadoutPath >> "AmmoBox"); -if (_transportBoxClassname == "") then { - _transportBoxClassname = "Box_NATO_Ammo_F"; -}; -private _transportBoxWeight = getNumber (_loadoutPath >> "AmmoBoxCapacity"); -if (_transportBoxWeight == 0) then { - _transportBoxWeight = 75; -}; - -private _loadoutInfo = createHashMap; -private _availableMagazines = []; -private _availableItems = []; -private _availableWeapons = []; -private _availableBackpacks = []; -// transportMagazines -{ - (_x splitString ":") params ["_classname", ["_amount", "1", [""]]]; - _availableMagazines pushBackUnique _classname; - private _config = configFile >> "CfgMagazines" >> _classname; - (_loadoutInfo getOrDefault [_classname, [0, _config call _getMassLbs, getText (_config >> "displayName")]]) params ["_existingAmount", "_mass", "_name"]; - _loadoutInfo set [_classname, [_existingAmount + parseNumber _amount, _mass, _name]]; - nil -} count _transportMagazines; // count used here for speed, make sure nil is above this line - -// transportItems -{ - (_x splitString ":") params ["_classname", ["_amount", "1", [""]]]; - _availableItems pushBackUnique _classname; - private _config = configFile >> "CfgWeapons" >> _classname; - (_loadoutInfo getOrDefault [_classname, [0, _config call _getMassLbs, getText (_config >> "displayName")]]) params ["_existingAmount", "_mass", "_name"]; - _loadoutInfo set [_classname, [_existingAmount + parseNumber _amount, _mass, _name]]; - nil -} count _transportItems; // count used here for speed, make sure nil is above this line - -// transportWeapons -{ - (_x splitString ":") params ["_classname", ["_amount", "1", [""]]]; - private _disposableName = [cba_disposable_LoadedLaunchers, _classname, "get", ""] call FUNC(getDisposableInfo); - if (_disposableName != "") then { - TRACE_2("cba_disposable_LoadedLaunchers replace",_classname,_disposableName); - _classname = _disposableName; - }; - _availableWeapons pushBackUnique _classname; - private _config = configFile >> "CfgWeapons" >> _classname; - (_loadoutInfo getOrDefault [_classname, [0, _config call _getMassLbs, getText (_config >> "displayName")]]) params ["_existingAmount", "_mass", "_name"]; - _loadoutInfo set [_classname, [_existingAmount + parseNumber _amount, _mass, _name]]; - nil -} count _transportWeapons; // count used here for speed, make sure nil is above this line - -// transportBackpacks -{ - (_x splitString ":") params ["_classname", ["_amount", "1", [""]]]; - _availableBackpacks pushBackUnique _classname; - private _config = configFile >> "CfgBackpacks" >> _classname; - (_loadoutInfo getOrDefault [_classname, [0, _config call _getMassLbs, getText (_config >> "displayName")]]) params ["_existingAmount", "_mass", "_name"]; - _loadoutInfo set [_classname, [_existingAmount + parseNumber _amount, _mass, _name]]; - nil -} count _transportBackpacks; // count used here for speed, make sure nil is above this line - -while { - _availableBackpacks isNotEqualTo [] || - { _availableItems isNotEqualTo [] } || - { _availableWeapons isNotEqualTo [] } || - { _availableMagazines isNotEqualTo [] } -} do { - scopeName "item_select_loop"; - private _currentWeight = 0; - private _box = createVehicle [_transportBoxClassname, [0, 0, 0], [], 0, "NONE"]; - clearWeaponCargoGlobal _box; - clearMagazineCargoGlobal _box; - clearItemCargoGlobal _box; - clearBackpackCargoGlobal _box; - [_box, 0] call ACEFUNC(cargo,setSize); - [_box, _theVehicle, true] call ACEFUNC(cargo,loadItem); - [_box, true, [0, 1.5, 0], 0, true, true] call ACEFUNC(dragging,setDraggable); - [_box, true, [0, 1, 1], 0, true, true] call ACEFUNC(dragging,setCarryable); - - private _name = []; - if (_currentWeight < _transportBoxWeight && _availableBackpacks isNotEqualTo []) then { - private _fillInfo = [_currentWeight, _transportBoxWeight, _availableBackpacks, _loadoutInfo, BAGS_PER_BOX] call _semiGreedyFill; - _fillInfo params ["_newName", "_toAdd", "_newWeight"]; - _currentWeight = _newWeight; - _name = _name + _newName; - { - _box addBackpackCargoGlobal _x; - } forEach _toAdd; - }; - if (_currentWeight < _transportBoxWeight && _availableWeapons isNotEqualTo []) then { - private _fillInfo = [_currentWeight, _transportBoxWeight, _availableWeapons, _loadoutInfo, WEAPONS_PER_BOX] call _semiGreedyFill; - _fillInfo params ["_newName", "_toAdd", "_newWeight"]; - _currentWeight = _newWeight; - _name = _name + _newName; - { - _box addWeaponCargoGlobal _x; - } forEach _toAdd; - }; - if (_currentWeight < _transportBoxWeight && _availableMagazines isNotEqualTo []) then { - private _fillInfo = [_currentWeight, _transportBoxWeight, _availableMagazines, _loadoutInfo, MAGAZINES_PER_BOX] call _semiGreedyFill; - _fillInfo params ["_newName", "_toAdd", "_newWeight"]; - _currentWeight = _newWeight; - _name = _name + _newName; - { - _box addMagazineCargoGlobal _x; - } forEach _toAdd; - }; - if (_currentWeight < _transportBoxWeight && _availableItems isNotEqualTo []) then { - private _fillInfo = [_currentWeight, _transportBoxWeight, _availableItems, _loadoutInfo, MAGAZINES_PER_BOX] call _semiGreedyFill; - _fillInfo params ["_newName", "_toAdd", "_newWeight"]; - _currentWeight = _newWeight; - _name = _name + _newName; - { - _box addItemCargoGlobal _x; - } forEach _toAdd; - }; - - _box setVariable [QACEGVAR(cargo,customName), _name joinString ",", true]; -}; - diff --git a/addons/assignGear/functions/fnc_setBoxContentsFromConfig.sqf b/addons/assignGear/functions/fnc_setBoxContentsFromConfig.sqf index 17a1f4b6..d02f336b 100644 --- a/addons/assignGear/functions/fnc_setBoxContentsFromConfig.sqf +++ b/addons/assignGear/functions/fnc_setBoxContentsFromConfig.sqf @@ -24,6 +24,7 @@ params ["_theBox", "_path", ["_nameFormatString", "%1", [""]]]; private _boxName = getText (_path >> "boxCustomName"); if (_boxName isNotEqualTo "") then { _theBox setVariable [QACEGVAR(cargo,customName), format [_nameFormatString, _boxName], true]; + _theBox setVariable [QACEGVAR(cargo,customName), format [_nameFormatString, _boxName], true]; }; private _overrideCarryWeight = 1 == (getNumber (_path >> "forceAllowCarry")); diff --git a/addons/cswCompat/patchGM/ACE_CSW_Groups.hpp b/addons/cswCompat/patchGM/ACE_CSW_Groups.hpp deleted file mode 100644 index 2408f9a4..00000000 --- a/addons/cswCompat/patchGM/ACE_CSW_Groups.hpp +++ /dev/null @@ -1,26 +0,0 @@ -class ACE_CSW_Groups { - //// MILAN - class gm_1Rnd_milan_heat_dm82_csw { - gm_1Rnd_milan_heat_dm82 = 1; - }; - class gm_1Rnd_milan_heat_dm92_csw { // Same name as the carryable magazine - gm_1Rnd_milan_heat_dm92 = 1; // Vehicle magazine that will be loaded when loading this magazine - }; - - //// Fagot - class gm_1Rnd_fagot_heat_9m111_csw { - gm_1Rnd_fagot_heat_9m111 = 1; - }; - - //// MG3 - class gm_120Rnd_762x51mm_b_t_DM21_mg3_grn { - gm_120Rnd_762x51mm_b_t_DM21_mg3_grn = 1; - }; - class gm_120Rnd_762x51mm_b_t_DM21A1_mg3_grn { - gm_120Rnd_762x51mm_b_t_DM21A1_mg3_grn = 1; - }; - class gm_120Rnd_762x51mm_b_t_DM21A2_mg3_grn { - gm_120Rnd_762x51mm_b_t_DM21A2_mg3_grn = 1; - }; - -}; diff --git a/addons/cswCompat/patchGM/CfgMagazines.hpp b/addons/cswCompat/patchGM/CfgMagazines.hpp deleted file mode 100644 index af59a9a5..00000000 --- a/addons/cswCompat/patchGM/CfgMagazines.hpp +++ /dev/null @@ -1,50 +0,0 @@ -class CfgMagazines { - //// MILAN - class gm_1Rnd_milan_heat_dm82; - class gm_1Rnd_milan_heat_dm82_csw: gm_1Rnd_milan_heat_dm82 { - displayName = "[CSW] HEAT DM82 (MILAN 1)"; - scope = 2; - scopeArsenal = 2; - type = 256; - count = 1; - model = "\gm\gm_weapons\gm_launchers\gm_milan\gm_1rnd_milan_heat_dm92.p3d"; - ACE_isBelt = 0; - mass = 159; - }; - - class gm_1Rnd_milan_heat_dm92; - class gm_1Rnd_milan_heat_dm92_csw: gm_1Rnd_milan_heat_dm92 { - displayName = "[CSW] HEAT DM92 (MILAN 2)"; - scope = 2; - scopeArsenal = 2; - type = 256; - count = 1; - model = "\gm\gm_weapons\gm_launchers\gm_milan\gm_1rnd_milan_heat_dm92.p3d"; - ACE_isBelt = 0; - mass = 168; - }; - - //// Fagot - class gm_1Rnd_fagot_heat_9m111; - class gm_1Rnd_fagot_heat_9m111_csw: gm_1Rnd_fagot_heat_9m111 { - displayName = "[CSW] HEAT 9M111 (Fagot)"; - scope = 2; - scopeArsenal = 2; - type = 256; - picture = ACE_CSW_PATH(UI\StaticAT_Icon.paa); - ACE_isBelt = 0; - mass = 276; - }; - - //// MG3 - class gm_120rnd_762x51mm_mg3_grn; - class gm_120Rnd_762x51mm_b_t_DM21_mg3_grn: gm_120rnd_762x51mm_mg3_grn { - ACE_isBelt = 0; - }; - class gm_120Rnd_762x51mm_b_t_DM21A1_mg3_grn: gm_120rnd_762x51mm_mg3_grn { - ACE_isBelt = 0; - }; - class gm_120Rnd_762x51mm_b_t_DM21A2_mg3_grn: gm_120rnd_762x51mm_mg3_grn { - ACE_isBelt = 0; - }; -}; \ No newline at end of file diff --git a/addons/cswCompat/patchGM/CfgVehicles.hpp b/addons/cswCompat/patchGM/CfgVehicles.hpp deleted file mode 100644 index 91a1b52e..00000000 --- a/addons/cswCompat/patchGM/CfgVehicles.hpp +++ /dev/null @@ -1,264 +0,0 @@ -class CfgVehicles { - class gm_staticATGM_base; - //// MILAN - class gm_milan_launcher_tripod_base: gm_staticATGM_base { - class ACE_Actions; - class Turrets; - }; - class gm_ge_army_milan_launcher_tripod_base: gm_milan_launcher_tripod_base { - class ACE_Actions: ACE_Actions { - class ACE_MainActions; - }; - class AnimationSources; - class Turrets: Turrets { - class MainTurret; - }; - }; - class gm_ge_army_milan_launcher_tripod: gm_ge_army_milan_launcher_tripod_base { - class ACE_Actions: ACE_Actions { - class ACE_MainActions: ACE_MainActions { - selection = "mainturret_elev"; - }; - }; - class AnimationSources: AnimationSources { - class MainTurret_realodMagazine_source; - class MainTurret_revolving_source; - }; - class assembleInfo; - class Turrets: Turrets { - class MainTurret: MainTurret { - class Components; - class GunClouds; - class GunFire; - class HitPoints; - class MGunClouds; - class Reflectors; - class TurnIn; - class TurnOut; - class Turrets; - class TurretSpec; - class ViewGunner; - class ViewOptics; - }; - }; - }; - class gm_ge_army_milan_launcher_tripod_csw: gm_ge_army_milan_launcher_tripod { - class ACE_Actions: ACE_Actions { - class ACE_MainActions: ACE_MainActions { - class ACE_csw_pickUp { - displayName = "Disassemble"; - condition = "call ace_csw_fnc_canPickupTripod"; - statement = "call ace_csw_fnc_assemble_pickupTripod"; - }; - }; - }; - class ACE_CSW { - enabled = 1; // Enables ACE CSW for this weaponmmo handling interaction point location (custom pos) - ammoLoadTime = 10 ; // How long it takes in - proxyWeapon = ""; // The proxy weapon created above. This can also be a function name that returns a proxy weapon - passed [_vehicle, _turret, _currentWeapon, _needed, _emptyWeapon] - disassembleWeapon = ""; // Carryable weapon created above - disassembleTurret = ""; // Which static tripod will appear when weapon is disassembled - disassembleTo = QGVAR(gm_milan_backpack); // Abuse the tripods - magazineLocation = "[0.204429,0.696469,-0.680236]"; // Aseconds to load ammo into the weapon - ammoUnloadTime = 10; // How long it takes in seconds to unload ammo from the weapon - desiredAmmo = 1; // When the weapon is reloaded it will try and reload to this ammo capacity - }; - class AnimationSources: AnimationSources { - class MainTurret_realodMagazine_source: MainTurret_realodMagazine_source { - source = "reloadmagazine"; - weapon = QGVAR(gm_milan_launcher_proxy); - }; - class MainTurret_revolving_source: MainTurret_revolving_source { - source = "revolving"; - weapon = QGVAR(gm_milan_launcher_proxy); - }; - }; - class assembleInfo: assembleInfo { - dissasembleTo[] = {}; - }; - class Turrets: Turrets { - class MainTurret: MainTurret { - class Components: Components; - class GunClouds: GunClouds; - class GunFire: GunFire; - class HitPoints: HitPoints; - class MGunClouds: MGunClouds; - class Reflectors: Reflectors; - class TurnIn: TurnIn; - class TurnOut: TurnOut; - class Turrets: Turrets; - class TurretSpec: TurretSpec; - class ViewGunner: ViewGunner; - class ViewOptics: ViewOptics; - weapons[] = {QGVAR(gm_milan_launcher_proxy)}; - magazines[] = {}; - }; - }; - displayName = "[CSW] MILAN"; - displayNameShort = "MILAN"; - }; - - //// Fagot - class gm_fagot_launcher_tripod_base: gm_staticATGM_base { - class ACE_Actions; - class Turrets; - }; - class gm_gc_army_fagot_launcher_tripod_base: gm_fagot_launcher_tripod_base { - class ACE_Actions: ACE_Actions { - class ACE_MainActions; - }; - class AnimationSources; - class Turrets: Turrets { - class MainTurret; - }; - }; - class gm_gc_army_fagot_launcher_tripod: gm_gc_army_fagot_launcher_tripod_base { - class ACE_Actions: ACE_Actions { - class ACE_MainActions: ACE_MainActions { - selection = "mainturret_elev"; - }; - }; - class AnimationSources: AnimationSources { - class MainTurret_realodMagazine_source; - class MainTurret_revolving_source; - }; - class assembleInfo; - class Turrets: Turrets { - class MainTurret: MainTurret { - class Components; - class GunClouds; - class GunFire; - class HitPoints; - class MGunClouds; - class Reflectors; - class TurnIn; - class TurnOut; - class Turrets; - class TurretSpec; - class ViewGunner; - class ViewOptics; - }; - }; - }; - class gm_gc_army_fagot_launcher_tripod_csw: gm_gc_army_fagot_launcher_tripod { - class ACE_Actions: ACE_Actions { - class ACE_MainActions: ACE_MainActions { - class ACE_csw_pickUp { - displayName = "Disassemble"; - condition = "call ace_csw_fnc_canPickupTripod"; - statement = "call ace_csw_fnc_assemble_pickupTripod"; - }; - }; - }; - class ACE_CSW { - enabled = 1; // Enables ACE CSW for this weaponmmo handling interaction point location (custom pos) - ammoLoadTime = 10 ; // How long it takes in - proxyWeapon = ""; // The proxy weapon created above. This can also be a function name that returns a proxy weapon - passed [_vehicle, _turret, _currentWeapon, _needed, _emptyWeapon] - disassembleWeapon = ""; // Carryable weapon created above - disassembleTurret = ""; // Which static tripod will appear when weapon is disassembled - disassembleTo = QGVAR(gm_fagot_backpack); // Abuse the tripods - magazineLocation = "[0,0.4,-0.7]"; // Aseconds to load ammo into the weapon - ammoUnloadTime = 10; // How long it takes in seconds to unload ammo from the weapon - desiredAmmo = 1; // When the weapon is reloaded it will try and reload to this ammo capacity - }; - class AnimationSources: AnimationSources { - class MainTurret_realodMagazine_source: MainTurret_realodMagazine_source { - source = "reloadmagazine"; - weapon = QGVAR(gm_fagot_launcher_proxy); - }; - class MainTurret_revolving_source: MainTurret_revolving_source { - source = "revolving"; - weapon = QGVAR(gm_fagot_launcher_proxy); - }; - }; - class assembleInfo: assembleInfo { - dissasembleTo[] = {}; - }; - class Turrets: Turrets { - class MainTurret: MainTurret { - class Components: Components; - class GunClouds: GunClouds; - class GunFire: GunFire; - class HitPoints: HitPoints; - class MGunClouds: MGunClouds; - class Reflectors: Reflectors; - class TurnIn: TurnIn; - class TurnOut: TurnOut; - class Turrets: Turrets; - class TurretSpec: TurretSpec; - class ViewGunner: ViewGunner; - class ViewOptics: ViewOptics; - weapons[] = {QGVAR(gm_fagot_launcher_proxy)}; - magazines[] = {}; - }; - }; - displayName = "[CSW] Fagot"; - displayNameShort = "Fagot"; - }; - - //// MG3 AA - // MG3 Tripod - class StaticWeapon; - class gm_staticWeapon_base: StaticWeapon { - class ACE_Actions; - }; - class gm_staticMG_base: gm_staticWeapon_base { - class ACE_Actions: ACE_Actions { - class ACE_MainActions; - }; - }; - class gm_mg3_aatripod_base: gm_staticMG_base { - class ACE_Actions: ACE_Actions { - class ACE_MainActions: ACE_MainActions { - selection = "machinegunturret_01_elev"; - }; - }; - }; - class gm_ge_army_mg3_aatripod_base: gm_mg3_aatripod_base { - class ACE_Actions: ACE_Actions; - }; - class gm_ge_army_mg3_aatripod: gm_ge_army_mg3_aatripod_base { - class ACE_Actions: ACE_Actions; - }; - class gm_ge_army_mg3_aatripod_csw: gm_ge_army_mg3_aatripod { - class ACE_Actions: ACE_Actions; - class ACE_CSW { - enabled = 1; // Enables ACE CSW for this weaponmmo handling interaction point location (custom pos) - ammoLoadTime = 0.1 ; // How long it takes in - proxyWeapon = ""; // The proxy weapon created above. This can also be a function name that returns a proxy weapon - passed [_vehicle, _turret, _currentWeapon, _needed, _emptyWeapon] - disassembleWeapon = "gm_mg3_blk"; // Carryable weapon created above - disassembleTurret = QGVAR(gm_MG3Tripod); // Which static tripod will appear when weapon is disassembled - magazineLocation = "_target selectionPosition 'machinegunturret_01_magazine'"; // Aseconds to load ammo into the weapon - ammoUnloadTime = 5; // How long it takes in seconds to unload ammo from the weapon - desiredAmmo = 120; // When the weapon is reloaded it will try and reload to this ammo capacity - }; - displayName = "[CSW] MG3 - Anti Air Tripod"; - }; - - // MG3 Tripod - class ThingX; - class ace_csw_baseTripod: ThingX { - class ACE_Actions; - }; - class ace_csw_m3Tripod: ace_csw_baseTripod { - class ACE_Actions: ACE_Actions { - class ACE_MainActions; - }; - }; - class GVAR(gm_MG3Tripod): ace_csw_m3Tripod { - class ACE_Actions: ACE_Actions { - class ACE_MainActions: ACE_MainActions { - selection = "machinegunturret_01_mounthide"; - }; - }; - class ACE_CSW { - disassembleTo = QGVAR(gm_MG3TripodCarry); - }; - displayName = "[CSW] MG3 AA Tripod (GM)"; - editorPreview = "gm\gm_weapons\gm_machineguns\gm_mg3\data\ui\preview_gm_mg3_aatripod_base.jpg"; - icon = "\gm\gm_weapons\gm_machineguns\gm_mg3\data\ui\map_gm_mg3_aatripod_ca"; - model = "\gm\gm_weapons\gm_machineguns\gm_mg3\gm_mg3_aatripod"; - picture = "\gm\gm_weapons\gm_machineguns\gm_mg3\data\ui\picture_gm_mg3_aatripod_ca"; - }; -}; -// spg9 model location selectionName: "mainturret_rear" diff --git a/addons/cswCompat/patchGM/CfgWeapons.hpp b/addons/cswCompat/patchGM/CfgWeapons.hpp deleted file mode 100644 index 483eb431..00000000 --- a/addons/cswCompat/patchGM/CfgWeapons.hpp +++ /dev/null @@ -1,98 +0,0 @@ -class CfgWeapons { - - //// Carryable weapons - class Launcher; - class Launcher_Base_F: Launcher { - class WeaponSlotsInfo; - }; - - /// Milan - class GVAR(gm_milan_backpack): Launcher_Base_F { - class ACE_CSW { - type = "mount"; - deployTime = 4; - pickupTime = 4; - deploy = "gm_ge_army_milan_launcher_tripod_csw"; - }; - class WeaponSlotsInfo: WeaponSlotsInfo { - class MuzzleSlot { - iconScale = 0.1; - }; - mass = 362; // 16.4 kg - }; - displayName = "[CSW] MILAN (GM)"; - author = "Lambda.Tiger"; - scope = 2; - scopeArsenal = 2; - model = ACE_APL_PATH(ACE_CSW_Bag.p3d); - modes[] = {}; - picture = "\gm\gm_weapons\gm_launchers\gm_milan\data\ui\picture_gm_milan_launcher_weaponBag_ca"; - }; - - /// Fagot - class GVAR(gm_fagot_backpack): Launcher_Base_F { - class ACE_CSW { - type = "mount"; - deployTime = 4; - pickupTime = 4; - deploy = "gm_gc_army_fagot_launcher_tripod_csw"; - }; - class WeaponSlotsInfo: WeaponSlotsInfo { - class MuzzleSlot { - iconScale = 0.1; - }; - mass = 496; // 22.5 kg - }; - displayName = "[CSW] Fagot (GM)"; - author = "Lambda.Tiger"; - scope = 2; - scopeArsenal = 2; - model = ACE_APL_PATH(ACE_CSW_Bag.p3d); - modes[] = {}; - picture = "\gm\gm_weapons\gm_launchers\gm_fagot\data\ui\picture_gm_fagot_launcher_weaponBag_ca"; - }; - - /// MG3 - // Weapon - class gm_mg3_base; - class gm_mg3_blk: gm_mg3_base { - class ACE_CSW { - type = "weapon"; - deployTime = 4; - pickupTime = 4; - class assembleTo { - GVAR(gm_MG3Tripod) = "gm_ge_army_mg3_aatripod_csw"; - }; - }; - }; - - // Tripod - class ace_csw_m3CarryTripod: Launcher_Base_F { - class WeaponSlotsInfo: WeaponSlotsInfo; - }; - class GVAR(gm_MG3TripodCarry): ace_csw_m3CarryTripod { - class ACE_CSW { - type = "mount"; - deployTime = 4; - pickupTime = 4; - deploy = QGVAR(gm_MG3Tripod); - }; - class WeaponSlotsInfo: WeaponSlotsInfo { - mass = 256; // fun number - }; - displayName = "[CSW] MG3 AA Tripod"; - icon = "\gm\gm_weapons\gm_machineguns\gm_mg3\data\ui\map_gm_mg3_aatripod_ca"; - picture = "\gm\gm_weapons\gm_machineguns\gm_mg3\data\ui\picture_gm_mg3_aatripod_weaponBag_ca"; - }; - - //// Proxy Weapons - class gm_milan_launcher; - class GVAR(gm_milan_launcher_proxy): gm_milan_launcher { - magazineReloadTime = 0.5; - }; - - class gm_fagot_launcher; - class GVAR(gm_fagot_launcher_proxy): gm_fagot_launcher { - magazineReloadTime = 0.5; - }; -}; diff --git a/addons/cswCompat/patchGM/config.cpp b/addons/cswCompat/patchGM/config.cpp deleted file mode 100644 index cd96916d..00000000 --- a/addons/cswCompat/patchGM/config.cpp +++ /dev/null @@ -1,41 +0,0 @@ -// "\gm\gm_weapons\gm_launchers\gm_milan\gm_milan_heat_dm92.p3d" -// "\gm\gm_weapons\gm_launchers\gm_fagot\gm_fagot_heat_9m111.p3d" -#include "\z\potato\addons\cswCompatCUP\script_component.hpp" -#undef COMPONENT -#define COMPONENT cswCompatCUP_patchGM - -class CfgPatches { - class ADDON { - units[] = { - "gm_ge_army_milan_launcher_tripod_csw", - "gm_gc_army_fagot_launcher_tripod_csw", - "gm_ge_army_mg3_aatripod_csw", - QGVAR(gm_MG3Tripod) - }; - weapons[] = { - QGVAR(gm_milan_backpack), - QGVAR(gm_fagot_backpack), - QGVAR(gm_MG3TripodCarry), - QGVAR(gm_milan_launcher_proxy), - QGVAR(gm_fagot_launcher_proxy) - }; - requiredVersion = REQUIRED_VERSION; - requiredAddons[] = { - "potato_cswCompatCUP", - "gm_weapons_ammo", - "gm_weapons_launchers_milan", - "gm_weapons_launchers_fagot", - "gm_weapons_machineguns_mg3_gm_ge_army_mg3", - "gm_weapons_launchers_fagot_gm_gc_army_fagot" - }; - skipWhenMissingDependencies = 1; - author = "Bourbon Warfare"; - authorUrl = "https://github.com/BourbonWarfare/POTATO"; - VERSION_CONFIG; - }; -}; - -#include "ACE_CSW_Groups.hpp" -#include "CfgMagazines.hpp" -#include "CfgWeapons.hpp" -#include "CfgVehicles.hpp" diff --git a/addons/miscFixes/XEH_preInit.sqf b/addons/miscFixes/XEH_preInit.sqf index 0e8644d6..d39f2b7d 100644 --- a/addons/miscFixes/XEH_preInit.sqf +++ b/addons/miscFixes/XEH_preInit.sqf @@ -22,46 +22,3 @@ if (["WBK_ZombieCreatures"] call ACEFUNC(common,isModLoaded)) then { }] call CBA_fnc_addClassEventHandler; } forEach _wbkZombiesBase; }; - -//add EH to fix weapon lowering while walking fix -addUserActionEventHandler ["toggleRaiseWeapon","Activate",{ - private _lAnim = animationState ace_player; - if ("stp" in _lAnim || "non" in _lAnim) exitWith {}; - _lAnim = _lAnim splitString ""; - private _state = [_lAnim #13,_lAnim #14,_lAnim #15] joinString ""; - switch(_state)do{ - case "ras": { - _lAnim set [13,"l"]; - _lAnim set [14,"o"]; - _lAnim set [15,"w"]; - }; - case "low": { - _lAnim set [13,"r"]; - _lAnim set [14,"a"]; - _lAnim set [15,"s"]; - }; - }; - private _nAnim = _lAnim joinString ""; - [{ - params ["_nAnim"]; - if (!alive ace_player) exitWith {}; - private _f = inputAction "MoveForward"; - private _b = inputAction "MoveBack"; - private _l = inputAction "TurnLeft"; - private _r = inputAction "TurnRight"; - private _tot = _f + _b + _l + _r; - if (_tot == 0) then { - private _tAnim = _nAnim splitString "_"; - _nAnim = _tAnim #0 splitString ""; - _nAnim set [9,"s"]; - _nAnim set [10,"t"]; - _nAnim set [11,"p"]; - _nAnim set [21,"n"]; - _nAnim set [22,"o"]; - _nAnim set [23,"n"]; - _nAnim = _nAnim joinString ""; - INFO_2("weapon lowering stopping %1->%2",animationState ace_player,_nAnim); // temp debug logging for problems - [ace_player, _nAnim, 1] call ace_common_fnc_doAnimation; - }; - }, [_nAnim], 0.5] call CBA_fnc_waitAndExecute; -}]; diff --git a/addons/missileGuidanceCompat/CfgAmmo.hpp b/addons/missileGuidanceCompat/CfgAmmo.hpp index a9c5d89d..b25b7413 100644 --- a/addons/missileGuidanceCompat/CfgAmmo.hpp +++ b/addons/missileGuidanceCompat/CfgAmmo.hpp @@ -1,6 +1,482 @@ class CfgAmmo { + class M_Titan_AA; + class MissileBase; + class M_Titan_AT; + class Bo_GBU12_LGB; + class ShellBase; class ace_dragon_serviceCharge: ShellBase { - soundSetExplosion[] = {}; // for JSRS + soundSetExplosion[] = {}; + }; + + class CUP_M_9K32_Strela_2_AA: M_Titan_AA { + maneuvrability = 0; + #include "CfgMissileStrela.hpp" + }; + + class CUP_M_9K38_Igla_AA: M_Titan_AA { + maneuvrability = 0; + #include "CfgMissileIgla.hpp" + }; + + class CUP_M_9M17P_AT2_Falanga_AT: MissileBase { + maneuvrability = 0; + #include "CfgMissileFalanga.hpp" + }; + + class CUP_M_9M17P_AT3_Sagger_AT: MissileBase { + maneuvrability = 0; + #include "CfgMissileFleyta.hpp" + }; + + class CUP_M_9M113_AT5_Spandrel_AT: M_Titan_AT { + maneuvrability = 0; + #include "CfgMissileKonkurs.hpp" + }; + + class CUP_M_Shturm_9M114_AT6_Spiral_AT: MissileBase { + maneuvrability = 0; + #include "CfgMissileShturm.hpp" + }; + + class CUP_M_Ataka_V_9M120_AT9_Spiral_2_AT: MissileBase { + maneuvrability = 0; + #include "CfgMissileAtaka.hpp" + }; + + class CUP_M_9K116_1_Bastion_AT10_Stabber_AT: MissileBase { + maneuvrability = 0; + #include "CfgMissileBastion.hpp" + }; + + class CUP_M_9M119M_Refleks_AT11_Sniper_AT: MissileBase { + maneuvrability = 0; + #include "CfgMissileRefleks.hpp" + }; + + class CUP_M_9K115_2_AT13_Saxhorn_2_AT: MissileBase { + maneuvrability = 0; + #include "CfgMissileMetis.hpp" + }; + + class CUP_M_9M133_1_AT14_Spriggan_AT: MissileBase { + maneuvrability = 0; + #include "CfgMissileKornet.hpp" + }; + + class CUP_M_9M133_1_AT14_Spriggan_HE: CUP_M_9M133_1_AT14_Spriggan_AT { + maneuvrability = 0; + #include "CfgMissileKornet.hpp" + }; + + class CUP_M_9K121_Vikhr_AT16_Scallion_AT: MissileBase { + maneuvrability = 0; + #include "CfgMissileVikhr.hpp" + }; + + class CUP_M_KH29L_AT: MissileBase { + maneuvrability = 0; + #include "CfgMissileKH29.hpp" + }; + + class CUP_M_AGM_114K_Hellfire_II_AT: MissileBase { + maneuvrability = 0; + class ace_missileguidance { + enabled = 1; + + pitchRate = 30; // degrees per second + yawRate = 30; + + canVanillaLock = 0; // Can this default vanilla lock? Only applicable to non-cadet mode + + // Guidance type for munitions + defaultSeekerType = "SALH"; + seekerTypes[] = { "SALH" }; + + defaultSeekerLockMode = "LOAL"; + seekerLockModes[] = { "LOAL", "LOBL" }; + + defaultNavigationType = "Direct"; + navigationTypes[] = { "Direct", "ZeroEffortMiss" }; + + seekLastTargetPos = 1; // seek last target position [if seeker loses LOS of target, continue to last known pos] + seekerAngle = 70; // Angle in front of the missile which can be searched + seekerAccuracy = 1; // seeker accuracy multiplier + + seekerMinRange = 1; + seekerMaxRange = 8000; // Range from the missile which the seeker can visually search + + // Attack profile type selection + defaultAttackProfile = "hellfire"; + attackProfiles[] = {"hellfire", "hellfire_hi", "hellfire_lo"}; + + class navigationStates { + class initial { + transitionCondition = "ace_hellfire_fnc_midCourseTransition"; + navigationType = "Direct"; + }; + class terminal { + transitionCondition = ""; + navigationType = "ZeroEffortMiss"; + }; + // transitions from initial -> termimal + states[] = {"initial", "terminal"}; + }; + }; + }; + + class CUP_M_AGM_114L_Hellfire_II_AT: MissileBase { + class ace_missileguidance { + enabled = 1; + + pitchRate = 30; // degrees per second + yawRate = 30; + + canVanillaLock = 1; // Can this default vanilla lock? Only applicable to non-cadet mode + + // Guidance type for munitions + defaultSeekerType = "MillimeterWaveRadar"; + seekerTypes[] = { "MillimeterWaveRadar" }; + + defaultSeekerLockMode = "LOBL"; + seekerLockModes[] = { "LOBL" }; + + defaultNavigationType = "Direct"; + navigationTypes[] = { "Direct", "ZeroEffortMiss" }; + + seekLastTargetPos = 0; // seek last target position [if seeker loses LOS of target, continue to last known pos] + seekerAngle = 70; // Angle in front of the missile which can be searched + seekerAccuracy = 1; // seeker accuracy multiplier + + seekerMinRange = 1; + activeRadarEngageDistance = 1000; + seekerMaxRange = 2000; // distance that the hellfire internal radar can scan + + // Attack profile type selection + defaultAttackProfile = "hellfire"; + attackProfiles[] = {"hellfire", "hellfire_hi", "hellfire_lo"}; + + class navigationStates { + class initial { + transitionCondition = "ace_hellfire_fnc_midCourseTransition"; + navigationType = "Direct"; + }; + class terminal { + transitionCondition = ""; + navigationType = "ZeroEffortMiss"; + }; + // transitions from initial -> termimal + states[] = {"initial", "terminal"}; + }; + }; + }; + + class CUP_M_AIM_9L_Sidewinder_AA: MissileBase { + maneuvrability = 0; + + class ace_missileguidance { + enabled = 1; + + pitchRate = 25; // Minium flap deflection for guidance + yawRate = 25; // Maximum flap deflection for guidance + + canVanillaLock = 1; // Can this default vanilla lock? Only applicable to non-cadet mode + + // Guidance type for munitions + defaultSeekerType = "IR"; + seekerTypes[] = { "IR" }; + + flareDistanceFilter = 100; + flareAngleFilter = 1.6; // can filter out flares that are >= flareAngleFilter to known target velocity + + defaultSeekerLockMode = "LOBL"; + seekerLockModes[] = { "LOBL" }; + + defaultNavigationType = "AugmentedProportionalNavigation"; + navigationTypes[] = { "AugmentedProportionalNavigation" }; + + seekLastTargetPos = 0; // seek last target position [if seeker loses LOS of target, continue to last known pos] + seekerAngle = 45; // Angle from the shooter's view that can track the missile + seekerAccuracy = 0.8; // seeker accuracy multiplier + + seekerMinRange = 75; + seekerMaxRange = 5000; // Range from the missile which the seeker can visually search + + // Attack profile type selection + defaultAttackProfile = "DIR"; + attackProfiles[] = {"DIR"}; + }; + }; + + class CUP_M_Stinger_AA: MissileBase { + maneuvrability = 0; + + class ace_missileguidance { + enabled = 1; + + pitchRate = 42; // Minium flap deflection for guidance + yawRate = 42; // Maximum flap deflection for guidance + + canVanillaLock = 1; // Can this default vanilla lock? Only applicable to non-cadet mode + + // Guidance type for munitions + defaultSeekerType = "IR"; + seekerTypes[] = { "IR" }; + + flareDistanceFilter = 100; + flareAngleFilter = 1.3; // can filter out flares that are >= flareAngleFilter to known target velocity + + defaultSeekerLockMode = "LOBL"; + seekerLockModes[] = { "LOBL" }; + + defaultNavigationType = "AugmentedProportionalNavigation"; + navigationTypes[] = { "AugmentedProportionalNavigation" }; + + seekLastTargetPos = 0; // seek last target position [if seeker loses LOS of target, continue to last known pos] + seekerAngle = 45; // Angle from the shooter's view that can track the missile + seekerAccuracy = 0.8; // seeker accuracy multiplier + + seekerMinRange = 75; + seekerMaxRange = 5000; // Range from the missile which the seeker can visually search + + // Attack profile type selection + defaultAttackProfile = "DIR"; + attackProfiles[] = {"DIR"}; + }; + }; + + class CUP_M_RBS70_AA: MissileBase { + maneuvrability = 0; + + class ace_missileguidance { + enabled = 1; + + pitchRate = 45; // Minium flap deflection for guidance + yawRate = 45; // Maximum flap deflection for guidance + + canVanillaLock = 0; // Can this default vanilla lock? Only applicable to non-cadet mode + + showTrail = 1; + + // Guidance type for munitions + defaultSeekerType = "SACLOS"; + seekerTypes[] = { "SACLOS" }; + + defaultSeekerLockMode = "LOAL"; + seekerLockModes[] = { "LOAL", "LOBL" }; + + defaultNavigationType = "Line"; + navigationTypes[] = { "Line" }; + + lineGainP = 20; + lineGainD = 16; + + initialPitch = 2; + + seekLastTargetPos = 0; // seek last target position [if seeker loses LOS of target, continue to last known pos] + seekerAngle = 30; // Angle from the shooter's view that can track the missile + seekerAccuracy = 1; // seeker accuracy multiplier + + seekerMinRange = 75; + seekerMaxRange = 5000; // Range from the missile which the seeker can visually search + + correctionDistance = 30; // distance from center of crosshair where missile slows down + offsetFromCrosshair[] = { 0, 0, 0 }; // where the missile wants to stay in relation to the center of the crosshair. + + // Attack profile type selection + defaultAttackProfile = "BEAM"; + attackProfiles[] = {"BEAM"}; + }; + }; + + class CUP_AGM65pod_AT: MissileBase { + maneuvrability = 0; + class ace_missileguidance { + enabled = 1; + + pitchRate = 15; + yawRate = 15; + + canVanillaLock = 1; + + defaultSeekerType = "Optic"; + seekerTypes[] = {"Optic"}; + + defaultSeekerLockMode = "LOBL"; + seekerLockModes[] = {"LOBL"}; + + defaultNavigationType = "AugmentedProportionalNavigation"; + navigationTypes[] = { "AugmentedProportionalNavigation" }; + + seekLastTargetPos = 1; + seekerAngle = 60; + seekerAccuracy = 1; + + seekerMinRange = 1; + seekerMaxRange = 14000; + + defaultAttackProfile = "maverick"; + attackProfiles[] = {"maverick"}; + }; + }; + + class CUP_R_TOW_AT: M_Titan_AT { + maneuvrability = 0; + class ace_missileguidance { + enabled = 1; + + pitchRate = 45; // Minium flap deflection for guidance + yawRate = 45; // Maximum flap deflection for guidance + + canVanillaLock = 0; // Can this default vanilla lock? Only applicable to non-cadet mode + + showTrail = 1; + + // Guidance type for munitions + defaultSeekerType = "SACLOS"; + seekerTypes[] = { "SACLOS" }; + + defaultSeekerLockMode = "LOAL"; + seekerLockModes[] = { "LOAL", "LOBL" }; + + defaultNavigationType = "Line"; + navigationTypes[] = { "Line" }; + + lineGainP = 20; + lineGainD = 7; + + initialPitch = 2; + + seekLastTargetPos = 0; // seek last target position [if seeker loses LOS of target, continue to last known pos] + seekerAngle = 30; // Angle from the shooter's view that can track the missile + seekerAccuracy = 1; // seeker accuracy multiplier + + seekerMinRange = 65; + seekerMaxRange = 3750; // Range from the missile which the seeker can visually search + + correctionDistance = 30; // distance from center of crosshair where missile slows down + offsetFromCrosshair[] = { 0, 0, 0 }; // where the missile wants to stay in relation to the center of the crosshair. + + // Attack profile type selection + defaultAttackProfile = "WIRE"; + attackProfiles[] = {"WIRE"}; + }; + }; + + class CUP_R_TOW2_AT: CUP_R_TOW_AT { + maneuvrability = 0; + class ace_missileguidance: ace_missileguidance { + enabled = 1; + }; + }; + + class CUP_Bo_GBU12_LGB: Bo_GBU12_LGB { + maneuvrability = 0; // no maneuvrability so that default guidance doesnt work + class ace_missileguidance { + enabled = 1; + + pitchRate = 5; + yawRate = 5; + + bangBangGuidance = 1; + stabilityCoefficient = 0.4; // how much this projectile likes to "weathervane" (keep direction toward velocity) + + canVanillaLock = 0; // Can this default vanilla lock? Only applicable to non-cadet mode + + // Guidance type for munitions + defaultSeekerType = "SALH"; + seekerTypes[] = { "SALH" }; + + defaultSeekerLockMode = "LOAL"; + seekerLockModes[] = { "LOAL" }; + + defaultNavigationType = "ProportionalNavigation"; + navigationTypes[] = { "ProportionalNavigation" }; + + seekLastTargetPos = 0; // seek last target position [if seeker loses LOS of target, continue to last known pos] + seekerAngle = 60; // Angle from the shooter's view that can track the missile + seekerAccuracy = 1; // seeker accuracy multiplier + + seekerMinRange = 5; + seekerMaxRange = 4000; // Range from the missile which the seeker can visually search + + // Attack profile type selection + defaultAttackProfile = "DIR"; + attackProfiles[] = {"DIR"}; + }; + }; + + class CUP_Bo_KAB250_LGB: Bo_GBU12_LGB { + maneuvrability = 0; // no maneuvrability so that default guidance doesnt work + class ace_missileguidance { + enabled = 1; + + pitchRate = 8; + yawRate = 8; + + bangBangGuidance = 1; + stabilityCoefficient = 0.4; // how much this projectile likes to "weathervane" (keep direction toward velocity) + + canVanillaLock = 0; // Can this default vanilla lock? Only applicable to non-cadet mode + + // Guidance type for munitions + defaultSeekerType = "SALH"; + seekerTypes[] = { "SALH" }; + + defaultSeekerLockMode = "LOAL"; + seekerLockModes[] = { "LOAL" }; + + defaultNavigationType = "ProportionalNavigation"; + navigationTypes[] = { "ProportionalNavigation" }; + + seekLastTargetPos = 0; // seek last target position [if seeker loses LOS of target, continue to last known pos] + seekerAngle = 60; // Angle from the shooter's view that can track the missile + seekerAccuracy = 1; // seeker accuracy multiplier + + seekerMinRange = 5; + seekerMaxRange = 4000; // Range from the missile which the seeker can visually search + + // Attack profile type selection + defaultAttackProfile = "DIR"; + attackProfiles[] = {"DIR"}; + }; + }; + + class GVAR(redeye): CUP_M_Stinger_AA { + maneuvrability = 0; + + class ace_missileguidance { + enabled = 1; + + pitchRate = 27; // Minium flap deflection for guidance + yawRate = 27; // Maximum flap deflection for guidance + + canVanillaLock = 1; // Can this default vanilla lock? Only applicable to non-cadet mode + + // Guidance type for munitions + defaultSeekerType = "IR"; + seekerTypes[] = { "IR" }; + + flareDistanceFilter = 100; + flareAngleFilter = 2.0; // can filter out flares that are >= flareAngleFilter to known target velocity + + defaultSeekerLockMode = "LOBL"; + seekerLockModes[] = { "LOBL" }; + + defaultNavigationType = "ProportionalNavigation"; + navigationTypes[] = { "ProportionalNavigation" }; + + seekLastTargetPos = 0; // seek last target position [if seeker loses LOS of target, continue to last known pos] + seekerAngle = 45; // Angle from the shooter's view that can track the missile + seekerAccuracy = 0.4; // seeker accuracy multiplier + + seekerMinRange = 75; + seekerMaxRange = 4500; // Range from the missile which the seeker can visually search + + // Attack profile type selection + defaultAttackProfile = "DIR"; + attackProfiles[] = {"DIR"}; + }; }; }; + diff --git a/addons/missileGuidanceCompat/CfgMagazines.hpp b/addons/missileGuidanceCompat/CfgMagazines.hpp new file mode 100644 index 00000000..7fb9c15c --- /dev/null +++ b/addons/missileGuidanceCompat/CfgMagazines.hpp @@ -0,0 +1,7 @@ +class CfgMagazines { + class CA_LauncherMagazine; + class CUP_Dragon_EP1_M: CA_LauncherMagazine { + ammo = "ace_dragon_super"; + initSpeed = 120; + }; +}; diff --git a/addons/missileGuidanceCompat/CfgMissileAtaka.hpp b/addons/missileGuidanceCompat/CfgMissileAtaka.hpp new file mode 100644 index 00000000..9bd47f51 --- /dev/null +++ b/addons/missileGuidanceCompat/CfgMissileAtaka.hpp @@ -0,0 +1,38 @@ +class ace_missileguidance { + enabled = 1; + + pitchRate = 45; // Minium flap deflection for guidance + yawRate = 45; // Maximum flap deflection for guidance + + canVanillaLock = 0; // Can this default vanilla lock? Only applicable to non-cadet mode + + showTrail = 1; + + // Guidance type for munitions + defaultSeekerType = "SACLOS"; + seekerTypes[] = { "SACLOS" }; + + defaultSeekerLockMode = "LOAL"; + seekerLockModes[] = { "LOAL", "LOBL" }; + + defaultNavigationType = "Line"; + navigationTypes[] = { "Line" }; + + lineGainP = 16; + lineGainD = 10.44; + + initialPitch = 2; + + seekLastTargetPos = 0; // seek last target position [if seeker loses LOS of target, continue to last known pos] + seekerAngle = 30; // Angle from the shooter's view that can track the missile + seekerAccuracy = 1; // seeker accuracy multiplier + + seekerMinRange = 75; + seekerMaxRange = 6000; // Range from the missile which the seeker can visually search + + offsetFromCrosshair[] = { 0, 0, 0 }; // where the missile wants to stay in relation to the center of the crosshair. + + // Attack profile type selection + defaultAttackProfile = "BEAM"; + attackProfiles[] = {"BEAM"}; +}; \ No newline at end of file diff --git a/addons/missileGuidanceCompat/CfgMissileBastion.hpp b/addons/missileGuidanceCompat/CfgMissileBastion.hpp new file mode 100644 index 00000000..9f0766fe --- /dev/null +++ b/addons/missileGuidanceCompat/CfgMissileBastion.hpp @@ -0,0 +1,39 @@ +class ace_missileguidance { + enabled = 1; + + pitchRate = 45; // Minium flap deflection for guidance + yawRate = 45; // Maximum flap deflection for guidance + + canVanillaLock = 0; // Can this default vanilla lock? Only applicable to non-cadet mode + + showTrail = 1; + + // Guidance type for munitions + defaultSeekerType = "SACLOS"; + seekerTypes[] = { "SACLOS" }; + + defaultSeekerLockMode = "LOAL"; + seekerLockModes[] = { "LOAL", "LOBL" }; + + defaultNavigationType = "Line"; + navigationTypes[] = { "Line" }; + + lineGainP = 16; + lineGainD = 10.44; + + initialPitch = 2; + + seekLastTargetPos = 0; // seek last target position [if seeker loses LOS of target, continue to last known pos] + seekerAngle = 30; // Angle from the shooter's view that can track the missile + seekerAccuracy = 1; // seeker accuracy multiplier + + seekerMinRange = 75; + seekerMaxRange = 4000; // Range from the missile which the seeker can visually search + + correctionDistance = 30; // distance from center of crosshair where missile slows down + offsetFromCrosshair[] = { 0, 0, 0 }; // where the missile wants to stay in relation to the center of the crosshair. + + // Attack profile type selection + defaultAttackProfile = "BEAM"; + attackProfiles[] = {"BEAM"}; +}; \ No newline at end of file diff --git a/addons/missileGuidanceCompat/CfgMissileDrakon.hpp b/addons/missileGuidanceCompat/CfgMissileDrakon.hpp new file mode 100644 index 00000000..6b20c35b --- /dev/null +++ b/addons/missileGuidanceCompat/CfgMissileDrakon.hpp @@ -0,0 +1,39 @@ +class ace_missileguidance { + enabled = 1; + + pitchRate = 25; // Minium flap deflection for guidance + yawRate = 25; // Maximum flap deflection for guidance + + canVanillaLock = 0; // Can this default vanilla lock? Only applicable to non-cadet mode + + showTrail = 1; + + // Guidance type for munitions + defaultSeekerType = "SACLOS"; + seekerTypes[] = { "SACLOS" }; + + defaultSeekerLockMode = "LOAL"; + seekerLockModes[] = { "LOAL", "LOBL" }; + + defaultNavigationType = "Line"; + navigationTypes[] = { "Line" }; + + lineGainP = 16; + lineGainD = 9.5; + + initialPitch = 2; + + seekLastTargetPos = 0; // seek last target position [if seeker loses LOS of target, continue to last known pos] + seekerAngle = 30; // Angle from the shooter's view that can track the missile + seekerAccuracy = 1; // seeker accuracy multiplier + + seekerMinRange = 75; + seekerMaxRange = 3300; // Range from the missile which the seeker can visually search + + correctionDistance = 30; // distance from center of crosshair where missile slows down + offsetFromCrosshair[] = { 0, 0, 0 }; // where the missile wants to stay in relation to the center of the crosshair. + + // Attack profile type selection + defaultAttackProfile = "BEAM"; + attackProfiles[] = {"BEAM"}; +}; \ No newline at end of file diff --git a/addons/missileGuidanceCompat/CfgMissileFagot.hpp b/addons/missileGuidanceCompat/CfgMissileFagot.hpp new file mode 100644 index 00000000..6402aac1 --- /dev/null +++ b/addons/missileGuidanceCompat/CfgMissileFagot.hpp @@ -0,0 +1,39 @@ +class ace_missileguidance { + enabled = 1; + + pitchRate = 45; // Minium flap deflection for guidance + yawRate = 45; // Maximum flap deflection for guidance + + canVanillaLock = 0; // Can this default vanilla lock? Only applicable to non-cadet mode + + showTrail = 1; + + // Guidance type for munitions + defaultSeekerType = "SACLOS"; + seekerTypes[] = { "SACLOS" }; + + defaultSeekerLockMode = "LOAL"; + seekerLockModes[] = { "LOAL", "LOBL" }; + + defaultNavigationType = "Line"; + navigationTypes[] = { "Line" }; + + lineGainP = 16; + lineGainD = 10.44; + + initialPitch = 2; + + seekLastTargetPos = 0; // seek last target position [if seeker loses LOS of target, continue to last known pos] + seekerAngle = 30; // Angle from the shooter's view that can track the missile + seekerAccuracy = 1; // seeker accuracy multiplier + + seekerMinRange = 75; + seekerMaxRange = 2000; // Range from the missile which the seeker can visually search + + correctionDistance = 30; // distance from center of crosshair where missile slows down + offsetFromCrosshair[] = { 0, 0, 0 }; // where the missile wants to stay in relation to the center of the crosshair. + + // Attack profile type selection + defaultAttackProfile = "BEAM"; + attackProfiles[] = {"BEAM"}; +}; \ No newline at end of file diff --git a/addons/missileGuidanceCompat/CfgMissileFalanga.hpp b/addons/missileGuidanceCompat/CfgMissileFalanga.hpp new file mode 100644 index 00000000..a2ac5181 --- /dev/null +++ b/addons/missileGuidanceCompat/CfgMissileFalanga.hpp @@ -0,0 +1,37 @@ +class ace_missileguidance { + enabled = 1; + + pitchRate = 15; // Minium flap deflection for guidance + yawRate = 15; // Maximum flap deflection for guidance + + canVanillaLock = 0; // Can this default vanilla lock? Only applicable to non-cadet mode + + showTrail = 1; + + // Guidance type for munitions + defaultSeekerType = "MCLOS"; + seekerTypes[] = { "MCLOS" }; + + defaultSeekerLockMode = "LOAL"; + seekerLockModes[] = { "LOAL" }; + + defaultNavigationType = "Line"; + navigationTypes[] = { "Line" }; + + lineGainP = 5; + lineGainD = 0; + + seekLastTargetPos = 0; // seek last target position [if seeker loses LOS of target, continue to last known pos] + seekerAngle = 30; // Angle from the shooter's view that can track the missile + seekerAccuracy = 1; // seeker accuracy multiplier + + seekerMinRange = 0; + seekerMaxRange = 2500; // Range from the missile which the seeker can visually search + + correctionDistance = 0; // distance from center of crosshair where missile slows down + offsetFromCrosshair[] = { 0, 0, 0 }; // where the missile wants to stay in relation to the center of the crosshair. + + // Attack profile type selection + defaultAttackProfile = "WIRE"; + attackProfiles[] = {"WIRE"}; +}; \ No newline at end of file diff --git a/addons/missileGuidanceCompat/CfgMissileFleyta.hpp b/addons/missileGuidanceCompat/CfgMissileFleyta.hpp new file mode 100644 index 00000000..cd08941e --- /dev/null +++ b/addons/missileGuidanceCompat/CfgMissileFleyta.hpp @@ -0,0 +1,37 @@ +class ace_missileguidance { + enabled = 1; + + pitchRate = 15; // Minium flap deflection for guidance + yawRate = 15; // Maximum flap deflection for guidance + + canVanillaLock = 0; // Can this default vanilla lock? Only applicable to non-cadet mode + + showTrail = 1; + + // Guidance type for munitions + defaultSeekerType = "MCLOS"; + seekerTypes[] = { "MCLOS" }; + + defaultSeekerLockMode = "LOAL"; + seekerLockModes[] = { "LOAL" }; + + defaultNavigationType = "Line"; + navigationTypes[] = { "Line" }; + + lineGainP = 5; + lineGainD = 0; + + seekLastTargetPos = 0; // seek last target position [if seeker loses LOS of target, continue to last known pos] + seekerAngle = 30; // Angle from the shooter's view that can track the missile + seekerAccuracy = 1; // seeker accuracy multiplier + + seekerMinRange = 0; + seekerMaxRange = 3000; // Range from the missile which the seeker can visually search + + correctionDistance = 0; // distance from center of crosshair where missile slows down + offsetFromCrosshair[] = { 0, 0, 0 }; // where the missile wants to stay in relation to the center of the crosshair. + + // Attack profile type selection + defaultAttackProfile = "WIRE"; + attackProfiles[] = {"WIRE"}; +}; \ No newline at end of file diff --git a/addons/missileGuidanceCompat/CfgMissileHOT.hpp b/addons/missileGuidanceCompat/CfgMissileHOT.hpp new file mode 100644 index 00000000..9e2240bb --- /dev/null +++ b/addons/missileGuidanceCompat/CfgMissileHOT.hpp @@ -0,0 +1,38 @@ +class ace_missileguidance { // reference https://github.com/acemod/ACE3/pull/10029 + enabled = 1; + + pitchRate = 45; // Minium flap deflection for guidance + yawRate = 45; // Maximum flap deflection for guidance + + canVanillaLock = 0; // Can this default vanilla lock? Only applicable to non-cadet mode + + showTrail = 1; + + // Guidance type for munitions + defaultSeekerType = "SACLOS"; + seekerTypes[] = { "SACLOS" }; + + defaultSeekerLockMode = "LOAL"; + seekerLockModes[] = { "LOAL", "LOBL" }; + + defaultNavigationType = "Line"; + navigationTypes[] = { "Line" }; + + lineGainP = 7; + lineGainD = 6; + + initialPitch = 2; + + seekLastTargetPos = 0; // seek last target position [if seeker loses LOS of target, continue to last known pos] + seekerAngle = 30; // Angle from the shooter's view that can track the missile + seekerAccuracy = 1; // seeker accuracy multiplier + + seekerMinRange = 75; + seekerMaxRange = 4000; // Range from the missile which the seeker can visually search + + offsetFromCrosshair[] = { 0, 0, 0 }; // where the missile wants to stay in relation to the center of the crosshair. + + // Attack profile type selection + defaultAttackProfile = "WIRE"; + attackProfiles[] = {"WIRE"}; +}; \ No newline at end of file diff --git a/addons/missileGuidanceCompat/CfgMissileIgla.hpp b/addons/missileGuidanceCompat/CfgMissileIgla.hpp new file mode 100644 index 00000000..37f1af50 --- /dev/null +++ b/addons/missileGuidanceCompat/CfgMissileIgla.hpp @@ -0,0 +1,32 @@ +class ace_missileguidance { + enabled = 1; + + pitchRate = 30; // Minium flap deflection for guidance + yawRate = 43; // Maximum flap deflection for guidance + + canVanillaLock = 1; // Can this default vanilla lock? Only applicable to non-cadet mode + + // Guidance type for munitions + defaultSeekerType = "IR"; + seekerTypes[] = { "IR" }; + + flareDistanceFilter = 100; + flareAngleFilter = 1.1; // can filter out flares that are >= flareAngleFilter to known target velocity + + defaultSeekerLockMode = "LOBL"; + seekerLockModes[] = { "LOBL" }; + + defaultNavigationType = "AugmentedProportionalNavigation"; + navigationTypes[] = { "AugmentedProportionalNavigation" }; + + seekLastTargetPos = 0; // seek last target position [if seeker loses LOS of target, continue to last known pos] + seekerAngle = 45; // Angle from the shooter's view that can track the missile + seekerAccuracy = 0.76; // seeker accuracy multiplier + + seekerMinRange = 5; + seekerMaxRange = 5200; // Range from the missile which the seeker can visually search + + // Attack profile type selection + defaultAttackProfile = "DIR"; + attackProfiles[] = {"DIR"}; +}; \ No newline at end of file diff --git a/addons/missileGuidanceCompat/CfgMissileKH25.hpp b/addons/missileGuidanceCompat/CfgMissileKH25.hpp new file mode 100644 index 00000000..884b71c5 --- /dev/null +++ b/addons/missileGuidanceCompat/CfgMissileKH25.hpp @@ -0,0 +1,27 @@ +class ace_missileguidance { + enabled = 1; + + pitchRate = 20; + yawRate = 20; + + canVanillaLock = 0; + + defaultSeekerType = "SALH"; + seekerTypes[] = {"SALH"}; + + defaultSeekerLockMode = "LOAL"; + seekerLockModes[] = {"LOAL"}; + + defaultNavigationType = "AugmentedProportionalNavigation"; + navigationTypes[] = { "AugmentedProportionalNavigation" }; + + seekLastTargetPos = 1; + seekerAngle = 40; + seekerAccuracy = 1; + + seekerMinRange = 1; + seekerMaxRange = 10000; + + defaultAttackProfile = "maverick"; + attackProfiles[] = {"maverick"}; +}; \ No newline at end of file diff --git a/addons/missileGuidanceCompat/CfgMissileKH29.hpp b/addons/missileGuidanceCompat/CfgMissileKH29.hpp new file mode 100644 index 00000000..884b71c5 --- /dev/null +++ b/addons/missileGuidanceCompat/CfgMissileKH29.hpp @@ -0,0 +1,27 @@ +class ace_missileguidance { + enabled = 1; + + pitchRate = 20; + yawRate = 20; + + canVanillaLock = 0; + + defaultSeekerType = "SALH"; + seekerTypes[] = {"SALH"}; + + defaultSeekerLockMode = "LOAL"; + seekerLockModes[] = {"LOAL"}; + + defaultNavigationType = "AugmentedProportionalNavigation"; + navigationTypes[] = { "AugmentedProportionalNavigation" }; + + seekLastTargetPos = 1; + seekerAngle = 40; + seekerAccuracy = 1; + + seekerMinRange = 1; + seekerMaxRange = 10000; + + defaultAttackProfile = "maverick"; + attackProfiles[] = {"maverick"}; +}; \ No newline at end of file diff --git a/addons/missileGuidanceCompat/CfgMissileKobra.hpp b/addons/missileGuidanceCompat/CfgMissileKobra.hpp new file mode 100644 index 00000000..d628565d --- /dev/null +++ b/addons/missileGuidanceCompat/CfgMissileKobra.hpp @@ -0,0 +1,39 @@ +class ace_missileguidance { + enabled = 1; + + pitchRate = 45; // Minium flap deflection for guidance + yawRate = 45; // Maximum flap deflection for guidance + + canVanillaLock = 0; // Can this default vanilla lock? Only applicable to non-cadet mode + + showTrail = 1; + + // Guidance type for munitions + defaultSeekerType = "SACLOS"; + seekerTypes[] = { "SACLOS" }; + + defaultSeekerLockMode = "LOAL"; + seekerLockModes[] = { "LOAL", "LOBL" }; + + defaultNavigationType = "Line"; + navigationTypes[] = { "Line" }; + + lineGainP = 16; + lineGainD = 9.5; + + initialPitch = 2; + + seekLastTargetPos = 0; // seek last target position [if seeker loses LOS of target, continue to last known pos] + seekerAngle = 30; // Angle from the shooter's view that can track the missile + seekerAccuracy = 1; // seeker accuracy multiplier + + seekerMinRange = 75; + seekerMaxRange = 5000; // Range from the missile which the seeker can visually search + + correctionDistance = 30; // distance from center of crosshair where missile slows down + offsetFromCrosshair[] = { 0, 0, 0 }; // where the missile wants to stay in relation to the center of the crosshair. + + // Attack profile type selection + defaultAttackProfile = "BEAM"; + attackProfiles[] = {"BEAM"}; +}; \ No newline at end of file diff --git a/addons/missileGuidanceCompat/CfgMissileKonkurs.hpp b/addons/missileGuidanceCompat/CfgMissileKonkurs.hpp new file mode 100644 index 00000000..44446d5f --- /dev/null +++ b/addons/missileGuidanceCompat/CfgMissileKonkurs.hpp @@ -0,0 +1,38 @@ +class ace_missileguidance { + enabled = 1; + + pitchRate = 45; // Minium flap deflection for guidance + yawRate = 45; // Maximum flap deflection for guidance + + canVanillaLock = 0; // Can this default vanilla lock? Only applicable to non-cadet mode + + showTrail = 1; + + // Guidance type for munitions + defaultSeekerType = "SACLOS"; + seekerTypes[] = { "SACLOS" }; + + defaultSeekerLockMode = "LOAL"; + seekerLockModes[] = { "LOAL", "LOBL" }; + + defaultNavigationType = "Line"; + navigationTypes[] = { "Line" }; + + lineGainP = 10; + lineGainD = 8.5; + + initialPitch = 2; + + seekLastTargetPos = 0; // seek last target position [if seeker loses LOS of target, continue to last known pos] + seekerAngle = 30; // Angle from the shooter's view that can track the missile + seekerAccuracy = 1; // seeker accuracy multiplier + + seekerMinRange = 75; + seekerMaxRange = 4000; // Range from the missile which the seeker can visually search + + offsetFromCrosshair[] = { 0, 0, 0 }; // where the missile wants to stay in relation to the center of the crosshair. + + // Attack profile type selection + defaultAttackProfile = "WIRE"; + attackProfiles[] = {"WIRE"}; +}; \ No newline at end of file diff --git a/addons/missileGuidanceCompat/CfgMissileKornet.hpp b/addons/missileGuidanceCompat/CfgMissileKornet.hpp new file mode 100644 index 00000000..d69eefb8 --- /dev/null +++ b/addons/missileGuidanceCompat/CfgMissileKornet.hpp @@ -0,0 +1,39 @@ +class ace_missileguidance { + enabled = 1; + + pitchRate = 45; // Minium flap deflection for guidance + yawRate = 45; // Maximum flap deflection for guidance + + canVanillaLock = 0; // Can this default vanilla lock? Only applicable to non-cadet mode + + showTrail = 1; + + // Guidance type for munitions + defaultSeekerType = "SACLOS"; + seekerTypes[] = { "SACLOS" }; + + defaultSeekerLockMode = "LOAL"; + seekerLockModes[] = { "LOAL", "LOBL" }; + + defaultNavigationType = "Line"; + navigationTypes[] = { "Line" }; + + lineGainP = 16; + lineGainD = 10.44; + + initialPitch = 2; + + seekLastTargetPos = 0; // seek last target position [if seeker loses LOS of target, continue to last known pos] + seekerAngle = 30; // Angle from the shooter's view that can track the missile + seekerAccuracy = 1; // seeker accuracy multiplier + + seekerMinRange = 75; + seekerMaxRange = 5000; // Range from the missile which the seeker can visually search + + correctionDistance = 30; // distance from center of crosshair where missile slows down + offsetFromCrosshair[] = { 0, 0, 0 }; // where the missile wants to stay in relation to the center of the crosshair. + + // Attack profile type selection + defaultAttackProfile = "BEAM"; + attackProfiles[] = {"BEAM"}; +}; \ No newline at end of file diff --git a/addons/missileGuidanceCompat/CfgMissileMalyutka.hpp b/addons/missileGuidanceCompat/CfgMissileMalyutka.hpp new file mode 100644 index 00000000..a2ac5181 --- /dev/null +++ b/addons/missileGuidanceCompat/CfgMissileMalyutka.hpp @@ -0,0 +1,37 @@ +class ace_missileguidance { + enabled = 1; + + pitchRate = 15; // Minium flap deflection for guidance + yawRate = 15; // Maximum flap deflection for guidance + + canVanillaLock = 0; // Can this default vanilla lock? Only applicable to non-cadet mode + + showTrail = 1; + + // Guidance type for munitions + defaultSeekerType = "MCLOS"; + seekerTypes[] = { "MCLOS" }; + + defaultSeekerLockMode = "LOAL"; + seekerLockModes[] = { "LOAL" }; + + defaultNavigationType = "Line"; + navigationTypes[] = { "Line" }; + + lineGainP = 5; + lineGainD = 0; + + seekLastTargetPos = 0; // seek last target position [if seeker loses LOS of target, continue to last known pos] + seekerAngle = 30; // Angle from the shooter's view that can track the missile + seekerAccuracy = 1; // seeker accuracy multiplier + + seekerMinRange = 0; + seekerMaxRange = 2500; // Range from the missile which the seeker can visually search + + correctionDistance = 0; // distance from center of crosshair where missile slows down + offsetFromCrosshair[] = { 0, 0, 0 }; // where the missile wants to stay in relation to the center of the crosshair. + + // Attack profile type selection + defaultAttackProfile = "WIRE"; + attackProfiles[] = {"WIRE"}; +}; \ No newline at end of file diff --git a/addons/missileGuidanceCompat/CfgMissileMetis.hpp b/addons/missileGuidanceCompat/CfgMissileMetis.hpp new file mode 100644 index 00000000..55b2b2b8 --- /dev/null +++ b/addons/missileGuidanceCompat/CfgMissileMetis.hpp @@ -0,0 +1,38 @@ +class ace_missileguidance { + enabled = 1; + + pitchRate = 50; // Minium flap deflection for guidance + yawRate = 50; // Maximum flap deflection for guidance + initialPitch = 2; + + canVanillaLock = 0; // Can this default vanilla lock? Only applicable to non-cadet mode + + showTrail = 1; + + // Guidance type for munitions + defaultSeekerType = "SACLOS"; + seekerTypes[] = { "SACLOS" }; + + defaultSeekerLockMode = "LOAL"; + seekerLockModes[] = { "LOAL", "LOBL" }; + + defaultNavigationType = "Line"; + navigationTypes[] = { "Line" }; + + lineGainP = 16; + lineGainD = 10.44; + + seekLastTargetPos = 0; // seek last target position [if seeker loses LOS of target, continue to last known pos] + seekerAngle = 15; // Angle from the shooter's view that can track the missile + seekerAccuracy = 1; // seeker accuracy multiplier + + seekerMinRange = 80; + seekerMaxRange = 1000; // Range from the missile which the seeker can visually search + + correctionDistance = 3; // distance from center of crosshair where missile slows down + offsetFromCrosshair[] = { 0, 0, 0 }; // where the missile wants to stay in relation to the center of the crosshair. + + // Attack profile type selection + defaultAttackProfile = "WIRE"; + attackProfiles[] = {"WIRE"}; +}; \ No newline at end of file diff --git a/addons/missileGuidanceCompat/CfgMissileMilan.hpp b/addons/missileGuidanceCompat/CfgMissileMilan.hpp new file mode 100644 index 00000000..52bb862d --- /dev/null +++ b/addons/missileGuidanceCompat/CfgMissileMilan.hpp @@ -0,0 +1,38 @@ +class ace_missileguidance { + enabled = 1; + + pitchRate = 60; // Minium flap deflection for guidance + yawRate = 60; // Maximum flap deflection for guidance + + canVanillaLock = 0; // Can this default vanilla lock? Only applicable to non-cadet mode + + showTrail = 0; + + // Guidance type for munitions + defaultSeekerType = "SACLOS"; + seekerTypes[] = { "SACLOS" }; + + defaultSeekerLockMode = "LOAL"; + seekerLockModes[] = { "LOAL", "LOBL" }; + + defaultNavigationType = "Line"; + navigationTypes[] = { "Line" }; + + lineGainP = 25; + lineGainD = 12; + + initialPitch = -0.4; + + seekLastTargetPos = 0; // seek last target position [if seeker loses LOS of target, continue to last known pos] + seekerAngle = 5; // Angle from the shooter's view that can track the missile, implemented + seekerAccuracy = 1; // seeker accuracy multiplier, not implemented? + + seekerMinRange = 100; + seekerMaxRange = 2000; // Range from the missile which the seeker can visually search + + offsetFromCrosshair[] = { 0, 0, 0 }; // where the missile wants to stay in relation to the center of the crosshair. + + // Attack profile type selection + defaultAttackProfile = "WIRE"; + attackProfiles[] = {"WIRE"}; +}; \ No newline at end of file diff --git a/addons/missileGuidanceCompat/CfgMissileMolniya.hpp b/addons/missileGuidanceCompat/CfgMissileMolniya.hpp new file mode 100644 index 00000000..0dc7b50d --- /dev/null +++ b/addons/missileGuidanceCompat/CfgMissileMolniya.hpp @@ -0,0 +1,32 @@ +class ace_missileguidance { + enabled = 1; + + pitchRate = 45; // Minium flap deflection for guidance + yawRate = 45; // Maximum flap deflection for guidance + + canVanillaLock = 1; // Can this default vanilla lock? Only applicable to non-cadet mode + + // Guidance type for munitions + defaultSeekerType = "IR"; + seekerTypes[] = { "IR" }; + + flareDistanceFilter = 50; + flareAngleFilter = 0.8; // can filter out flares that are >= flareAngleFilter to known target velocity + + defaultSeekerLockMode = "LOBL"; + seekerLockModes[] = { "LOBL" }; + + defaultNavigationType = "AugmentedProportionalNavigation"; + navigationTypes[] = { "AugmentedProportionalNavigation" }; + + seekLastTargetPos = 0; // seek last target position [if seeker loses LOS of target, continue to last known pos] + seekerAngle = 40; // Angle from the shooter's view that can track the missile + seekerAccuracy = 0.85; // seeker accuracy multiplier + + seekerMinRange = 75; + seekerMaxRange = 5000; // Range from the missile which the seeker can visually search + + // Attack profile type selection + defaultAttackProfile = "DIR"; + attackProfiles[] = {"DIR"}; +}; \ No newline at end of file diff --git a/addons/missileGuidanceCompat/CfgMissileR73.hpp b/addons/missileGuidanceCompat/CfgMissileR73.hpp new file mode 100644 index 00000000..d1da548c --- /dev/null +++ b/addons/missileGuidanceCompat/CfgMissileR73.hpp @@ -0,0 +1,32 @@ +class ace_missileguidance { + enabled = 1; + + pitchRate = 35; // Minium flap deflection for guidance + yawRate = 35; // Maximum flap deflection for guidance + + canVanillaLock = 1; // Can this default vanilla lock? Only applicable to non-cadet mode + + // Guidance type for munitions + defaultSeekerType = "IR"; + seekerTypes[] = { "IR" }; + + flareDistanceFilter = 50; + flareAngleFilter = 0.8; // can filter out flares that are >= flareAngleFilter to known target velocity + + defaultSeekerLockMode = "LOBL"; + seekerLockModes[] = { "LOBL" }; + + defaultNavigationType = "AugmentedProportionalNavigation"; + navigationTypes[] = { "AugmentedProportionalNavigation" }; + + seekLastTargetPos = 0; // seek last target position [if seeker loses LOS of target, continue to last known pos] + seekerAngle = 40; // Angle from the shooter's view that can track the missile + seekerAccuracy = 0.85; // seeker accuracy multiplier + + seekerMinRange = 75; + seekerMaxRange = 5000; // Range from the missile which the seeker can visually search + + // Attack profile type selection + defaultAttackProfile = "DIR"; + attackProfiles[] = {"DIR"}; +}; \ No newline at end of file diff --git a/addons/missileGuidanceCompat/CfgMissileR77.hpp b/addons/missileGuidanceCompat/CfgMissileR77.hpp new file mode 100644 index 00000000..a7d5b3ba --- /dev/null +++ b/addons/missileGuidanceCompat/CfgMissileR77.hpp @@ -0,0 +1,38 @@ +flightProfiles[] = {"Direct", "TopDown"}; +class Direct {}; // dummy to allow for F cycling of missile mode +class TopDown {}; +class ace_missileguidance { + enabled = 1; + + pitchRate = 40; // Minium flap deflection for guidance + yawRate = 40; // Maximum flap deflection for guidance + + canVanillaLock = 1; // Can this default vanilla lock? Only applicable to non-cadet mode + + // Guidance type for munitions + defaultSeekerType = "DopplerRadar"; + seekerTypes[] = { "DopplerRadar" }; + lockableTypes[] = {"Air"}; + + minimumSpeedFilter = 15; // filter out targets that have a closing velocity less than this + minimumTimeFilter = 0.00005; // filter out targets that are this close to the ground (speed of light) + maxTerrainCheck = 16000; // How far we should check for terrain + + defaultSeekerLockMode = "LOAL"; + seekerLockModes[] = { "LOAL", "LOBL" }; + + defaultNavigationType = "ZeroEffortMiss"; + navigationTypes[] = { "ZeroEffortMiss" }; + + seekLastTargetPos = 0; // seek last target position [if seeker loses LOS of target, continue to last known pos] + seekerAngle = 50; // Angle from the shooter's view that can track the missile + seekerAccuracy = 1; // seeker accuracy multiplier + + seekerMinRange = 75; + seekerMaxRange = 2500; // Range from the missile which the seeker can visually search + + // Attack profile type selection + defaultAttackProfile = "DIR"; + attackProfiles[] = {"DIR", "LOFT"}; + useModeForAttackProfile = 1; +}; \ No newline at end of file diff --git a/addons/missileGuidanceCompat/CfgMissileRefleks.hpp b/addons/missileGuidanceCompat/CfgMissileRefleks.hpp new file mode 100644 index 00000000..d69eefb8 --- /dev/null +++ b/addons/missileGuidanceCompat/CfgMissileRefleks.hpp @@ -0,0 +1,39 @@ +class ace_missileguidance { + enabled = 1; + + pitchRate = 45; // Minium flap deflection for guidance + yawRate = 45; // Maximum flap deflection for guidance + + canVanillaLock = 0; // Can this default vanilla lock? Only applicable to non-cadet mode + + showTrail = 1; + + // Guidance type for munitions + defaultSeekerType = "SACLOS"; + seekerTypes[] = { "SACLOS" }; + + defaultSeekerLockMode = "LOAL"; + seekerLockModes[] = { "LOAL", "LOBL" }; + + defaultNavigationType = "Line"; + navigationTypes[] = { "Line" }; + + lineGainP = 16; + lineGainD = 10.44; + + initialPitch = 2; + + seekLastTargetPos = 0; // seek last target position [if seeker loses LOS of target, continue to last known pos] + seekerAngle = 30; // Angle from the shooter's view that can track the missile + seekerAccuracy = 1; // seeker accuracy multiplier + + seekerMinRange = 75; + seekerMaxRange = 5000; // Range from the missile which the seeker can visually search + + correctionDistance = 30; // distance from center of crosshair where missile slows down + offsetFromCrosshair[] = { 0, 0, 0 }; // where the missile wants to stay in relation to the center of the crosshair. + + // Attack profile type selection + defaultAttackProfile = "BEAM"; + attackProfiles[] = {"BEAM"}; +}; \ No newline at end of file diff --git a/addons/missileGuidanceCompat/CfgMissileShturm.hpp b/addons/missileGuidanceCompat/CfgMissileShturm.hpp new file mode 100644 index 00000000..5b81860f --- /dev/null +++ b/addons/missileGuidanceCompat/CfgMissileShturm.hpp @@ -0,0 +1,38 @@ +class ace_missileguidance { + enabled = 1; + + pitchRate = 45; // Minium flap deflection for guidance + yawRate = 45; // Maximum flap deflection for guidance + + canVanillaLock = 0; // Can this default vanilla lock? Only applicable to non-cadet mode + + showTrail = 1; + + // Guidance type for munitions + defaultSeekerType = "SACLOS"; + seekerTypes[] = { "SACLOS" }; + + defaultSeekerLockMode = "LOAL"; + seekerLockModes[] = { "LOAL", "LOBL" }; + + defaultNavigationType = "Line"; + navigationTypes[] = { "Line" }; + + lineGainP = 16; + lineGainD = 10.44; + + initialPitch = 2; + + seekLastTargetPos = 0; // seek last target position [if seeker loses LOS of target, continue to last known pos] + seekerAngle = 30; // Angle from the shooter's view that can track the missile + seekerAccuracy = 1; // seeker accuracy multiplier + + seekerMinRange = 75; + seekerMaxRange = 4000; // Range from the missile which the seeker can visually search + + offsetFromCrosshair[] = { 0, 0, 0 }; // where the missile wants to stay in relation to the center of the crosshair. + + // Attack profile type selection + defaultAttackProfile = "BEAM"; + attackProfiles[] = {"BEAM"}; +}; \ No newline at end of file diff --git a/addons/missileGuidanceCompat/CfgMissileStrela.hpp b/addons/missileGuidanceCompat/CfgMissileStrela.hpp new file mode 100644 index 00000000..dc127778 --- /dev/null +++ b/addons/missileGuidanceCompat/CfgMissileStrela.hpp @@ -0,0 +1,32 @@ +class ace_missileguidance { + enabled = 1; + + pitchRate = 30; // Minium flap deflection for guidance + yawRate = 30; // Maximum flap deflection for guidance + + canVanillaLock = 1; // Can this default vanilla lock? Only applicable to non-cadet mode + + // Guidance type for munitions + defaultSeekerType = "IR"; + seekerTypes[] = { "IR" }; + + flareDistanceFilter = 100; + flareAngleFilter = 1.6; // can filter out flares that are >= flareAngleFilter to known target velocity + + defaultSeekerLockMode = "LOBL"; + seekerLockModes[] = { "LOBL" }; + + defaultNavigationType = "ProportionalNavigation"; + navigationTypes[] = { "ProportionalNavigation" }; + + seekLastTargetPos = 0; // seek last target position [if seeker loses LOS of target, continue to last known pos] + seekerAngle = 45; // Angle from the shooter's view that can track the missile + seekerAccuracy = 0.6; // seeker accuracy multiplier + + seekerMinRange = 10; + seekerMaxRange = 3700; // Range from the missile which the seeker can visually search + + // Attack profile type selection + defaultAttackProfile = "DIR"; + attackProfiles[] = {"DIR"}; +}; \ No newline at end of file diff --git a/addons/missileGuidanceCompat/CfgMissileTypesNato.hpp b/addons/missileGuidanceCompat/CfgMissileTypesNato.hpp deleted file mode 100644 index 1d1af0ab..00000000 --- a/addons/missileGuidanceCompat/CfgMissileTypesNato.hpp +++ /dev/null @@ -1,20 +0,0 @@ -class ACEGVAR(missileguidance,type_AMRAAM); -class ACEGVAR(missileguidance,type_ASRAAM); -class ACEGVAR(missileguidance,type_Dagr); -class ACEGVAR(missileguidance,type_Dragon); -class ACEGVAR(missileguidance,type_ESSM); -class ACEGVAR(missileguidance,type_Hellfire); -class ACEGVAR(missileguidance,type_Hot); -class ACEGVAR(missileguidance,type_Javelin); -class ACEGVAR(missileguidance,type_Jdam); -class ACEGVAR(missileguidance,type_Maverick); -class ACEGVAR(missileguidance,type_Milan); -class ACEGVAR(missileguidance,type_Nlaw); -class ACEGVAR(missileguidance,type_Patriot); -class ACEGVAR(missileguidance,type_Paveway); -class ACEGVAR(missileguidance,type_RAM); -class ACEGVAR(missileguidance,type_RBS70); -class ACEGVAR(missileguidance,type_Redeye); -class ACEGVAR(missileguidance,type_Sidewinder); -class ACEGVAR(missileguidance,type_Stinger); -class ACEGVAR(missileguidance,type_TOW); \ No newline at end of file diff --git a/addons/missileGuidanceCompat/CfgMissileTypesWarsaw.hpp b/addons/missileGuidanceCompat/CfgMissileTypesWarsaw.hpp deleted file mode 100644 index b110265e..00000000 --- a/addons/missileGuidanceCompat/CfgMissileTypesWarsaw.hpp +++ /dev/null @@ -1,25 +0,0 @@ -class ACEGVAR(missileguidance,type_Ataka); -class ACEGVAR(missileguidance,type_Bastion); -class ACEGVAR(missileguidance,type_Drakon); -class ACEGVAR(missileguidance,type_Fagot); -class ACEGVAR(missileguidance,type_Falanga); -class ACEGVAR(missileguidance,type_Fleyta); -class ACEGVAR(missileguidance,type_Igla); -class ACEGVAR(missileguidance,type_KAB); -class ACEGVAR(missileguidance,type_KH25); -class ACEGVAR(missileguidance,type_KH29); -class ACEGVAR(missileguidance,type_Kobra); -class ACEGVAR(missileguidance,type_Konkurs); -class ACEGVAR(missileguidance,type_Kornet); -class ACEGVAR(missileguidance,type_Malyutka); -class ACEGVAR(missileguidance,type_Metis); -class ACEGVAR(missileguidance,type_Molniya); -class ACEGVAR(missileguidance,type_R73); -class ACEGVAR(missileguidance,type_R74); -class ACEGVAR(missileguidance,type_R77); -class ACEGVAR(missileguidance,type_Refleks); -class ACEGVAR(missileguidance,type_S400); -class ACEGVAR(missileguidance,type_Shturm); -class ACEGVAR(missileguidance,type_Strela); -class ACEGVAR(missileguidance,type_Vikhr); -class ACEGVAR(missileguidance,type_Vympel); \ No newline at end of file diff --git a/addons/missileGuidanceCompat/CfgMissileVikhr.hpp b/addons/missileGuidanceCompat/CfgMissileVikhr.hpp new file mode 100644 index 00000000..d68e4bad --- /dev/null +++ b/addons/missileGuidanceCompat/CfgMissileVikhr.hpp @@ -0,0 +1,34 @@ +class ace_missileguidance { + enabled = 1; + showTrail = 1; + + pitchRate = 60; // Minium flap deflection for guidance + yawRate = 60; // Maximum flap deflection for guidance + + canVanillaLock = 1; // Can this default vanilla lock? Only applicable to non-cadet mode + + // Guidance type for munitions + defaultSeekerType = "SACLOS"; + seekerTypes[] = { "SACLOS" }; + + defaultSeekerLockMode = "LOBL"; + seekerLockModes[] = { "LOBL" }; + + defaultNavigationType = "Line"; + navigationTypes[] = { "Line" }; + + lineGainP = 20; + lineGainD = 16; + correctionDistance = 5; + + seekLastTargetPos = 0; // seek last target position [if seeker loses LOS of target, continue to last known pos] + seekerAngle = 15; // Angle from the shooter's view that can track the missile + seekerAccuracy = 1; // seeker accuracy multiplier + + seekerMinRange = 30; + seekerMaxRange = 12000; // Range from the missile which the seeker can visually search + + // Attack profile type selection + defaultAttackProfile = "BEAM"; + attackProfiles[] = {"BEAM"}; +}; \ No newline at end of file diff --git a/addons/missileGuidanceCompat/CfgMissileVympel.hpp b/addons/missileGuidanceCompat/CfgMissileVympel.hpp new file mode 100644 index 00000000..d1da548c --- /dev/null +++ b/addons/missileGuidanceCompat/CfgMissileVympel.hpp @@ -0,0 +1,32 @@ +class ace_missileguidance { + enabled = 1; + + pitchRate = 35; // Minium flap deflection for guidance + yawRate = 35; // Maximum flap deflection for guidance + + canVanillaLock = 1; // Can this default vanilla lock? Only applicable to non-cadet mode + + // Guidance type for munitions + defaultSeekerType = "IR"; + seekerTypes[] = { "IR" }; + + flareDistanceFilter = 50; + flareAngleFilter = 0.8; // can filter out flares that are >= flareAngleFilter to known target velocity + + defaultSeekerLockMode = "LOBL"; + seekerLockModes[] = { "LOBL" }; + + defaultNavigationType = "AugmentedProportionalNavigation"; + navigationTypes[] = { "AugmentedProportionalNavigation" }; + + seekLastTargetPos = 0; // seek last target position [if seeker loses LOS of target, continue to last known pos] + seekerAngle = 40; // Angle from the shooter's view that can track the missile + seekerAccuracy = 0.85; // seeker accuracy multiplier + + seekerMinRange = 75; + seekerMaxRange = 5000; // Range from the missile which the seeker can visually search + + // Attack profile type selection + defaultAttackProfile = "DIR"; + attackProfiles[] = {"DIR"}; +}; \ No newline at end of file diff --git a/addons/missileGuidanceCompat/config.cpp b/addons/missileGuidanceCompat/config.cpp index 23b65070..2a57892e 100644 --- a/addons/missileGuidanceCompat/config.cpp +++ b/addons/missileGuidanceCompat/config.cpp @@ -4,7 +4,7 @@ class CfgPatches { class ADDON { units[] = {}; requiredVersion = REQUIRED_VERSION; - requiredAddons[] = {"potato_core", "ace_missileguidance"}; + requiredAddons[] = {"potato_core", "ace_missileguidance", "CUP_Weapons_LoadOrder"}; skipWhenMissingDependencies = 1; author = "Potato"; authors[] = {"Dani (TCVM)"}; @@ -13,6 +13,5 @@ class CfgPatches { }; }; -#include "CfgMissileTypesWarsaw.hpp" -#include "CfgMissileTypesNato.hpp" #include "CfgAmmo.hpp" +#include "CfgMagazines.hpp" diff --git a/addons/missileGuidanceCompat/patchCUP/config.cpp b/addons/missileGuidanceCompat/patchCUP/config.cpp deleted file mode 100644 index e0dce54e..00000000 --- a/addons/missileGuidanceCompat/patchCUP/config.cpp +++ /dev/null @@ -1,172 +0,0 @@ -#include "\z\potato\addons\missileGuidanceCompat\script_component.hpp" -#undef COMPONENT -#define COMPONENT missileGuidanceCompat_patchCUP - -class CfgPatches { - class ADDON { - units[] = {}; - weapons[] = {}; - requiredVersion = REQUIRED_VERSION; - requiredAddons[] = {"potato_missileGuidanceCompat", "CUP_Weapons_LoadOrder"}; - skipWhenMissingDependencies = 1; - author = "Bourbon Warfare"; - authorUrl = "https://github.com/BourbonWarfare/POTATO"; - VERSION_CONFIG; - }; -}; - -#include "../CfgMissileTypesWarsaw.hpp" -#include "../CfgMissileTypesNato.hpp" - -class CfgMagazines { - class CA_LauncherMagazine; - class CUP_Dragon_EP1_M: CA_LauncherMagazine { - ammo = "ace_dragon_super"; - initSpeed = 120; - }; -}; - -class CfgAmmo { - class M_Titan_AA; - class MissileBase; - class M_Titan_AT; - class Bo_GBU12_LGB; - - class CUP_M_9K32_Strela_2_AA: M_Titan_AA { - maneuvrability = 0; - ACE_MISSILE(Strela); - }; - - class CUP_M_9K38_Igla_AA: M_Titan_AA { - maneuvrability = 0; - ACE_MISSILE(Igla); - }; - - class CUP_M_9M17P_AT2_Falanga_AT: MissileBase { - maneuvrability = 0; - ACE_MISSILE(Falanga); - }; - - class CUP_M_9M17P_AT3_Sagger_AT: MissileBase { - maneuvrability = 0; - ACE_MISSILE(Fleyta); - }; - - class CUP_M_9M113_AT5_Spandrel_AT: M_Titan_AT { - maneuvrability = 0; - ACE_MISSILE(Konkurs); - }; - - class CUP_M_Shturm_9M114_AT6_Spiral_AT: MissileBase { - maneuvrability = 0; - ACE_MISSILE(Shturm); - }; - - class CUP_M_Ataka_V_9M120_AT9_Spiral_2_AT: MissileBase { - maneuvrability = 0; - ACE_MISSILE(Ataka); - }; - - class CUP_M_9K116_1_Bastion_AT10_Stabber_AT: MissileBase { - maneuvrability = 0; - ACE_MISSILE(Bastion); - }; - - class CUP_M_9M119M_Refleks_AT11_Sniper_AT: MissileBase { - maneuvrability = 0; - ACE_MISSILE(Refleks); - }; - - class CUP_M_9K115_2_AT13_Saxhorn_2_AT: MissileBase { - maneuvrability = 0; - ACE_MISSILE(Metis); - }; - - class CUP_M_9M133_1_AT14_Spriggan_AT: MissileBase { - maneuvrability = 0; - ACE_MISSILE(Kornet); - }; - - class CUP_M_9M133_1_AT14_Spriggan_HE: CUP_M_9M133_1_AT14_Spriggan_AT { - maneuvrability = 0; - ACE_MISSILE(Kornet); - }; - - class CUP_M_9K121_Vikhr_AT16_Scallion_AT: MissileBase { - maneuvrability = 0; - ACE_MISSILE(Vikhr); - }; - - class CUP_M_KH29L_AT: MissileBase { - maneuvrability = 0; - ACE_MISSILE(KH29); - }; - - class CUP_M_AGM_114K_Hellfire_II_AT: MissileBase { - maneuvrability = 0; - ACE_MISSILE(Hellfire); - }; - - class CUP_M_AGM_114L_Hellfire_II_AT: MissileBase { - class ace_missileguidance: ACEGVAR(missileguidance,type_Hellfire) { - enabled = 1; - // Guidance type for munitions - defaultSeekerType = "MillimeterWaveRadar"; - seekerTypes[] = { "MillimeterWaveRadar" }; - - seekLastTargetPos = 0; // seek last target position [if seeker loses LOS of target, continue to last known pos] - seekerAngle = 70; // Angle in front of the missile which can be searched - seekerAccuracy = 1; // seeker accuracy multiplier - - seekerMinRange = 1; - activeRadarEngageDistance = 1000; - seekerMaxRange = 2000; // distance that the hellfire internal radar can scan - }; - }; - - class CUP_M_AIM_9L_Sidewinder_AA: MissileBase { - maneuvrability = 0; - ACE_MISSILE(Sidewinder); - }; - - class CUP_M_Stinger_AA: MissileBase { - maneuvrability = 0; - ACE_MISSILE(Stinger); - }; - - class EGVAR(missileGuidanceCompat,redeye): CUP_M_Stinger_AA { // BWC naming, used in CWR - maneuvrability = 0; - ACE_MISSILE(Redeye); - }; - - class CUP_M_RBS70_AA: MissileBase { - maneuvrability = 0; - ACE_MISSILE(RBS70); - }; - - class CUP_AGM65pod_AT: MissileBase { - maneuvrability = 0; - ACE_MISSILE(Maverick); - }; - - class CUP_R_TOW_AT: M_Titan_AT { - maneuvrability = 0; - ACE_MISSILE(TOW); - }; - - class CUP_R_TOW2_AT: CUP_R_TOW_AT { - maneuvrability = 0; - ACE_MISSILE(TOW); - }; - - class CUP_Bo_GBU12_LGB: Bo_GBU12_LGB { - maneuvrability = 0; // no maneuvrability so that default guidance doesnt work - ACE_MISSILE(Paveway); - }; - - class CUP_Bo_KAB250_LGB: Bo_GBU12_LGB { - maneuvrability = 0; // no maneuvrability so that default guidance doesnt work - ACE_MISSILE(KAB); - }; -}; - diff --git a/addons/missileGuidanceCompat/patchGM/config.cpp b/addons/missileGuidanceCompat/patchGM/config.cpp index f9246f40..c41cefda 100644 --- a/addons/missileGuidanceCompat/patchGM/config.cpp +++ b/addons/missileGuidanceCompat/patchGM/config.cpp @@ -22,15 +22,12 @@ class CfgPatches { }; }; -#include "../CfgMissileTypesNato.hpp" -#include "../CfgMissileTypesWarsaw.hpp" - class CfgAmmo { class gm_missile_saclos_base; // Bastion class gm_missile_bastion_base: gm_missile_saclos_base { maneuvrability = 0; - ACE_MISSILE(Bastion); + #include "../CfgMissileBastion.hpp" }; class gm_missile_bastion_heat_9M117: gm_missile_bastion_base { class ace_missileguidance: ace_missileguidance { @@ -55,7 +52,7 @@ class CfgAmmo { // Fagot missile class gm_missile_fagot_base: gm_missile_saclos_base { maneuvrability = 0; - ACE_MISSILE(Fagot); + #include "../CfgMissileFagot.hpp" }; class gm_missile_fagot_heat_9m111: gm_missile_fagot_base { class ace_missileguidance: ace_missileguidance { @@ -63,6 +60,7 @@ class CfgAmmo { showTrail = 0; pitchRate = 25; yawRate = 25; + initialPitch = 0; lineGainP = 7; lineGainD = 4; }; @@ -70,7 +68,7 @@ class CfgAmmo { // HOT missile class gm_missile_hot_base: gm_missile_saclos_base { maneuvrability = 0; - ACE_MISSILE(Hot); + #include "../CfgMissileHOT.hpp" }; class gm_missile_hot_heat_dm72: gm_missile_hot_base { class ace_missileguidance: ace_missileguidance { @@ -87,7 +85,7 @@ class CfgAmmo { // Malyutka class gm_missile_maljutka_base: gm_missile_saclos_base { maneuvrability = 0; - ACE_MISSILE(Malyutka); + #include "../CfgMissileMalyutka.hpp" }; class gm_missile_maljutka_heat_9m14: gm_missile_maljutka_base { class ace_missileguidance: ace_missileguidance { @@ -104,28 +102,57 @@ class CfgAmmo { // Milan class gm_missile_milan_base: gm_missile_saclos_base { maneuvrability = 0; - ACE_MISSILE(Milan); + #include "../CfgMissileMilan.hpp" }; class gm_missile_milan_heat_dm82: gm_missile_milan_base { class ace_missileguidance: ace_missileguidance { enabled = 1; - initialPitch = 0.4; }; }; class gm_missile_milan_heat_dm92: gm_missile_milan_base { class ace_missileguidance: ace_missileguidance { enabled = 1; - initialPitch = 0.4; }; }; // AA Missiles class gm_rocket_72mm_HE_9m32m_base; class gm_rocket_72mm_HE_9m32m: gm_rocket_72mm_HE_9m32m_base { maneuvrability = 0; - ACE_MISSILE(Strela); + #include "../CfgMissileStrela.hpp" }; class gm_rocket_70mm_HE_m585_base; class gm_rocket_70mm_HE_m585: gm_rocket_70mm_HE_m585_base { - ACE_MISSILE(Redeye); + class ace_missileguidance { // from main CfgAmmo.hpp + enabled = 1; + + pitchRate = 27; // Minium flap deflection for guidance + yawRate = 27; // Maximum flap deflection for guidance + + canVanillaLock = 1; // Can this default vanilla lock? Only applicable to non-cadet mode + + // Guidance type for munitions + defaultSeekerType = "IR"; + seekerTypes[] = { "IR" }; + + flareDistanceFilter = 100; + flareAngleFilter = 2.0; // can filter out flares that are >= flareAngleFilter to known target velocity + + defaultSeekerLockMode = "LOBL"; + seekerLockModes[] = { "LOBL" }; + + defaultNavigationType = "ProportionalNavigation"; + navigationTypes[] = { "ProportionalNavigation" }; + + seekLastTargetPos = 0; // seek last target position [if seeker loses LOS of target, continue to last known pos] + seekerAngle = 45; // Angle from the shooter's view that can track the missile + seekerAccuracy = 0.4; // seeker accuracy multiplier + + seekerMinRange = 75; + seekerMaxRange = 4500; // Range from the missile which the seeker can visually search + + // Attack profile type selection + defaultAttackProfile = "DIR"; + attackProfiles[] = {"DIR"}; + }; }; }; diff --git a/addons/missileGuidanceCompat/patchMELB/config.cpp b/addons/missileGuidanceCompat/patchMELB/config.cpp index 8163f217..8d9167d5 100644 --- a/addons/missileGuidanceCompat/patchMELB/config.cpp +++ b/addons/missileGuidanceCompat/patchMELB/config.cpp @@ -15,7 +15,6 @@ class CfgPatches { }; }; -class ACEGVAR(missileguidance,type_Hellfire); class CfgAmmo { class Missile_AGM_02_F; @@ -24,6 +23,47 @@ class CfgAmmo { laserLock = 0; manualControl = 0; - ACE_MISSILE(Hellfire); + class ace_missileguidance { + enabled = 1; + + pitchRate = 30; // degrees per second + yawRate = 30; + + canVanillaLock = 0; // Can this default vanilla lock? Only applicable to non-cadet mode + + // Guidance type for munitions + defaultSeekerType = "SALH"; + seekerTypes[] = { "SALH" }; + + defaultSeekerLockMode = "LOAL"; + seekerLockModes[] = { "LOAL", "LOBL" }; + + defaultNavigationType = "Direct"; + navigationTypes[] = { "Direct", "ZeroEffortMiss" }; + + seekLastTargetPos = 1; // seek last target position [if seeker loses LOS of target, continue to last known pos] + seekerAngle = 70; // Angle in front of the missile which can be searched + seekerAccuracy = 1; // seeker accuracy multiplier + + seekerMinRange = 1; + seekerMaxRange = 8000; // Range from the missile which the seeker can visually search + + // Attack profile type selection + defaultAttackProfile = "hellfire"; + attackProfiles[] = {"hellfire", "hellfire_hi", "hellfire_lo"}; + + class navigationStates { + class initial { + transitionCondition = "ace_hellfire_fnc_midCourseTransition"; + navigationType = "Direct"; + }; + class terminal { + transitionCondition = ""; + navigationType = "ZeroEffortMiss"; + }; + // transitions from initial -> termimal + states[] = {"initial", "terminal"}; + }; + }; }; }; diff --git a/addons/missileGuidanceCompat/patchRHSAFRF/config.cpp b/addons/missileGuidanceCompat/patchRHSAFRF/config.cpp index cf88c0db..c64f53e8 100644 --- a/addons/missileGuidanceCompat/patchRHSAFRF/config.cpp +++ b/addons/missileGuidanceCompat/patchRHSAFRF/config.cpp @@ -15,7 +15,6 @@ class CfgPatches { }; }; -#include "../CfgMissileTypesWarsaw.hpp" class CfgAmmo { class Missile_AGM_01_F; @@ -33,15 +32,15 @@ class CfgAmmo { }; class rhs_ammo_9k32: M_Titan_AA { maneuvrability = 0; - ACE_MISSILE(Strela); + #include "../CfgMissileStrela.hpp" }; class rhs_ammo_9k38: rhs_ammo_9k32 { maneuvrability = 0; - ACE_MISSILE(Igla); + #include "../CfgMissileIgla.hpp" }; class rhs_ammo_9m114: rhs_ammo_atgmBase_base { maneuvrability = 0; - ACE_MISSILE(Shturm); + #include "../CfgMissileShturm.hpp" class EventHandlers: EventHandlers { class RHS_Guidance {}; }; @@ -70,7 +69,7 @@ class CfgAmmo { }; class rhs_ammo_9m120: rhs_ammo_atgmBase_base { maneuvrability = 0; - ACE_MISSILE(Ataka); + #include "../CfgMissileAtaka.hpp" class EventHandlers: EventHandlers { class RHS_Guidance {}; }; @@ -93,7 +92,7 @@ class CfgAmmo { }; class rhs_ammo_9m127: rhs_ammo_9m120 { maneuvrability = 0; - ACE_MISSILE(Vikhr); + #include "../CfgMissileVikhr.hpp" class EventHandlers: EventHandlers { class RHS_Guidance {}; }; @@ -105,7 +104,7 @@ class CfgAmmo { }; class rhs_ammo_r27t: rhs_ammo_r27_base { maneuvrability = 0; - ACE_MISSILE(Vympel); + #include "../CfgMissileVympel.hpp" }; class rhs_ammo_r27et: rhs_ammo_r27t { class ace_missileguidance: ace_missileguidance { @@ -114,7 +113,7 @@ class CfgAmmo { }; class rhs_ammo_r60_base: Missile_AA_04_F { maneuvrability = 0; - ACE_MISSILE(Molniya); + #include "../CfgMissileMolniya.hpp" }; class rhs_ammo_r60: rhs_ammo_r60_base { class ace_missileguidance: ace_missileguidance { @@ -129,7 +128,7 @@ class CfgAmmo { }; class rhs_ammo_r73: Missile_AA_04_F { maneuvrability = 0; - ACE_MISSILE(R73); + #include "../CfgMissileR73.hpp" }; class rhs_ammo_r73m: rhs_ammo_r73 { class ace_missileguidance: ace_missileguidance { @@ -148,7 +147,7 @@ class CfgAmmo { }; class rhs_ammo_r77: rhs_ammo_r73 { maneuvrability = 0; - ACE_MISSILE(R77); + #include "../CfgMissileR77.hpp" }; class rhs_ammo_r77m: rhs_ammo_r77 { class ace_missileguidance: ace_missileguidance { @@ -157,7 +156,7 @@ class CfgAmmo { }; class rhs_ammo_kh25_base: Missile_AGM_01_F { maneuvrability = 0; - ACE_MISSILE(KH25); + #include "../CfgMissileKH25.hpp" }; class rhs_ammo_kh25: rhs_ammo_kh25_base { class ace_missileguidance: ace_missileguidance { @@ -188,7 +187,7 @@ class CfgAmmo { }; class rhs_ammo_kh29_base: Missile_AGM_02_F { maneuvrability = 0; - ACE_MISSILE(KH29); + #include "../CfgMissileKH29.hpp" }; class rhs_ammo_kh29l: rhs_ammo_kh29_base { class ace_missileguidance: ace_missileguidance { @@ -217,7 +216,7 @@ class CfgAmmo { }; class rhs_ammo_9m14: rhs_ammo_atgmBase_base { maneuvrability = 0; - ACE_MISSILE(Malyutka); + #include "../CfgMissileMalyutka.hpp" class EventHandlers: EventHandlers { class RHS_Guidance {}; }; @@ -234,7 +233,7 @@ class CfgAmmo { }; class rhs_ammo_9m17: rhs_ammo_atgmBase_base { maneuvrability = 0; - ACE_MISSILE(Fleyta); + #include "../CfgMissileFleyta.hpp" class EventHandlers: EventHandlers { class RHS_Guidance {}; }; @@ -248,7 +247,7 @@ class CfgAmmo { }; class rhs_ammo_9m112: rhs_ammo_atgmCore_base { maneuvrability = 0; - ACE_MISSILE(Refleks); + #include "../CfgMissileRefleks.hpp" class EventHandlers: EventHandlers { class RHS_Guidance {}; }; @@ -270,11 +269,11 @@ class CfgAmmo { }; class rhs_ammo_9m128: rhs_ammo_atgmCore_base { maneuvrability = 0; - ACE_MISSILE(Kobra); + #include "../CfgMissileKobra.hpp" }; class rhs_ammo_9m111: rhs_ammo_atgmBase_base { maneuvrability = 0; - ACE_MISSILE(Fagot); + #include "../CfgMissileFagot.hpp" class EventHandlers: EventHandlers { class RHS_Guidance {}; }; @@ -287,7 +286,7 @@ class CfgAmmo { }; class rhs_ammo_9m113: rhs_ammo_atgmBase_base { maneuvrability = 0; - ACE_MISSILE(Konkurs); + #include "../CfgMissileKonkurs.hpp" class EventHandlers: EventHandlers { class RHS_Guidance {}; }; @@ -299,7 +298,7 @@ class CfgAmmo { }; class rhs_ammo_9m117: rhs_ammo_atgmCore_base { maneuvrability = 0; - ACE_MISSILE(Bastion); + #include "../CfgMissileBastion.hpp" class EventHandlers: EventHandlers { class RHS_Guidance {}; }; @@ -323,7 +322,7 @@ class CfgAmmo { }; class rhs_ammo_9m119: rhs_ammo_atgmCore_base { maneuvrability = 0; - ACE_MISSILE(Refleks); + #include "../CfgMissileRefleks.hpp" class EventHandlers: EventHandlers { class RHS_Guidance {}; }; @@ -340,7 +339,7 @@ class CfgAmmo { }; class rhs_ammo_9m115: rhs_ammo_9m119 { maneuvrability = 0; - ACE_MISSILE(Metis); + #include "../CfgMissileMetis.hpp" class EventHandlers: EventHandlers { class RHS_Guidance {}; }; @@ -364,14 +363,14 @@ class CfgAmmo { }; class rhs_ammo_9m133f: rhs_ammo_9m131f { maneuvrability = 0; - ACE_MISSILE(Konkurs); + #include "../CfgMissileKonkurs.hpp" class EventHandlers: EventHandlers { class RHS_Guidance {}; }; }; class rhs_ammo_9m133: rhs_ammo_atgmBase_base { maneuvrability = 0; - ACE_MISSILE(Konkurs); + #include "../CfgMissileKonkurs.hpp" class EventHandlers: EventHandlers { class RHS_Guidance {}; }; @@ -388,7 +387,7 @@ class CfgAmmo { }; class rhs_ammo_3m7: rhs_ammo_atgmBase_base { maneuvrability = 0; - ACE_MISSILE(Drakon); + #include "../CfgMissileDrakon.hpp" class EventHandlers: EventHandlers { class RHS_Guidance {}; }; diff --git a/addons/missileGuidanceCompat/script_component.hpp b/addons/missileGuidanceCompat/script_component.hpp index 0c7f26ea..c9b7f00c 100644 --- a/addons/missileGuidanceCompat/script_component.hpp +++ b/addons/missileGuidanceCompat/script_component.hpp @@ -6,5 +6,4 @@ // #define ENABLE_PERFORMANCE_COUNTERS #include "\z\potato\addons\core\script_macros.hpp" -#include "script_macros.hpp" diff --git a/addons/missileGuidanceCompat/script_macros.hpp b/addons/missileGuidanceCompat/script_macros.hpp deleted file mode 100644 index a2b6c703..00000000 --- a/addons/missileGuidanceCompat/script_macros.hpp +++ /dev/null @@ -1,2 +0,0 @@ -#define SCORE_2(a,b) a##_##b -#define ACE_MISSILE(missile) class ace_missileguidance: ACEGVAR(missileguidance,SCORE_2(type,missile)) { enabled = 1; } \ No newline at end of file diff --git a/addons/settings/XEH_preInit.sqf b/addons/settings/XEH_preInit.sqf index 2d9dba4d..c625bc47 100644 --- a/addons/settings/XEH_preInit.sqf +++ b/addons/settings/XEH_preInit.sqf @@ -37,7 +37,7 @@ if (isServer) then { } forEach _settings; // report specific medical settings - private _log = format ["[AMA=%1] [aDmgPass=%2]", potato_armor_modifier_ace, ace_medical_engine_damagePassThroughEffect toFixed 2]; + private _log = format ["[AAA=%1] [aDmgPass=%2]", AAA_VAR_MOD_ENABLED, ace_medical_engine_damagePassThroughEffect toFixed 2]; ["potato_adminMsg", [_log, "Mission"]] call CBA_fnc_globalEvent; }, [_settings], 4] call CBA_fnc_waitAndExecute; From cef81d62352e85213d6047001d64a899eab59315 Mon Sep 17 00:00:00 2001 From: lambdatiger Date: Thu, 19 Sep 2024 23:51:39 -0500 Subject: [PATCH 16/18] move cleanup to not run twice --- .../assignGear/functions/fnc_assignGearVehicle.sqf | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/addons/assignGear/functions/fnc_assignGearVehicle.sqf b/addons/assignGear/functions/fnc_assignGearVehicle.sqf index dd41f90e..607ad3ab 100644 --- a/addons/assignGear/functions/fnc_assignGearVehicle.sqf +++ b/addons/assignGear/functions/fnc_assignGearVehicle.sqf @@ -76,17 +76,15 @@ if (!isClass _path) exitWith { diag_log text format ["[POTATO-assignGear] - No loadout found for %1 (typeOf %2) (kindOf %3) (defaultLoadout: %4)", _theVehicle, typeOf _theVehicle, _loadout, _defaultLoadout]; }; -//Clean out starting inventory (even if there is no class) -clearWeaponCargoGlobal _theVehicle; -clearMagazineCargoGlobal _theVehicle; -clearItemCargoGlobal _theVehicle; -clearBackpackCargoGlobal _theVehicle; - switch (GVAR(setVehicleLoadouts)) do { case 1: { // ammo in vehicle inventory [_theVehicle, _path] call FUNC(setContainerContentsFromConfig); }; case 2: { // ammo in boxes in vehicle + clearWeaponCargoGlobal _theVehicle; + clearMagazineCargoGlobal _theVehicle; + clearItemCargoGlobal _theVehicle; + clearBackpackCargoGlobal _theVehicle; [_theVehicle, _path, getArray(_path >> "TransportMagazines"), getArray(_path >> "TransportItems"), @@ -94,6 +92,10 @@ switch (GVAR(setVehicleLoadouts)) do { getArray(_path >> "TransportBackpacks")] call FUNC(assignGearVehicle_asBoxes); }; case 3: { // ammo in boxes in vehicle from config + clearWeaponCargoGlobal _theVehicle; + clearMagazineCargoGlobal _theVehicle; + clearItemCargoGlobal _theVehicle; + clearBackpackCargoGlobal _theVehicle; private _boxes = "true" configClasses _path; private _vehicleSpace = getNumber (_path >> "minVehicleBoxSpace"); if (_vehicleSpace > 0) then { From b0e4c7168afd8fc7eba3eddd60ce22d79aa86e63 Mon Sep 17 00:00:00 2001 From: lambdatiger Date: Thu, 19 Sep 2024 23:52:47 -0500 Subject: [PATCH 17/18] alphabetized PREP --- addons/assignGear/XEH_PREP.hpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/addons/assignGear/XEH_PREP.hpp b/addons/assignGear/XEH_PREP.hpp index 539334d0..5861213e 100644 --- a/addons/assignGear/XEH_PREP.hpp +++ b/addons/assignGear/XEH_PREP.hpp @@ -3,13 +3,13 @@ TRACE_1("",QUOTE(ADDON)); PREP(addItemsToContainer); PREP(addSupplyBoxActions); PREP(assignGearMan); -PREP(assignGearSupplyBox); PREP(assignGearPotatoBox); -PREP(assignGearVehicle); +PREP(assignGearSupplyBox); PREP(assignGearVehicle_asBoxes); -PREP(cleanPrefix); +PREP(assignGearVehicle); PREP(changeableOptics_getChildren); PREP(changeableOptics_setOptic); +PREP(cleanPrefix); PREP(getContainerInfo); PREP(getDisposableInfo); // temp?? for cba change to disposable hash maps PREP(getLinkedIndex); From 8c9208362d4336c70a0f2b5ec44cc44369f5f93e Mon Sep 17 00:00:00 2001 From: lambdatiger Date: Fri, 20 Sep 2024 00:14:37 -0500 Subject: [PATCH 18/18] Fixed example function name --- .../assignGear/functions/fnc_setContainerContentsFromConfig.sqf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/assignGear/functions/fnc_setContainerContentsFromConfig.sqf b/addons/assignGear/functions/fnc_setContainerContentsFromConfig.sqf index e08e16e8..a3fce4e9 100644 --- a/addons/assignGear/functions/fnc_setContainerContentsFromConfig.sqf +++ b/addons/assignGear/functions/fnc_setContainerContentsFromConfig.sqf @@ -11,7 +11,7 @@ * None * * Example: - * [cursorObject, missionConfigFile >> "CfgLoadouts" >> "SupplyBox" >> (typeOf cursorObject)] call potato_assignGear_fnc_assignGearSupplyBox + * [cursorObject, missionConfigFile >> "CfgLoadouts" >> "SupplyBox" >> (typeOf cursorObject)] call potato_assignGear_fnc_setContainerContentsFromConfig * * Public: No */