diff --git a/.hemtt/missions/BOCR_TestMission.Stratis/mission.sqm b/.hemtt/missions/BOCR_TestMission.Stratis/mission.sqm new file mode 100644 index 0000000..572a847 --- /dev/null +++ b/.hemtt/missions/BOCR_TestMission.Stratis/mission.sqm @@ -0,0 +1,375 @@ +version=54; +class EditorData +{ + moveGridStep=1; + angleGridStep=0.2617994; + scaleGridStep=1; + autoGroupingDist=10; + toggles=1; + class ItemIDProvider + { + nextID=8; + }; + class Camera + { + pos[]={1725.0037,10.059808,5247.7446}; + dir[]={-0.79113561,-0.49134576,0.36425778}; + up[]={-0.44631106,0.87096459,0.20549229}; + aside[]={0.41822338,1.4901161e-008,0.90834415}; + }; +}; +binarizationWanted=0; +sourceName="bocr_testmission"; +addons[]= +{ + "A3_Characters_F", + "A3_Weapons_F_Rifles_MX", + "A3_Weapons_F_Acc", + "ace_realisticnames", + "ace_scopes", + "ace_laserpointer", + "A3_Weapons_F", + "ace_smallarms", + "ace_ballistics", + "A3_Weapons_F_Pistols_P07", + "A3_Characters_F_Heads", + "ace_goggles", + "ace_nightvision", + "A3_Weapons_F_Items", + "ace_medical_engine", + "ace_medical_treatment", + "ace_attach", + "ace_chemlights", + "A3_Weapons_F_Ammoboxes", + "ace_cargo" +}; +class AddonsMetaData +{ + class List + { + items=13; + class Item0 + { + className="A3_Characters_F"; + name="Arma 3 Alpha - Characters and Clothing"; + author="Bohemia Interactive"; + url="https://www.arma3.com"; + }; + class Item1 + { + className="A3_Weapons_F"; + name="Arma 3 Alpha - Weapons and Accessories"; + author="Bohemia Interactive"; + url="https://www.arma3.com"; + }; + class Item2 + { + className="ace_scopes"; + name="ACE3 - Scopes"; + author="ACE-Team"; + url="https://ace3.acemod.org/"; + }; + class Item3 + { + className="ace_laserpointer"; + name="ACE3 - Laser Pointer"; + author="ACE-Team"; + url="https://ace3.acemod.org/"; + }; + class Item4 + { + className="ace_smallarms"; + name="ACE3 - Small Arms"; + author="ACE-Team"; + url="https://ace3.acemod.org/"; + }; + class Item5 + { + className="ace_ballistics"; + name="ACE3 - Ballistics"; + author="ACE-Team"; + url="https://ace3.acemod.org/"; + }; + class Item6 + { + className="ace_goggles"; + name="ACE3 - Goggles"; + author="ACE-Team"; + url="https://ace3.acemod.org/"; + }; + class Item7 + { + className="ace_nightvision"; + name="ACE3 - Night Vision"; + author="ACE-Team"; + url="https://ace3.acemod.org/"; + }; + class Item8 + { + className="ace_medical_engine"; + name="ACE3 - Medical Engine"; + author="ACE-Team"; + url="https://ace3.acemod.org/"; + }; + class Item9 + { + className="ace_medical_treatment"; + name="ACE3 - Medical Treatment"; + author="ACE-Team"; + url="https://ace3.acemod.org/"; + }; + class Item10 + { + className="ace_attach"; + name="ACE3 - Attach"; + author="ACE-Team"; + url="https://ace3.acemod.org/"; + }; + class Item11 + { + className="ace_chemlights"; + name="ace_chemlights"; + author="ACE-Team"; + url="https://ace3.acemod.org/"; + }; + class Item12 + { + className="ace_cargo"; + name="ACE3 - Cargo"; + author="ACE-Team"; + url="https://ace3.acemod.org/"; + }; + }; +}; +randomSeed=8418572; +class ScenarioData +{ + author="mjc4wilton"; +}; +class Mission +{ + class Intel + { + timeOfChanges=1800.0002; + startWeather=0.30000001; + startWind=0.1; + startWaves=0.1; + forecastWeather=0.30000001; + forecastWind=0.1; + forecastWaves=0.1; + forecastLightnings=0.1; + wavesForced=1; + windForced=1; + year=2035; + month=7; + day=6; + hour=12; + minute=0; + startFogDecay=0.014; + forecastFogDecay=0.014; + }; + class Entities + { + items=2; + class Item0 + { + dataType="Group"; + side="West"; + class Entities + { + items=1; + class Item0 + { + dataType="Object"; + class PositionInfo + { + position[]={1719.022,5.5014391,5250.1089}; + angles[]={0,0.27164304,0}; + }; + side="West"; + flags=7; + class Attributes + { + init="[this] spawn {" \n " params [""_unit""];" \n " sleep 1;" \n " [_unit, ""B_Kitbag_rgr"", [], []] call bocr_main_fnc_addChestpack;" \n "};" \n ""; + isPlayer=1; + class Inventory + { + class primaryWeapon + { + name="arifle_MX_ACO_pointer_F"; + optics="optic_Aco"; + flashlight="acc_pointer_IR"; + firemode="arifle_MX_ACO_pointer_F:Single"; + class primaryMuzzleMag + { + name="30Rnd_65x39_caseless_mag"; + ammoLeft=30; + }; + }; + class handgun + { + name="hgun_P07_F"; + class primaryMuzzleMag + { + name="16Rnd_9x21_Mag"; + ammoLeft=17; + }; + }; + class uniform + { + typeName="U_B_CombatUniform_mcam"; + isBackpack=0; + class MagazineCargo + { + items=1; + class Item0 + { + name="30Rnd_65x39_caseless_mag"; + count=2; + ammoLeft=30; + }; + }; + class ItemCargo + { + items=1; + class Item0 + { + name="FirstAidKit"; + count=1; + }; + }; + }; + class vest + { + typeName="V_PlateCarrier1_rgr"; + isBackpack=0; + class MagazineCargo + { + items=6; + class Item0 + { + name="30Rnd_65x39_caseless_mag"; + count=7; + ammoLeft=30; + }; + class Item1 + { + name="16Rnd_9x21_Mag"; + count=2; + ammoLeft=17; + }; + class Item2 + { + name="SmokeShell"; + count=1; + ammoLeft=1; + }; + class Item3 + { + name="SmokeShellGreen"; + count=1; + ammoLeft=1; + }; + class Item4 + { + name="Chemlight_green"; + count=2; + ammoLeft=1; + }; + class Item5 + { + name="HandGrenade"; + count=2; + ammoLeft=1; + }; + }; + }; + class backpack + { + typeName="B_Parachute"; + isBackpack=1; + }; + map="ItemMap"; + compass="ItemCompass"; + watch="ItemWatch"; + radio="ItemRadio"; + goggles="G_Tactical_Clear"; + hmd="NVGoggles"; + headgear="H_HelmetB"; + }; + }; + id=1; + type="B_Soldier_F"; + class CustomAttributes + { + class Attribute0 + { + property="speaker"; + expression="_this setspeaker _value;"; + class Value + { + class data + { + singleType="STRING"; + value="Male10ENG"; + }; + }; + }; + class Attribute1 + { + property="pitch"; + expression="_this setpitch _value;"; + class Value + { + class data + { + singleType="SCALAR"; + value=1.05; + }; + }; + }; + nAttributes=2; + }; + }; + }; + class Attributes + { + }; + id=0; + }; + class Item1 + { + dataType="Object"; + class PositionInfo + { + position[]={1719.568,6.3924227,5252.4131}; + angles[]={0,3.4375305,0}; + }; + side="Empty"; + flags=4; + class Attributes + { + init="[""ammoBoxInit"", [this, true]] call BIS_fnc_arsenal;" \n "[this, true] call ace_arsenal_fnc_initBox;" \n "this addAction [""Teleport 500m"", {" \n " private _pos = getPos ACE_player;" \n " _pos set [2, 500];" \n " ACE_player setPos _pos;" \n "}];" \n "this addAction [""Teleport 1km"", {" \n " private _pos = getPos ACE_player;" \n " _pos set [2, 1000];" \n " ACE_player setPos _pos;" \n "}];"; + }; + id=2; + type="B_supplyCrate_F"; + class CustomAttributes + { + class Attribute0 + { + property="ammoBox"; + expression="[_this,_value] call bis_fnc_initAmmoBox;"; + class Value + { + class data + { + singleType="STRING"; + value="[[[[""launch_NLAW_F"",""arifle_MX_F"",""arifle_MX_SW_F"",""FirstAidKit""],[1,2,1,10]],[[""30Rnd_65x39_caseless_mag"",""16Rnd_9x21_Mag"",""30Rnd_45ACP_Mag_SMG_01"",""20Rnd_762x51_Mag"",""100Rnd_65x39_caseless_mag"",""1Rnd_HE_Grenade_shell"",""3Rnd_HE_Grenade_shell"",""1Rnd_Smoke_Grenade_shell"",""1Rnd_SmokeGreen_Grenade_shell"",""Chemlight_green"",""NLAW_F"",""Laserbatteries"",""HandGrenade"",""MiniGrenade"",""SmokeShell"",""SmokeShellGreen"",""UGL_FlareWhite_F"",""UGL_FlareGreen_F"",""ACE_SpareBarrel"",""ACE_30Rnd_65x47_Scenar_mag"",""ACE_30Rnd_65_Creedmor_mag"",""ACE_10Rnd_762x51_M118LR_Mag"",""ACE_20Rnd_762x51_M118LR_Mag"",""ACE_10Rnd_762x51_Mk316_Mod_0_Mag"",""ACE_20Rnd_762x51_Mk316_Mod_0_Mag"",""ACE_10Rnd_762x51_Mk319_Mod_0_Mag"",""ACE_20Rnd_762x51_Mk319_Mod_0_Mag"",""ACE_20Rnd_762x51_Mag_Tracer"",""ACE_20Rnd_762x51_Mag_Tracer_Dim""],[24,6,6,6,6,3,1,2,2,6,3,2,6,6,2,2,2,2,2,4,4,4,4,4,4,4,4,4,4]],[[""Laserdesignator"",""acc_flashlight"",""bipod_01_F_blk"",""ACE_Chemlight_Shield"",""ACE_EarPlugs""],[1,2,1,12,12]],[[""B_Kitbag_mcamo""],[2]]],false]"; + }; + }; + }; + nAttributes=1; + }; + }; + }; +}; diff --git a/.hemtt/missions/~bocr_testmission.stratis/mission.sqm b/.hemtt/missions/~bocr_testmission.stratis/mission.sqm new file mode 100644 index 0000000..424581d --- /dev/null +++ b/.hemtt/missions/~bocr_testmission.stratis/mission.sqm @@ -0,0 +1,375 @@ +version=54; +class EditorData +{ + moveGridStep=1; + angleGridStep=0.2617994; + scaleGridStep=1; + autoGroupingDist=10; + toggles=1; + class ItemIDProvider + { + nextID=8; + }; + class Camera + { + pos[]={1725.0037,10.059808,5247.7446}; + dir[]={-0.79113561,-0.49134576,0.36425778}; + up[]={-0.44631106,0.87096459,0.20549229}; + aside[]={0.41822338,1.4901161e-008,0.90834415}; + }; +}; +binarizationWanted=0; +sourceName="~bocr_testmission"; +addons[]= +{ + "A3_Characters_F", + "A3_Weapons_F_Rifles_MX", + "A3_Weapons_F_Acc", + "ace_realisticnames", + "ace_scopes", + "ace_laserpointer", + "A3_Weapons_F", + "ace_smallarms", + "ace_ballistics", + "A3_Weapons_F_Pistols_P07", + "A3_Characters_F_Heads", + "ace_goggles", + "ace_nightvision", + "A3_Weapons_F_Items", + "ace_medical_engine", + "ace_medical_treatment", + "ace_attach", + "ace_chemlights", + "A3_Weapons_F_Ammoboxes", + "ace_cargo" +}; +class AddonsMetaData +{ + class List + { + items=13; + class Item0 + { + className="A3_Characters_F"; + name="Arma 3 Alpha - Characters and Clothing"; + author="Bohemia Interactive"; + url="https://www.arma3.com"; + }; + class Item1 + { + className="A3_Weapons_F"; + name="Arma 3 Alpha - Weapons and Accessories"; + author="Bohemia Interactive"; + url="https://www.arma3.com"; + }; + class Item2 + { + className="ace_scopes"; + name="ACE3 - Scopes"; + author="ACE-Team"; + url="https://ace3.acemod.org/"; + }; + class Item3 + { + className="ace_laserpointer"; + name="ACE3 - Laser Pointer"; + author="ACE-Team"; + url="https://ace3.acemod.org/"; + }; + class Item4 + { + className="ace_smallarms"; + name="ACE3 - Small Arms"; + author="ACE-Team"; + url="https://ace3.acemod.org/"; + }; + class Item5 + { + className="ace_ballistics"; + name="ACE3 - Ballistics"; + author="ACE-Team"; + url="https://ace3.acemod.org/"; + }; + class Item6 + { + className="ace_goggles"; + name="ACE3 - Goggles"; + author="ACE-Team"; + url="https://ace3.acemod.org/"; + }; + class Item7 + { + className="ace_nightvision"; + name="ACE3 - Night Vision"; + author="ACE-Team"; + url="https://ace3.acemod.org/"; + }; + class Item8 + { + className="ace_medical_engine"; + name="ACE3 - Medical Engine"; + author="ACE-Team"; + url="https://ace3.acemod.org/"; + }; + class Item9 + { + className="ace_medical_treatment"; + name="ACE3 - Medical Treatment"; + author="ACE-Team"; + url="https://ace3.acemod.org/"; + }; + class Item10 + { + className="ace_attach"; + name="ACE3 - Attach"; + author="ACE-Team"; + url="https://ace3.acemod.org/"; + }; + class Item11 + { + className="ace_chemlights"; + name="ace_chemlights"; + author="ACE-Team"; + url="https://ace3.acemod.org/"; + }; + class Item12 + { + className="ace_cargo"; + name="ACE3 - Cargo"; + author="ACE-Team"; + url="https://ace3.acemod.org/"; + }; + }; +}; +randomSeed=8418572; +class ScenarioData +{ + author="mjc4wilton"; +}; +class Mission +{ + class Intel + { + timeOfChanges=1800.0002; + startWeather=0.30000001; + startWind=0.1; + startWaves=0.1; + forecastWeather=0.30000001; + forecastWind=0.1; + forecastWaves=0.1; + forecastLightnings=0.1; + wavesForced=1; + windForced=1; + year=2035; + month=7; + day=6; + hour=12; + minute=0; + startFogDecay=0.014; + forecastFogDecay=0.014; + }; + class Entities + { + items=2; + class Item0 + { + dataType="Group"; + side="West"; + class Entities + { + items=1; + class Item0 + { + dataType="Object"; + class PositionInfo + { + position[]={1719.022,5.5014391,5250.1089}; + angles[]={0,0.27164304,0}; + }; + side="West"; + flags=7; + class Attributes + { + init="[this] spawn {" \n " params [""_unit""];" \n " sleep 1;" \n " [_unit, ""B_Kitbag_rgr"", [], []] call bocr_main_fnc_addChestpack;" \n "};" \n ""; + isPlayer=1; + class Inventory + { + class primaryWeapon + { + name="arifle_MX_ACO_pointer_F"; + optics="optic_Aco"; + flashlight="acc_pointer_IR"; + firemode="arifle_MX_ACO_pointer_F:Single"; + class primaryMuzzleMag + { + name="30Rnd_65x39_caseless_mag"; + ammoLeft=30; + }; + }; + class handgun + { + name="hgun_P07_F"; + class primaryMuzzleMag + { + name="16Rnd_9x21_Mag"; + ammoLeft=17; + }; + }; + class uniform + { + typeName="U_B_CombatUniform_mcam"; + isBackpack=0; + class MagazineCargo + { + items=1; + class Item0 + { + name="30Rnd_65x39_caseless_mag"; + count=2; + ammoLeft=30; + }; + }; + class ItemCargo + { + items=1; + class Item0 + { + name="FirstAidKit"; + count=1; + }; + }; + }; + class vest + { + typeName="V_PlateCarrier1_rgr"; + isBackpack=0; + class MagazineCargo + { + items=6; + class Item0 + { + name="30Rnd_65x39_caseless_mag"; + count=7; + ammoLeft=30; + }; + class Item1 + { + name="16Rnd_9x21_Mag"; + count=2; + ammoLeft=17; + }; + class Item2 + { + name="SmokeShell"; + count=1; + ammoLeft=1; + }; + class Item3 + { + name="SmokeShellGreen"; + count=1; + ammoLeft=1; + }; + class Item4 + { + name="Chemlight_green"; + count=2; + ammoLeft=1; + }; + class Item5 + { + name="HandGrenade"; + count=2; + ammoLeft=1; + }; + }; + }; + class backpack + { + typeName="B_Parachute"; + isBackpack=1; + }; + map="ItemMap"; + compass="ItemCompass"; + watch="ItemWatch"; + radio="ItemRadio"; + goggles="G_Tactical_Clear"; + hmd="NVGoggles"; + headgear="H_HelmetB"; + }; + }; + id=1; + type="B_Soldier_F"; + class CustomAttributes + { + class Attribute0 + { + property="speaker"; + expression="_this setspeaker _value;"; + class Value + { + class data + { + singleType="STRING"; + value="Male10ENG"; + }; + }; + }; + class Attribute1 + { + property="pitch"; + expression="_this setpitch _value;"; + class Value + { + class data + { + singleType="SCALAR"; + value=1.05; + }; + }; + }; + nAttributes=2; + }; + }; + }; + class Attributes + { + }; + id=0; + }; + class Item1 + { + dataType="Object"; + class PositionInfo + { + position[]={1719.568,6.3924227,5252.4131}; + angles[]={0,3.4375305,0}; + }; + side="Empty"; + flags=4; + class Attributes + { + init="[""ammoBoxInit"", [this, true]] call BIS_fnc_arsenal;" \n "[this, true] call ace_arsenal_fnc_initBox;" \n "this addAction [""Teleport 500m"", {" \n " private _pos = getPos ACE_player;" \n " _pos set [2, 500];" \n " ACE_player setPos _pos;" \n "}];" \n "this addAction [""Teleport 1km"", {" \n " private _pos = getPos ACE_player;" \n " _pos set [2, 1000];" \n " ACE_player setPos _pos;" \n "}];"; + }; + id=2; + type="B_supplyCrate_F"; + class CustomAttributes + { + class Attribute0 + { + property="ammoBox"; + expression="[_this,_value] call bis_fnc_initAmmoBox;"; + class Value + { + class data + { + singleType="STRING"; + value="[[[[""launch_NLAW_F"",""arifle_MX_F"",""arifle_MX_SW_F"",""FirstAidKit""],[1,2,1,10]],[[""30Rnd_65x39_caseless_mag"",""16Rnd_9x21_Mag"",""30Rnd_45ACP_Mag_SMG_01"",""20Rnd_762x51_Mag"",""100Rnd_65x39_caseless_mag"",""1Rnd_HE_Grenade_shell"",""3Rnd_HE_Grenade_shell"",""1Rnd_Smoke_Grenade_shell"",""1Rnd_SmokeGreen_Grenade_shell"",""Chemlight_green"",""NLAW_F"",""Laserbatteries"",""HandGrenade"",""MiniGrenade"",""SmokeShell"",""SmokeShellGreen"",""UGL_FlareWhite_F"",""UGL_FlareGreen_F"",""ACE_SpareBarrel"",""ACE_30Rnd_65x47_Scenar_mag"",""ACE_30Rnd_65_Creedmor_mag"",""ACE_10Rnd_762x51_M118LR_Mag"",""ACE_20Rnd_762x51_M118LR_Mag"",""ACE_10Rnd_762x51_Mk316_Mod_0_Mag"",""ACE_20Rnd_762x51_Mk316_Mod_0_Mag"",""ACE_10Rnd_762x51_Mk319_Mod_0_Mag"",""ACE_20Rnd_762x51_Mk319_Mod_0_Mag"",""ACE_20Rnd_762x51_Mag_Tracer"",""ACE_20Rnd_762x51_Mag_Tracer_Dim""],[24,6,6,6,6,3,1,2,2,6,3,2,6,6,2,2,2,2,2,4,4,4,4,4,4,4,4,4,4]],[[""Laserdesignator"",""acc_flashlight"",""bipod_01_F_blk"",""ACE_Chemlight_Shield"",""ACE_EarPlugs""],[1,2,1,12,12]],[[""B_Kitbag_mcamo""],[2]]],false]"; + }; + }; + }; + nAttributes=1; + }; + }; + }; +}; diff --git a/.hemtt/project.toml b/.hemtt/project.toml index 940acc8..eae3cd0 100644 --- a/.hemtt/project.toml +++ b/.hemtt/project.toml @@ -39,6 +39,7 @@ preset = "Hemtt" folder = "bocr" [hemtt.launch.default] +mission = "BOCR_TestMission.Stratis" workshop = [ "450814997", # CBA_A3's Workshop ID "463939057", # ACE3's Workshop ID diff --git a/addons/main/CfgVehicles.hpp b/addons/main/CfgVehicles.hpp index 74a9e40..4e19fcb 100644 --- a/addons/main/CfgVehicles.hpp +++ b/addons/main/CfgVehicles.hpp @@ -30,21 +30,21 @@ class CfgVehicles { }; class items { displayName = "Chestpack Loadout Array"; - description = "Items (includes mags, weapons, ...) which should be contained in the chestpack. Items sperated by a ','. Item can either be just a classname (for a single) or an array [classname,amount]."; + description = "items stored within the chestpack formatted as a sub-array of a Unit Loadout Array."; typeName = "STRING"; - defaultValue = "[""FirstAidKit"",3], ""hgun_P07_F"", [""16Rnd_9x21_Mag"",2]"; + defaultValue = "[]"; }; - class mags { - displayName = "Chestpack magazines"; - description = "Just for adding partially loaded mags. Mags seperated by a ','. Syntax of single mag.: [magazine, ammo count]"; + class variables { + displayName = "Chestpack variables"; + description = "Variables assigned to the chestpack as [""var_name"", var_value]"; typeName = "STRING"; - defaultValue = "[""30Rnd_65x39_caseless_mag"",20], [""30Rnd_65x39_caseless_mag_Tracer"",10]"; + defaultValue = "[]"; }; class code { displayName = "Additional code"; description = "Any addition code to modify the chestpack. '_this' referes to the chestpack itself."; // Argument label typeName = "STRING"; // Value type, can be "NUMBER", "STRING" or "BOOL" - defaultValue = "_this setObjectTextureGlobal [0, ""#(rgb,8,8,3)color(0,0,1,1)""];"; + defaultValue = ""; }; }; class ModuleDescription : ModuleDescription { diff --git a/addons/main/XEH_postInit.sqf b/addons/main/XEH_postInit.sqf index 2abff8b..6628684 100644 --- a/addons/main/XEH_postInit.sqf +++ b/addons/main/XEH_postInit.sqf @@ -26,11 +26,11 @@ if (isServer) then { params ["_ropeTop", "_holder"]; [{ params ["_ropeTop", "_pfhID"]; - if (speed _ropeTop < 1 && {getPos _ropeTop # 2 < 1}) exitWith { + if (speed _ropeTop < 1 && {((getPos _ropeTop) select 2) < 1}) exitWith { deleteVehicle _ropeTop; [_pfhID] call CBA_fnc_removePerFrameHandler; }; - }, 1, _ropeTop] call CBA_fnc_addPerFrameHandler; + }, 0, _ropeTop] call CBA_fnc_addPerFrameHandler; [{ params ["_holder", "_pfhID"]; if (speed _holder < 1 && {getPos _holder # 2 < 1}) exitWith { @@ -39,7 +39,7 @@ if (isServer) then { _holder setPos _pos; [_pfhID] call CBA_fnc_removePerFrameHandler; }; - }, 1, _holder] call CBA_fnc_addPerFrameHandler; + }, 0, _holder] call CBA_fnc_addPerFrameHandler; }] call CBA_fnc_addEventHandler; }; diff --git a/addons/main/functions/fnc_actionCutLoweringLine.sqf b/addons/main/functions/fnc_actionCutLoweringLine.sqf index 7809f39..1c8fa8a 100644 --- a/addons/main/functions/fnc_actionCutLoweringLine.sqf +++ b/addons/main/functions/fnc_actionCutLoweringLine.sqf @@ -18,15 +18,12 @@ params ["_unit"]; private _chute = vehicle _unit; private _ropeTop = _chute getVariable [QGVAR(loweringLine), objNull]; - if (!isNull _ropeTop) then { - private _rope = ropes _ropeTop # 0; - private _holder = ropeAttachedObjects _ropeTop # 0; - _holder ropeDetach _rope; - // ace_fastroping_helper is a helicopter and kind of autorotates down instead - // of falling, much slower than a falling object. Attaching to the holder - // also looks like the rope snapping under tension once cut - _ropeTop attachTo [_holder, [0.1,-0.45,-0.6]]; - - _chute setVariable [QGVAR(loweringLine), objNull, true]; + private _rope = (ropes _ropeTop) select 0; + private _holder = (ropeAttachedObjects _ropeTop) select 0; + if !(isNull _holder) then { + _holder ropeDetach _rope; + ropeDestroy _rope; + }; + _chute setVariable [QGVAR(loweringLine), nil, true]; }; diff --git a/addons/main/functions/fnc_addChestpack.sqf b/addons/main/functions/fnc_addChestpack.sqf index 0e23e80..2a4d3ff 100644 --- a/addons/main/functions/fnc_addChestpack.sqf +++ b/addons/main/functions/fnc_addChestpack.sqf @@ -17,10 +17,14 @@ * * Public: No */ -params ["_unit","_chestpackClass","_backpackLoadout","_backpackVariables", "_backpackLoad"]; +params ["_unit", "_chestpackClass", ["_backpackLoadout", []], ["_backpackVariables", []], ["_backpackLoad", nil]]; + +if (_backpackLoad isEqualTo nil) then { + _backpackLoad = loadBackpack _unit; +}; //add HandleDisconnect-EH on server if not done yet -if !(GETMVAR(GVAR(HDCEHadded), false)) then { +if !(GETMVAR(GVAR(HDCEHadded),false)) then { [QGVAR(handleDisconnect), []] call CBA_fnc_serverEvent; GVAR(HDCEHadded) = true; publicVariable QGVAR(HDCEHadded); diff --git a/addons/main/functions/fnc_canAddItemToChestpack.sqf b/addons/main/functions/fnc_canAddItemToChestpack.sqf index 239e2bf..5a24a6e 100644 --- a/addons/main/functions/fnc_canAddItemToChestpack.sqf +++ b/addons/main/functions/fnc_canAddItemToChestpack.sqf @@ -26,4 +26,4 @@ private _maximumLoad = getNumber(configFile >> "CfgVehicles" >> ([_unit] call FU private _remainingLoad = (1 - _preLoadPercent) * _maximumLoad; private _itemMass = [_item] call FUNC(itemMass); -if (_itemMass * _amount > _remainingLoad) then {false} else {true}; +[true, false] select ((_itemMass * _amount) > _remainingLoad); diff --git a/addons/main/functions/fnc_moduleAdd.sqf b/addons/main/functions/fnc_moduleAdd.sqf index 39abaae..81a2023 100644 --- a/addons/main/functions/fnc_moduleAdd.sqf +++ b/addons/main/functions/fnc_moduleAdd.sqf @@ -19,31 +19,15 @@ params ["_module","_units"]; private _class = _module getVariable "classname"; -private _items = call compile format ["[%1]",_module getVariable "items"]; -private _mags = call compile format ["[%1]",_module getVariable "mags"]; +private _loadout = call compile format ["[%1]",_module getVariable "items"]; +private _variables = call compile format ["[%1]",_module getVariable "variables"]; private _code = compile (_module getVariable "code"); { private _unit = _x; //add chestpack - [_unit,_class] call FUNC(addChestpack); - - //add items - { - if (typeName _x isEqualTo "STRING") then { - [_unit,_x] call FUNC(addItemToChestpack); - } else { - private _itemClass = _x select 0; - private _itemAmount = _x select 1; - [_unit,_itemClass,_itemAmount] call FUNC(addItemToChestpack); - }; - } forEach _items; - - //add magazines - { - [_unit,(_x select 0),(_x select 1)] call FUNC(addMagToChestpack); - } forEach _mags; + [_unit, _class, _loadout, _variables] call FUNC(addChestpack); //execute extra code ([_unit] call FUNC(chestpackContainer)) spawn _code; diff --git a/addons/main/functions/fnc_setBackpackLoadout.sqf b/addons/main/functions/fnc_setBackpackLoadout.sqf index a4170a3..84d4ea3 100644 --- a/addons/main/functions/fnc_setBackpackLoadout.sqf +++ b/addons/main/functions/fnc_setBackpackLoadout.sqf @@ -46,7 +46,7 @@ private _cfgVehicles = configFile >> "CfgVehicles"; _countInBackpack == _count }, {}, [_backpack] + _x, 1, { WARNING("chestpackToHolder timed out adding magazines"); - TRACE_1("Container: ", _this); + TRACE_1("Container: ",_this); }] call CBA_fnc_waitUntilAndExecute; } else { //backpacks