diff --git a/MPD_PodLoad/init.sqf b/MPD_PodLoad/init.sqf new file mode 100644 index 0000000..084f209 --- /dev/null +++ b/MPD_PodLoad/init.sqf @@ -0,0 +1,64 @@ +/* + Small edit of my sling load script to work with Taru Heavy Lift Helicopter + Simple Pod Load Script by MrPvTDagger#4176 :D +*/ + +diag_log "MPD_PodLoad is Loading..."; + +_acargo = entities "Pod_Heli_Transport_04_base_F"; + +{ + _action = [ + "SlingLoad", // Action Name + "Attach Cargo Pod", // Name Of action Shown In menu + "", // Icon + {[_target] execVM "MPD_PodLoad\sling.sqf";}, // Statment + {(nearestObject [_target, "Helicopter"]) distance _target < 10}, // Condition + {}, // + [], + [0,0,0], 100] call ace_interact_menu_fnc_createAction; + + [_x, 0, ["ACE_MainActions"], _action] call ace_interact_menu_fnc_addActionToObject; +} forEach _acargo; + +/* Support for Fortification Tool ACEX */ +if (isClass(configFile >> "CfgWeapons" >> "ACE_Fortify")) then +{ + ["acex_fortify_objectPlaced", { + params ["_unit", "_side", "_object"]; + _action = [ + "SlingLoad", // Action Name + "Attach Cargo Pod", // Name Of action Shown In menu + "", // Icon + {[_target] execVM "MPD_PodLoad\sling.sqf";}, // Statment + {(nearestObject [_target, "Helicopter"]) distance _target < 10}, // Condition + {}, // + [], + [0,0,0], 100] call ace_interact_menu_fnc_createAction; + + [_object, 0, ["ACE_MainActions"], _action] call ace_interact_menu_fnc_addActionToObject; + }] call CBA_fnc_addEventHandler; +}; + +/* Support for Objects placed by Zues */ +{ + _x addEventHandler ["CuratorObjectPlaced", { + params ["_curator", "_entity"]; + if (_entity isKindOf "Pod_Heli_Transport_04_base_F") then { + //hint "Object is blacklisted"; + } else { + _action = [ + "SlingLoad", // Action Name + "Attach Cargo Pod", // Name Of action Shown In menu + "", // Icon + {[_target] execVM "MPD_PodLoad\sling.sqf";}, // Statment + {(nearestObject [_target, "Helicopter"]) distance _target < 10}, // Condition + {}, // + [], + [0,0,0], 100] call ace_interact_menu_fnc_createAction; + + [_entity, 0, ["ACE_MainActions"], _action] call ace_interact_menu_fnc_addActionToObject; + //hint format["Object spawned: %1", _entity]; + }; + }]; +} forEach allCurators; diff --git a/MPD_PodLoad/sling.sqf b/MPD_PodLoad/sling.sqf new file mode 100644 index 0000000..eb6de25 --- /dev/null +++ b/MPD_PodLoad/sling.sqf @@ -0,0 +1,21 @@ + [10, [_this select 0], { + private ["_cargo","_nObject","_pilot"]; + _cargo = _args select 0; + _nObject = nearestObject [_cargo, "Heli_Transport_04_base_F"]; + _pilot = currentPilot _nObject; + _cargo attachTo [_nObject, [0, -1.1, -1.2]]; + + [_nObject, ["Release Cargo", { private ["_heli","_cargoRopes"]; + _heli = _this select 0; + _cargoRopes = ropes _heli; + { + ropeDestroy _x; + } forEach _cargoRopes; + { + detach _x; + _pos = [_heli, 6, 11, 0, 0, 20, 0] call BIS_fnc_findSafePos; + _x setPos _pos; + } forEach attachedObjects _heli; + removeAllActions _heli; + },nil,1.5,true,true,"","true",8,false,"",""]] remoteExec ["addAction"]; +}, {}, "Attaching Cargo..."] call ace_common_fnc_progressBar; //I was lazy... \ No newline at end of file