From 61a0f743946bc535f8e0dc0b230bede0c1eb4c64 Mon Sep 17 00:00:00 2001 From: DonkeyPunchINFO Date: Thu, 24 Mar 2016 13:39:49 -0500 Subject: [PATCH 1/4] Internal XLD version made public v0.9 many updates and work has been done to this for a perfect exile experience. Server side PBO and a few things done to mission file is all this needs to function :) ENJOY from DirtySanchez and the eXileLoneDevs team! --- .../addons/xld_advanced_sling_tow.pbo | Bin 24026 -> 29937 bytes .../addons/xld_advanced_sling_tow/$PBOPREFIX$ | 1 + .../addons/xld_advanced_sling_tow/$PREFIX$ | 1 + .../xld_advanced_sling_tow/PboPrefix.txt | 1 + .../addons/xld_advanced_sling_tow/config.cpp | 18 + .../functions/fn_advancedTowingInit.sqf | 232 ++++-- Changelog.txt.sqf | 40 + .../CfgRemoteExec.hpp -or- Description.ext | 23 + .../advSlingTow/fn_advancedTowingInit.sqf | 684 ++++++++++++++++++ MPMissions/Exile.Altis/init.sqf | 17 + ...A_AdvancedTowing.pbo.AdvancedTowing.bisign | Bin 567 -> 0 bytes addons/SA_AdvancedTowing/$PBOPREFIX$ | 1 - addons/SA_AdvancedTowing/config.cpp | 69 -- keys/AdvancedTowing.bikey | Bin 167 -> 0 bytes 14 files changed, 944 insertions(+), 143 deletions(-) rename addons/SA_AdvancedTowing.pbo => @exileserver/addons/xld_advanced_sling_tow.pbo (69%) create mode 100644 @exileserver/addons/xld_advanced_sling_tow/$PBOPREFIX$ create mode 100644 @exileserver/addons/xld_advanced_sling_tow/$PREFIX$ create mode 100644 @exileserver/addons/xld_advanced_sling_tow/PboPrefix.txt create mode 100644 @exileserver/addons/xld_advanced_sling_tow/config.cpp rename {addons/SA_AdvancedTowing => @exileserver/addons/xld_advanced_sling_tow}/functions/fn_advancedTowingInit.sqf (71%) create mode 100644 Changelog.txt.sqf create mode 100644 MPMissions/Exile.Altis/CfgRemoteExec.hpp -or- Description.ext create mode 100644 MPMissions/Exile.Altis/Custom/advSlingTow/fn_advancedTowingInit.sqf create mode 100644 MPMissions/Exile.Altis/init.sqf delete mode 100644 addons/SA_AdvancedTowing.pbo.AdvancedTowing.bisign delete mode 100644 addons/SA_AdvancedTowing/$PBOPREFIX$ delete mode 100644 addons/SA_AdvancedTowing/config.cpp delete mode 100644 keys/AdvancedTowing.bikey diff --git a/addons/SA_AdvancedTowing.pbo b/@exileserver/addons/xld_advanced_sling_tow.pbo similarity index 69% rename from addons/SA_AdvancedTowing.pbo rename to @exileserver/addons/xld_advanced_sling_tow.pbo index 6f4ca782adc811616efa28a4e132f5c3c001d6d7..f080810e4122b27271a0248c714428f7e3d4ae6a 100644 GIT binary patch delta 6862 zcmds5|8E;-8Bfx+>vb!XuFYC4v~O?gVyBM3#B(TZ6L4)OO`F77?7Hm|bA5C7I=;oe z^X|^E-Kw)DQ6Yqow!J@28WjQ|Kxjw?G*pDx_6P72zaYVHAQeU>K$-+U@x1Td#lG0d znl?WXDRF%F-upby=lwjN=Xvgr_xu0(p#SZ`=89f1NI|Xl)t9lN=$g4)FDVjM*0ClN zMKVjOwklbAt?v<+^~t(cP*;O;rP9ZK>iztq@63aTIrjg;ioU=N2Ccf)*Y_p3d(vLf z_t&w1{ z%UsH%33U6;d3Zvo5nO?|J1#W^gS=5y4Wi_TVXC?Yi^IVPU+vzBbFl1(#CTMi)0Jw8 zn9`IO5J_Dv5y>RRIx!?050Tqqf7tJa>r+)tw!i>5FKl>!y*ZnVE9)5seO9m8ZrhKP zv8vhMg#y?Bzr^LwIk@G5YeVD#I1srf3e51hb@)hJdL@}#tBuUmy1QaugW|>WtAyzS2Rq(Kh00~Y-WN(2A zx`9#*V7@`xP*+tAmr4z^(%5(`fXcd}7F43Jt674}==yAuKTxaHf=OLlBaH>Xr5K!< zpGu=q-55pe4&Qk0jIIO|dYP~P_{V5092rMR)vy{F@T5p?p%7ZbVe>*1RBgFg)B;K{OQvfFHJu&(2M<7;(p>yHGn-0E zxzweZ#B3@9CZlb8sy1rk0=WgagU>`>Lz->@Tr#$~$h@0K&m$i$5yOIWDd7e&5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%hPq zw~!CUjz4y?cb8zVlBVK=XfGe=-Nh3>n8PKW+#lcL>Sc@)QkZp*3+@IxVf?taXGhv8 zJa{c4To7d)5deHL(h2v1Z6x8?NZ|i646SMm1tEhw}88MQq>PYjmON@rfs)6`5B$2+6cF&S_vHgtD@NQ|8AxstS5qOOY zz^5~3;11`3`;)KzJq|a=BVeD1z-DX_-kfNM zs}qxOXCesN^ht1yq@ZTzj7lmDLdf1=e*`y=X?&R%(O6MW|MQVr}=3i%g-ia zNj@#`spwRapJw|lyWxkdYysK&a0~qTM3NWM(Kvr$F2x^&nquzNR`{aQ _vehTowedCounter) then { + _cargoHitch = ([_cargo] call SA_Get_Hitch_Points) select 0; + _vehicleHitch = ([_vehicle] call SA_Get_Hitch_Points) select 1; + _ropeLength = (ropeLength (_towRopes select 0)); + _objDistance = ((_vehicle modelToWorld _vehicleHitch) distance (_cargo modelToWorld _cargoHitch)); + if( _objDistance > _ropeLength ) then { + /*Team XLD(DS) - Add proper Exile notification message to player*/ + _towingName=getText (configFile >> "CfgVehicles" >> typeOf _vehicle >> "displayName"); + format["The tow ropes are too short. Move your %1 closer.",_towingName] remoteExec ["SA_Hint_Whoops", _player]; + } else { + [_vehicle,_player] call SA_Drop_Tow_Ropes; + _helper = "Land_Can_V2_F" createVehicle position _cargo; + _helper attachTo [_cargo, _cargoHitch]; + hideObject _helper; + [_helper] remoteExec ["SA_Hide_Object_Global",2]; + [_helper, [0,0,0], [0,0,-1]] ropeAttachTo (_towRopes select 0); + [_vehicle,_vehicleHitch,_cargo,_cargoHitch,_ropeLength] spawn SA_Simulate_Towing; + /*Team XLD(DS) - Add proper Exile notification message to player*/ + _towedName=getText (configFile >> "CfgVehicles" >> typeOf _cargo >> "displayName"); + format["You have attached the ropes to the %1!",_towedName] remoteExec ["SA_Hint_Success", _player]; + _vehTowedArray = _vehTowedArray + [_towRopes]; + _player setVariable["XLD_TOWED_ARRAY",_vehTowedArray]; + }; + } else { + /*Team XLD(DS) - Add proper Exile notification message to player*/ + _towedName=getText (configFile >> "CfgVehicles" >> typeOf _cargo >> "displayName"); + _msg=format["You can't tow more than %1 vehicles with your %2",XLD_MAX_TOWED_VEHICLES,_towedName]; + ["Whoops",[_msg]] call ExileClient_gui_notification_event_addNotification; + }; } else { - _cargoHitch = _cargoHitchPoints select 1; - _isRearCargoHitch = true; - }; - */ - - _cargoHitch = ([_cargo] call SA_Get_Hitch_Points) select 0; - - _vehicleHitch = ([_vehicle] call SA_Get_Hitch_Points) select 1; - _ropeLength = (ropeLength (_towRopes select 0)); - _objDistance = ((_vehicle modelToWorld _vehicleHitch) distance (_cargo modelToWorld _cargoHitch)); - if( _objDistance > _ropeLength ) then { - ["The tow ropes are too short. Move vehicle closer."] remoteExec ["SA_Hint", _player]; - } else { - [_vehicle,_player] call SA_Drop_Tow_Ropes; - _helper = "Land_Can_V2_F" createVehicle position _cargo; - _helper attachTo [_cargo, _cargoHitch]; - hideObject _helper; - [_helper] remoteExec ["SA_Hide_Object_Global",2]; - [_helper, [0,0,0], [0,0,-1]] ropeAttachTo (_towRopes select 0); - [_vehicle,_vehicleHitch,_cargo,_cargoHitch,_ropeLength] spawn SA_Simulate_Towing; + /*Team XLD(DS) - Add proper Exile notification message to player*/ + _towedName=getText (configFile >> "CfgVehicles" >> typeOf _cargo >> "displayName"); + _msg=format["The %1 is the lead vehicle of another chain",_towedName]; + ["Whoops",[_msg]] call ExileClient_gui_notification_event_addNotification; }; }; } else { @@ -265,18 +304,31 @@ SA_Attach_Tow_Ropes = { SA_Take_Tow_Ropes = { params ["_vehicle","_player"]; - if(local _vehicle) then { - diag_log format ["Take Tow Ropes Called %1", _this]; - private ["_existingTowRopes","_hitchPoint","_rope"]; - _existingTowRopes = _vehicle getVariable ["SA_Tow_Ropes",[]]; - if(count _existingTowRopes == 0) then { - _hitchPoint = [_vehicle] call SA_Get_Hitch_Points select 1; - _rope = ropeCreate [_vehicle, _hitchPoint, 10]; - _vehicle setVariable ["SA_Tow_Ropes",[_rope],true]; - _this call SA_Pickup_Tow_Ropes; + _hasItems = ("Exile_Item_Rope" in (magazines _player)); + _vehTowedArray = _player getVariable ["XLD_TOWED_ARRAY",""]; + if (_hasItems) then { + if(local _vehicle) then { + diag_log format ["Take Tow Ropes Called %1", _this]; + private ["_existingTowRopes","_hitchPoint","_rope"]; + _existingTowRopes = _vehicle getVariable ["SA_Tow_Ropes",[]]; + if(count _existingTowRopes == 0) then { + _hitchPoint = [_vehicle] call SA_Get_Hitch_Points select 1; + _rope = ropeCreate [_vehicle, _hitchPoint, 10]; + _vehicle setVariable ["SA_Tow_Ropes",[_rope],true]; + _this call SA_Pickup_Tow_Ropes; + /*Team XLD(DS) - remove rope from player*/ + _player removeItem "Exile_Item_Rope"; + //_vehTowedArray = [_vehTowedArray] + [_existingTowRopes]; + //player setVariable ["XLD_TOWED_ARRAY",_vehTowedArray]; + }; + } else { + _this remoteExecCall ["SA_Take_Tow_Ropes", _vehicle]; }; } else { - _this remoteExecCall ["SA_Take_Tow_Ropes", _vehicle]; + /*Team XLD(DS) - Send notification of rope required to tow*/ + _towingName=getText (configFile >> "CfgVehicles" >> typeOf _vehicle >> "displayName"); + _msg = format["You dont have any rope to tow with the %1!",_towingName]; + ["Whoops",[_msg]] call ExileClient_gui_notification_event_addNotification; }; }; @@ -292,6 +344,12 @@ SA_Put_Away_Tow_Ropes = { ropeDestroy _x; } forEach _existingTowRopes; _vehicle setVariable ["SA_Tow_Ropes",nil,true]; + /*Team XLD(DS) - Return rope on successful put away*/ + _player addItem "Exile_Item_Rope"; + /*Team XLD(DS) - Remove 1 count on successful put away*/ + _vehTowedArray = _player getVariable ["XLD_TOWED_ARRAY",[]]; + _vehTowedArray = _vehTowedArray - [_existingTowRopes]; + _player setVariable ["XLD_TOWED_ARRAY",_vehTowedArray]; }; } else { _this remoteExecCall ["SA_Put_Away_Tow_Ropes", _vehicle]; @@ -300,6 +358,7 @@ SA_Put_Away_Tow_Ropes = { SA_Pickup_Tow_Ropes = { params ["_vehicle","_player"]; + _towRopes = _vehicle getVariable ["SA_Tow_Ropes",[]]; if(local _vehicle) then { private ["_attachedObj","_helper"]; { @@ -317,6 +376,9 @@ SA_Pickup_Tow_Ropes = { [_helper] remoteExec ["SA_Hide_Object_Global",2]; _player setVariable ["SA_Tow_Ropes_Vehicle", _vehicle,true]; _player setVariable ["SA_Tow_Ropes_Pick_Up_Helper", _helper,true]; + _vehTowedArray = _player getVariable ["XLD_TOWED_ARRAY",[]]; + _vehTowedArray = _vehTowedArray - [_towRopes]; + _player setVariable ["XLD_TOWED_ARRAY",_vehTowedArray]; } else { _this remoteExecCall ["SA_Pickup_Tow_Ropes", _vehicle]; }; @@ -345,10 +407,27 @@ SA_Attach_Tow_Ropes_Action = { private ["_vehicle","_towVehicle"]; _vehicle = cursorTarget; _towVehicle = player getVariable ["SA_Tow_Ropes_Vehicle", objNull]; - if([_vehicle] call SA_Can_Attach_Tow_Ropes) then { - [_vehicle,player] call SA_Attach_Tow_Ropes; + /*Team XLD(DS) - Prevent Towing from Locked Vehicles*/ + _isNotLocked = (locked ExileClientInteractionObject !=2); + /*Team XLD(DS) - Prevent Deploying Rope in Safezones (troll stopper)*/ + if(!ExilePlayerInSafezone) then { + if(_isNotLocked) then { + if([_vehicle] call SA_Can_Attach_Tow_Ropes) then { + [_vehicle,player] call SA_Attach_Tow_Ropes; + } else { + false; + }; + } else { + /*Team XLD(DS) - Send proper Exile Whoops notification message to player*/ + _towedName=getText (configFile >> "CfgVehicles" >> typeOf _vehicle >> "displayName"); + _msg = format["The %1 is LOCKED!",_towedName]; + ["Whoops",[_msg]] call ExileClient_gui_notification_event_addNotification; + }; } else { - false; + /*Team XLD(DS) - Send proper Exile Whoops notification message to player*/ + _towedName=getText (configFile >> "CfgVehicles" >> typeOf _vehicle >> "displayName"); + _msg = format["You can't attach ropes to %1 in a SafeZone!",_towedName]; + ["Whoops",[_msg]] call ExileClient_gui_notification_event_addNotification; }; }; @@ -369,10 +448,10 @@ SA_Can_Attach_Tow_Ropes = { _isTowVehicleBeingTowed = not isNull (_towVehicle getVariable ["SA_TOWING_VEHICLE",objNull]); _isTowVehicleTowingCargo = not isNull (_towVehicle getVariable ["SA_TOWING_CARGO",objNull]); _canBeTowed = [_towVehicle,_cargo] call SA_Is_Supported_Cargo && vehicle player == player && player distance _cargo < 10 && _towVehicle != _cargo && !_isTowVehicleTowingCargo && !_isCargoBeingTowed && ((!_isTowVehicleBeingTowed && !_isCargoTowingCargo) || _isChainingEnabled); - if!(missionNamespace getVariable ["SA_TOW_LOCKED_VEHICLES_ENABLED",false]) then { + if!(missionNamespace getVariable ["XLD_LOCKED_NOTIFICATION",true]) then { _canBeTowed = _canBeTowed && locked _cargo <= 1; }; - if!(missionNamespace getVariable ["SA_TOW_IN_EXILE_SAFEZONE_ENABLED",false]) then { + if!(missionNamespace getVariable ["XLD_SAFEZONE_NOTIFICATION",true]) then { if(!isNil "ExilePlayerInSafezone") then { _canBeTowed = _canBeTowed && !ExilePlayerInSafezone; }; @@ -441,10 +520,6 @@ SA_Drop_Tow_Ropes_Action = { }; }; -SA_TOW_SUPPORTED_VEHICLES = [ - "Tank", "Car", "Ship" -]; - SA_Is_Supported_Vehicle = { params ["_vehicle","_isSupported"]; _isSupported = false; @@ -458,17 +533,6 @@ SA_Is_Supported_Vehicle = { _isSupported; }; -SA_TOW_RULES = [ - ["Tank","CAN_TOW","Tank"], - ["Tank","CAN_TOW","Car"], - ["Tank","CAN_TOW","Ship"], - ["Tank","CAN_TOW","Air"], - ["Car","CAN_TOW","Car"], - ["Car","CAN_TOW","Ship"], - ["Car","CAN_TOW","Air"], - ["Ship","CAN_TOW","Ship"] -]; - SA_Is_Supported_Cargo = { params ["_vehicle","_cargo"]; private ["_canTow"]; @@ -489,9 +553,15 @@ SA_Is_Supported_Cargo = { _canTow; }; -SA_Hint = { +SA_Hint_Whoops = { + params ["_msg"]; + /*Team XLD(DS) - Send proper Exile Whoops notification message to player*/ + ["Whoops",[_msg]] call ExileClient_gui_notification_event_addNotification; +}; +SA_Hint_Success = { params ["_msg"]; - hint _msg; + /*Team XLD(DS) - Send proper Exile Success notification message to player*/ + ["Success",[_msg]] call ExileClient_gui_notification_event_addNotification; }; SA_Hide_Object_Global = { @@ -507,8 +577,23 @@ SA_Set_Owner = { SA_Take_Tow_Ropes_Action = { private ["_vehicle"]; _vehicle = cursorTarget; - if([_vehicle] call SA_Is_Supported_Vehicle) then { - [_vehicle,player] call SA_Take_Tow_Ropes; + /*Team XLD(DS) - Prevent Towing from Locked Vehicles*/ + _isNotLocked = (locked ExileClientInteractionObject !=2); + /*Team XLD(DS) - Prevent Deploying Rope in Safezones (troll stopper)*/ + if(!ExilePlayerInSafezone) then { + if(([_vehicle] call SA_Is_Supported_Vehicle) && (_isNotLocked)) then { + [_vehicle,player] call SA_Take_Tow_Ropes; + } else { + /*Team XLD(DS) - Send proper Exile Whoops notification message to player*/ + _towingName=getText (configFile >> "CfgVehicles" >> typeOf _vehicle >> "displayName"); + _msg = format["The %1 is LOCKED!",_towingName]; + ["Whoops",[_msg]] call ExileClient_gui_notification_event_addNotification; + }; + } else { + /*Team XLD(DS) - Send proper Exile Whoops notification message to player*/ + _towingName=getText (configFile >> "CfgVehicles" >> typeOf _vehicle >> "displayName"); + _msg = format["Your %1 can't tow in a SafeZone!",_towingName]; + ["Whoops",[_msg]] call ExileClient_gui_notification_event_addNotification; }; }; @@ -536,9 +621,11 @@ SA_Add_Player_Tow_Actions = { }, nil, 0, false, true, "", "call SA_Attach_Tow_Ropes_Action_Check"]; player addAction ["Cannot Attach Tow Ropes", { - hint "Your vehicle is not strong enough to tow this. Find a larger vehicle!"; + //hint "Your vehicle is not strong enough to tow this. Find a larger vehicle!"; + /*Team XLD(DS) - Send proper Exile Notification for players*/ + ["Whoops",["Your vehicle is not strong enough to tow this. Find a larger vehicle!"]] call ExileClient_gui_notification_event_addNotification; }, nil, 0, false, true, "", "call SA_Attach_Tow_Ropes_Action_Disabled_Check"]; - + player addAction ["Drop Tow Ropes", { [] call SA_Drop_Tow_Ropes_Action; }, nil, 0, false, true, "", "call SA_Drop_Tow_Ropes_Action_Check"]; @@ -584,6 +671,8 @@ if(!isDedicated) then { if!( player getVariable ["SA_Tow_Actions_Loaded",false] ) then { [] call SA_Add_Player_Tow_Actions; player setVariable ["SA_Tow_Actions_Loaded",true]; + //player setVariable ["XLD_TOWED_ARRAY",false]; + player setVariable ["XLD_TOWED_COUNTER",0]; }; }; missionNamespace setVariable ["SA_Nearby_Tow_Vehicles", (call SA_Find_Nearby_Tow_Vehicles)]; @@ -593,6 +682,3 @@ if(!isDedicated) then { }; diag_log "Advanced Towing Loaded"; - -} remoteExecCall ["bis_fnc_call", 0,true]; - diff --git a/Changelog.txt.sqf b/Changelog.txt.sqf new file mode 100644 index 0000000..3a1e75f --- /dev/null +++ b/Changelog.txt.sqf @@ -0,0 +1,40 @@ +/** + * changelog.txt + * + * eXileLoneDevs presents SethDuda's Advanced Towing for Exile + * Originally by SethDuda, modified by Team XLD + * www.DonkeyPunch.INFO -or- www.ExileMod.Com + * © 2016 DirtySanchez / ka0s<3 + * +The MIT License (MIT) +Copyright (c) 2016 Seth Duda +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. +*/ + +1. Changed from an addon to an @ExileServer addons folder PBO +2. Cleaned up CfgRemoteExec code sethduda provided as exile compatible +3. Changed SA_Hint system for Exile Notifications + -Made one Whoops and another Success +4. Added vehicle names to the new Notifications +5. Modified Cannot Tow from Hint to Exile Notification +6. Lock checks on both deploy and attach with appropriate Notifications +7. Added Exile_Item_Rope requirement for Deploy +8. Added Return Rope for Pack +9. SafeZones checks added to Deploy and Attach with appropriate Exile Notifications +10. Prevent Tow loop of vehicles, if vehicle is towing it cant be towed(can be reworked) +11. Started a max tow limit config and counter(WIP) +12. Added configurable Max Tow Limits and Exile Notification when Max has been reached +13. Currently Towing counter for attach and pack ropes +v0.8 +14. Merged with Sethdudas newest update-fix for bridges and more +15. Added new configurable variables from seths update-fix + +16. Reworked max tow limits in array for keeping ropes, much easier to track and remove +17. Added configurations for using Locked and SafeZone Notifications. Set to true/false + +TODO: + +1. any new bugs / fixes / additions provided + \ No newline at end of file diff --git a/MPMissions/Exile.Altis/CfgRemoteExec.hpp -or- Description.ext b/MPMissions/Exile.Altis/CfgRemoteExec.hpp -or- Description.ext new file mode 100644 index 0000000..42b9363 --- /dev/null +++ b/MPMissions/Exile.Altis/CfgRemoteExec.hpp -or- Description.ext @@ -0,0 +1,23 @@ +class CfgRemoteExec +{ + class Functions + { + mode = 1; + jip = 0; + class SA_Simulate_Towing { allowedTargets=0; }; + class SA_Attach_Tow_Ropes { allowedTargets=0; }; + class SA_Take_Tow_Ropes { allowedTargets=0; }; + class SA_Put_Away_Tow_Ropes { allowedTargets=0; }; + class SA_Pickup_Tow_Ropes { allowedTargets=0; }; + class SA_Drop_Tow_Ropes { allowedTargets=0; }; + class SA_Set_Owner { allowedTargets=2; }; + class SA_Hint_Success { allowedTargets=1; }; + class SA_Hint_Whoops { allowedTargets=1; }; + class SA_Hide_Object_Global { allowedTargets=2; }; + }; + class Commands + { + mode=0; + jip=0; + }; +}; \ No newline at end of file diff --git a/MPMissions/Exile.Altis/Custom/advSlingTow/fn_advancedTowingInit.sqf b/MPMissions/Exile.Altis/Custom/advSlingTow/fn_advancedTowingInit.sqf new file mode 100644 index 0000000..9bd3cf5 --- /dev/null +++ b/MPMissions/Exile.Altis/Custom/advSlingTow/fn_advancedTowingInit.sqf @@ -0,0 +1,684 @@ +/** + * fn_advancedTowingInit.sqf + * + * eXileLoneDevs presents SethDuda's Advanced Towing for Exile + * Originally by SethDuda, modified by Team XLD + * www.DonkeyPunch.INFO -or- www.ExileMod.Com + * © 2016 DirtySanchez / ka0s<3 + * +The MIT License (MIT) + +Copyright (c) 2016 Seth Duda + +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. +*/ + +//Set chaining enabled +SA_TOW_CHAINS_ENABLED = true; +// Set your maximum allowed towed vehicles(only works if Chains enabled = true;) +XLD_MAX_TOWED_VEHICLES = 3; +// Set in-safezone check notifications true=ON (alerts player on failed attempt while in safezone) false=OFF (no options in safezone for towing) +XLD_SAFEZONE_NOTIFICATION = true; +// Set in-safezone check notifications true=ON (alerts player on failed attempt while vehicle is Locked) false=OFF (no options while vehicle is Locked for towing) +XLD_LOCKED_NOTIFICATION = true; +// Set vehicle types supported +SA_TOW_SUPPORTED_VEHICLES = ["Tank", "Car", "Ship"]; +//Set vehicle rules for towing +SA_TOW_RULES = [ + ["Tank","CAN_TOW","Tank"], + ["Tank","CAN_TOW","Car"], + ["Tank","CAN_TOW","Ship"], + ["Tank","CAN_TOW","Air"], + ["Tank","CAN_TOW","Cargo_base_F"], + ["Car","CAN_TOW","Car"], + ["Car","CAN_TOW","Ship"], + ["Car","CAN_TOW","Air"], + ["Car","CANT_TOW","Helicopter"], + ["Truck_F","CAN_TOW","Helicopter"], + ["Truck_F","CAN_TOW","Cargo_base_F"], + ["Ship","CAN_TOW","Ship"] +]; + +/////////////////////////////////////////////////////////////////////// +#define SA_Find_Surface_ASL_Under_Position(_object,_positionAGL,_returnSurfaceASL,_canFloat) \ +_objectASL = AGLToASL (_object modelToWorldVisual (getCenterOfMass _object)); \ +_surfaceIntersectStartASL = [_positionAGL select 0, _positionAGL select 1, (_objectASL select 2) + 1]; \ +_surfaceIntersectEndASL = [_positionAGL select 0, _positionAGL select 1, (_objectASL select 2) - 10]; \ +_surfaces = lineIntersectsSurfaces [_surfaceIntersectStartASL, _surfaceIntersectEndASL, _object, objNull, true, 2]; \ +_returnSurfaceASL = [_positionAGL select 0, _positionAGL select 1, 0]; \ +if(count _surfaces > 0) then { \ + if!(((_surfaces select 0) select 2) isKindOf "RopeSegment") then { \ + _returnSurfaceASL = (_surfaces select 0) select 0; \ + } else { \ + if(count _surfaces > 1) then { \ + if!(((_surfaces select 1) select 2) isKindOf "RopeSegment") then { \ + _returnSurfaceASL = (_surfaces select 1) select 0; \ + }; \ + }; \ + }; \ + if(_canFloat && (_returnSurfaceASL select 2) < 0) then { \ + _returnSurfaceASL set [2,0]; \ + }; \ +}; + +#define SA_Find_Surface_ASL_Under_Model(_object,_modelOffset,_returnSurfaceASL,_canFloat) \ +SA_Find_Surface_ASL_Under_Position(_object, (_object modelToWorldVisual _modelOffset), _returnSurfaceASL,_canFloat); + +#define SA_Find_Surface_AGL_Under_Model(_object,_modelOffset,_returnSurfaceAGL,_canFloat) \ +SA_Find_Surface_ASL_Under_Model(_object,_modelOffset,_returnSurfaceAGL,_canFloat); \ +_returnSurfaceAGL = ASLtoAGL _returnSurfaceAGL; + +diag_log "Advanced Towing Loading..."; + +SA_TOW_INIT = true; + +SA_Simulate_Towing = { + + params ["_vehicle","_vehicleHitchModelPos","_cargo","_cargoHitchModelPos","_ropeLength"]; + + _cargo setVariable ["SA_TOWING_VEHICLE",_vehicle,true]; + _vehicle setVariable ["SA_TOWING_CARGO",_cargo,true]; + + private ["_lastCargoHitchPosition","_lastCargoVectorDir","_cargoLength","_maxDistanceToCargo","_lastMovedCargoPosition","_cargoHitchPoints"]; + private ["_vehicleHitchPosition","_cargoHitchPosition","_newCargoHitchPosition","_cargoVector","_movedCargoVector","_attachedObjects"]; + private ["_newCargoDir","_lastCargoVectorDir","_newCargoPosition","_doExit","_cargoPosition","_vehiclePosition","_maxVehicleSpeed","_vehicleMass","_cargoMass","_cargoCanFloat"]; + private ["_cargoCorner1AGL","_cargoCorner1ASL","_cargoCorner2AGL","_cargoCorner2ASL","_cargoCorner3AGL","_cargoCorner3ASL","_cargoCorner4AGL","_cargoCorner4ASL","_surfaceNormal1","_surfaceNormal2","_surfaceNormal"]; + + _maxVehicleSpeed = getNumber (configFile >> "CfgVehicles" >> typeOf _vehicle >> "maxSpeed"); + _cargoCanFloat = if( getNumber (configFile >> "CfgVehicles" >> typeOf _cargo >> "canFloat") == 1 ) then { true } else { false }; + + private ["_cargoCenterOfMassAGL","_cargoModelCenterGroundPosition"]; + SA_Find_Surface_AGL_Under_Model(_cargo,getCenterOfMass _cargo,_cargoCenterOfMassAGL,_cargoCanFloat); + _cargoModelCenterGroundPosition = _cargo worldToModelVisual _cargoCenterOfMassAGL; + _cargoModelCenterGroundPosition set [0,0]; + _cargoModelCenterGroundPosition set [1,0]; + + // Calculate cargo model corner points + private ["_cargoCornerPoints"]; + _cargoCornerPoints = [_vehicle] call SA_Get_Corner_Points; + _corner1 = _cargoCornerPoints select 0; + _corner2 = _cargoCornerPoints select 1; + _corner3 = _cargoCornerPoints select 2; + _corner4 = _cargoCornerPoints select 3; + + + // Try to set cargo owner if the towing client doesn't own the cargo + if(local _vehicle && !local _cargo) then { + [_cargo, clientOwner] remoteExec ["SA_Set_Owner", 2]; + }; + + _vehicleHitchModelPos set [2,0]; + _cargoHitchModelPos set [2,0]; + + _lastCargoHitchPosition = _cargo modelToWorld _cargoHitchModelPos; + _lastCargoVectorDir = vectorDir _cargo; + _lastMovedCargoPosition = getPos _cargo; + + _cargoHitchPoints = [_cargo] call SA_Get_Hitch_Points; + _cargoLength = (_cargoHitchPoints select 0) distance (_cargoHitchPoints select 1); + + _vehicleMass = 1 max (getMass _vehicle); + _cargoMass = getMass _cargo; + if(_cargoMass == 0) then { + _cargoMass = _vehicleMass; + }; + + _maxDistanceToCargo = _ropeLength; + + _doExit = false; + + while {!_doExit} do { + + _vehicleHitchPosition = _vehicle modelToWorld _vehicleHitchModelPos; + _vehicleHitchPosition set [2,0]; + _cargoHitchPosition = _lastCargoHitchPosition; + _cargoHitchPosition set [2,0]; + + _cargoPosition = getPos _cargo; + _vehiclePosition = getPos _vehicle; + + if(_vehicleHitchPosition distance _cargoHitchPosition > _maxDistanceToCargo) then { + + // Calculated simulated towing position + direction + _newCargoHitchPosition = _vehicleHitchPosition vectorAdd ((_vehicleHitchPosition vectorFromTo _cargoHitchPosition) vectorMultiply _ropeLength); + _cargoVector = _lastCargoVectorDir vectorMultiply _cargoLength; + _movedCargoVector = _newCargoHitchPosition vectorDiff _lastCargoHitchPosition; + _newCargoDir = vectorNormalized (_cargoVector vectorAdd _movedCargoVector); + //if(_isRearCargoHitch) then { + // _newCargoDir = _newCargoDir vectorMultiply -1; + //}; + _lastCargoVectorDir = _newCargoDir; + _newCargoPosition = _newCargoHitchPosition vectorAdd (_newCargoDir vectorMultiply -(vectorMagnitude (_cargoHitchModelPos))); + + SA_Find_Surface_ASL_Under_Position(_cargo,_newCargoPosition,_newCargoPosition,_cargoCanFloat); + + // Calculate surface normal (up) (more realistic than surfaceNormal function) + SA_Find_Surface_ASL_Under_Model(_cargo,_corner1,_cargoCorner1ASL,_cargoCanFloat); + SA_Find_Surface_ASL_Under_Model(_cargo,_corner2,_cargoCorner2ASL,_cargoCanFloat); + SA_Find_Surface_ASL_Under_Model(_cargo,_corner3,_cargoCorner3ASL,_cargoCanFloat); + SA_Find_Surface_ASL_Under_Model(_cargo,_corner4,_cargoCorner4ASL,_cargoCanFloat); + _surfaceNormal1 = (_cargoCorner1ASL vectorFromTo _cargoCorner3ASL) vectorCrossProduct (_cargoCorner1ASL vectorFromTo _cargoCorner2ASL); + _surfaceNormal2 = (_cargoCorner4ASL vectorFromTo _cargoCorner2ASL) vectorCrossProduct (_cargoCorner4ASL vectorFromTo _cargoCorner3ASL); + _surfaceNormal = _surfaceNormal1 vectorAdd _surfaceNormal2; + + _newCargoPosition = _newCargoPosition vectorAdd ( _cargoModelCenterGroundPosition vectorMultiply -1 ); + + _cargo setVectorDir _newCargoDir; + _cargo setVectorUp _surfaceNormal; + _cargo setPosWorld _newCargoPosition; + + _lastCargoHitchPosition = _newCargoHitchPosition; + _maxDistanceToCargo = _vehicleHitchPosition distance _newCargoHitchPosition; + _lastMovedCargoPosition = _cargoPosition; + + _massAdjustedMaxSpeed = (0.1 * _maxVehicleSpeed) max ((0.75 * _maxVehicleSpeed) * ( 1 min (_vehicleMass / _cargoMass) )); + if(speed _vehicle > (_massAdjustedMaxSpeed)+0.1 && _massAdjustedMaxSpeed > 0) then { + _vehicle setVelocity ((vectorNormalized (velocity _vehicle)) vectorMultiply (_massAdjustedMaxSpeed/3.6)); + }; + + } else { + + if(_lastMovedCargoPosition distance _cargoPosition > 2) then { + _lastCargoHitchPosition = _cargo modelToWorld _cargoHitchModelPos; + _lastCargoVectorDir = vectorDir _cargo; + }; + + }; + + if(!local _vehicle) then { + _this remoteExec ["SA_Simulate_Towing", _vehicle]; + _doExit = true; + }; + + if( count (ropeAttachedObjects _vehicle) == 0 ) then { + _doExit = true; + } else { + _attachedObjects = ropeAttachedObjects _vehicle; + if( (attachedTo (_attachedObjects select 0)) != _cargo ) then { + _doExit = true; + }; + }; + + sleep 0.01; + + }; + + _cargo setVariable ["SA_TOWING_VEHICLE",nil,true]; + _vehicle setVariable ["SA_TOWING_CARGO",nil,true]; + +}; + +SA_Get_Corner_Points = { + params ["_vehicle"]; + private ["_centerOfMass","_bbr","_p1","_p2","_rearCorner","_rearCorner2","_frontCorner","_frontCorner2"]; + private ["_maxWidth","_widthOffset","_maxLength","_lengthOffset"]; + _centerOfMass = getCenterOfMass _vehicle; + _bbr = boundingBoxReal _vehicle; + _p1 = _bbr select 0; + _p2 = _bbr select 1; + _maxWidth = abs ((_p2 select 0) - (_p1 select 0)); + _widthOffset = ((_maxWidth / 2) - abs ( _centerOfMass select 0 )) * 0.75; + _maxLength = abs ((_p2 select 1) - (_p1 select 1)); + _lengthOffset = ((_maxLength / 2) - abs (_centerOfMass select 1 )) * 0.75; + _rearCorner = [(_centerOfMass select 0) + _widthOffset, (_centerOfMass select 1) - _lengthOffset, _centerOfMass select 2]; + _rearCorner2 = [(_centerOfMass select 0) - _widthOffset, (_centerOfMass select 1) - _lengthOffset, _centerOfMass select 2]; + _frontCorner = [(_centerOfMass select 0) + _widthOffset, (_centerOfMass select 1) + _lengthOffset, _centerOfMass select 2]; + _frontCorner2 = [(_centerOfMass select 0) - _widthOffset, (_centerOfMass select 1) + _lengthOffset, _centerOfMass select 2]; + [_rearCorner,_rearCorner2,_frontCorner,_frontCorner2]; +}; + +SA_Get_Hitch_Points = { + params ["_vehicle"]; + private ["_cornerPoints","_rearCorner","_rearCorner2","_frontCorner","_frontCorner2","_rearHitchPoint"]; + private ["_frontHitchPoint","_sideLeftPoint","_sideRightPoint"]; + _cornerPoints = [_vehicle] call SA_Get_Corner_Points; + _rearCorner = _cornerPoints select 0; + _rearCorner2 = _cornerPoints select 1; + _frontCorner = _cornerPoints select 2; + _frontCorner2 = _cornerPoints select 3; + _rearHitchPoint = ((_rearCorner vectorDiff _rearCorner2) vectorMultiply 0.5) vectorAdd _rearCorner2; + _frontHitchPoint = ((_frontCorner vectorDiff _frontCorner2) vectorMultiply 0.5) vectorAdd _frontCorner2; + //_sideLeftPoint = ((_frontCorner vectorDiff _rearCorner) vectorMultiply 0.5) vectorAdd _frontCorner; + //_sideRightPoint = ((_frontCorner2 vectorDiff _rearCorner2) vectorMultiply 0.5) vectorAdd _frontCorner2; + [_frontHitchPoint,_rearHitchPoint]; +}; + +SA_Attach_Tow_Ropes = { + params ["_cargo","_player"]; + _vehicle = _player getVariable ["SA_Tow_Ropes_Vehicle", objNull]; + if(!isNull _vehicle) then { + if(local _vehicle) then { + private ["_towRopes","_vehicleHitch","_cargoHitch","_objDistance","_ropeLength"]; + _towRopes = _vehicle getVariable ["SA_Tow_Ropes",[]]; + if(count _towRopes == 1) then { + /*Team XLD(DS) - Prevent players from doing a Loop of towed Vehicles*/ + if((count (ropeAttachedObjects _cargo)) < 1 ) then { + /*Team XLD(DS) - Get number of currently towed vehicles for Max limit settings*/ + _vehTowedArray = _player getVariable ["XLD_TOWED_ARRAY",[]]; + _vehTowedCounter = count _vehTowedArray; + if (XLD_MAX_TOWED_VEHICLES > _vehTowedCounter) then { + _cargoHitch = ([_cargo] call SA_Get_Hitch_Points) select 0; + _vehicleHitch = ([_vehicle] call SA_Get_Hitch_Points) select 1; + _ropeLength = (ropeLength (_towRopes select 0)); + _objDistance = ((_vehicle modelToWorld _vehicleHitch) distance (_cargo modelToWorld _cargoHitch)); + if( _objDistance > _ropeLength ) then { + /*Team XLD(DS) - Add proper Exile notification message to player*/ + _towingName=getText (configFile >> "CfgVehicles" >> typeOf _vehicle >> "displayName"); + format["The tow ropes are too short. Move your %1 closer.",_towingName] remoteExec ["SA_Hint_Whoops", _player]; + } else { + [_vehicle,_player] call SA_Drop_Tow_Ropes; + _helper = "Land_Can_V2_F" createVehicle position _cargo; + _helper attachTo [_cargo, _cargoHitch]; + hideObject _helper; + [_helper] remoteExec ["SA_Hide_Object_Global",2]; + [_helper, [0,0,0], [0,0,-1]] ropeAttachTo (_towRopes select 0); + [_vehicle,_vehicleHitch,_cargo,_cargoHitch,_ropeLength] spawn SA_Simulate_Towing; + /*Team XLD(DS) - Add proper Exile notification message to player*/ + _towedName=getText (configFile >> "CfgVehicles" >> typeOf _cargo >> "displayName"); + format["You have attached the ropes to the %1!",_towedName] remoteExec ["SA_Hint_Success", _player]; + _vehTowedArray = _vehTowedArray + [_towRopes]; + _player setVariable["XLD_TOWED_ARRAY",_vehTowedArray]; + }; + } else { + /*Team XLD(DS) - Add proper Exile notification message to player*/ + _towedName=getText (configFile >> "CfgVehicles" >> typeOf _cargo >> "displayName"); + _msg=format["You can't tow more than %1 vehicles with your %2",XLD_MAX_TOWED_VEHICLES,_towedName]; + ["Whoops",[_msg]] call ExileClient_gui_notification_event_addNotification; + }; + } else { + /*Team XLD(DS) - Add proper Exile notification message to player*/ + _towedName=getText (configFile >> "CfgVehicles" >> typeOf _cargo >> "displayName"); + _msg=format["The %1 is the lead vehicle of another chain",_towedName]; + ["Whoops",[_msg]] call ExileClient_gui_notification_event_addNotification; + }; + }; + } else { + _this remoteExecCall ["SA_Attach_Tow_Ropes", _vehicle]; + }; + }; +}; + +SA_Take_Tow_Ropes = { + params ["_vehicle","_player"]; + _hasItems = ("Exile_Item_Rope" in (magazines _player)); + _vehTowedArray = _player getVariable ["XLD_TOWED_ARRAY",""]; + if (_hasItems) then { + if(local _vehicle) then { + diag_log format ["Take Tow Ropes Called %1", _this]; + private ["_existingTowRopes","_hitchPoint","_rope"]; + _existingTowRopes = _vehicle getVariable ["SA_Tow_Ropes",[]]; + if(count _existingTowRopes == 0) then { + _hitchPoint = [_vehicle] call SA_Get_Hitch_Points select 1; + _rope = ropeCreate [_vehicle, _hitchPoint, 10]; + _vehicle setVariable ["SA_Tow_Ropes",[_rope],true]; + _this call SA_Pickup_Tow_Ropes; + /*Team XLD(DS) - remove rope from player*/ + _player removeItem "Exile_Item_Rope"; + //_vehTowedArray = [_vehTowedArray] + [_existingTowRopes]; + //player setVariable ["XLD_TOWED_ARRAY",_vehTowedArray]; + }; + } else { + _this remoteExecCall ["SA_Take_Tow_Ropes", _vehicle]; + }; + } else { + /*Team XLD(DS) - Send notification of rope required to tow*/ + _towingName=getText (configFile >> "CfgVehicles" >> typeOf _vehicle >> "displayName"); + _msg = format["You dont have any rope to tow with the %1!",_towingName]; + ["Whoops",[_msg]] call ExileClient_gui_notification_event_addNotification; + }; +}; + +SA_Put_Away_Tow_Ropes = { + params ["_vehicle","_player"]; + if(local _vehicle) then { + private ["_existingTowRopes","_hitchPoint","_rope"]; + _existingTowRopes = _vehicle getVariable ["SA_Tow_Ropes",[]]; + if(count _existingTowRopes > 0) then { + _this call SA_Pickup_Tow_Ropes; + _this call SA_Drop_Tow_Ropes; + { + ropeDestroy _x; + } forEach _existingTowRopes; + _vehicle setVariable ["SA_Tow_Ropes",nil,true]; + /*Team XLD(DS) - Return rope on successful put away*/ + _player addItem "Exile_Item_Rope"; + /*Team XLD(DS) - Remove 1 count on successful put away*/ + _vehTowedArray = _player getVariable ["XLD_TOWED_ARRAY",[]]; + _vehTowedArray = _vehTowedArray - [_existingTowRopes]; + _player setVariable ["XLD_TOWED_ARRAY",_vehTowedArray]; + }; + } else { + _this remoteExecCall ["SA_Put_Away_Tow_Ropes", _vehicle]; + }; +}; + +SA_Pickup_Tow_Ropes = { + params ["_vehicle","_player"]; + _towRopes = _vehicle getVariable ["SA_Tow_Ropes",[]]; + if(local _vehicle) then { + private ["_attachedObj","_helper"]; + { + _attachedObj = _x; + { + _attachedObj ropeDetach _x; + } forEach (_vehicle getVariable ["SA_Tow_Ropes",[]]); + } forEach ropeAttachedObjects _vehicle; + _helper = "Land_Can_V2_F" createVehicle position _player; + { + [_helper, [0, 0, 0], [0,0,-1]] ropeAttachTo _x; + _helper attachTo [_player, [-0.1, 0.1, 0.15], "Pelvis"]; + } forEach (_vehicle getVariable ["SA_Tow_Ropes",[]]); + hideObject _helper; + [_helper] remoteExec ["SA_Hide_Object_Global",2]; + _player setVariable ["SA_Tow_Ropes_Vehicle", _vehicle,true]; + _player setVariable ["SA_Tow_Ropes_Pick_Up_Helper", _helper,true]; + _vehTowedArray = _player getVariable ["XLD_TOWED_ARRAY",[]]; + _vehTowedArray = _vehTowedArray - [_towRopes]; + _player setVariable ["XLD_TOWED_ARRAY",_vehTowedArray]; + } else { + _this remoteExecCall ["SA_Pickup_Tow_Ropes", _vehicle]; + }; +}; + +SA_Drop_Tow_Ropes = { + params ["_vehicle","_player"]; + if(local _vehicle) then { + private ["_helper"]; + _helper = (_player getVariable ["SA_Tow_Ropes_Pick_Up_Helper", objNull]); + if(!isNull _helper) then { + { + _helper ropeDetach _x; + } forEach (_vehicle getVariable ["SA_Tow_Ropes",[]]); + detach _helper; + deleteVehicle _helper; + }; + _player setVariable ["SA_Tow_Ropes_Vehicle", nil,true]; + _player setVariable ["SA_Tow_Ropes_Pick_Up_Helper", nil,true]; + } else { + _this remoteExecCall ["SA_Drop_Tow_Ropes", _vehicle]; + }; +}; + +SA_Attach_Tow_Ropes_Action = { + private ["_vehicle","_towVehicle"]; + _vehicle = cursorTarget; + _towVehicle = player getVariable ["SA_Tow_Ropes_Vehicle", objNull]; + /*Team XLD(DS) - Prevent Towing from Locked Vehicles*/ + _isNotLocked = (locked ExileClientInteractionObject !=2); + /*Team XLD(DS) - Prevent Deploying Rope in Safezones (troll stopper)*/ + if(!ExilePlayerInSafezone) then { + if(_isNotLocked) then { + if([_vehicle] call SA_Can_Attach_Tow_Ropes) then { + [_vehicle,player] call SA_Attach_Tow_Ropes; + } else { + false; + }; + } else { + /*Team XLD(DS) - Send proper Exile Whoops notification message to player*/ + _towedName=getText (configFile >> "CfgVehicles" >> typeOf _vehicle >> "displayName"); + _msg = format["The %1 is LOCKED!",_towedName]; + ["Whoops",[_msg]] call ExileClient_gui_notification_event_addNotification; + }; + } else { + /*Team XLD(DS) - Send proper Exile Whoops notification message to player*/ + _towedName=getText (configFile >> "CfgVehicles" >> typeOf _vehicle >> "displayName"); + _msg = format["You can't attach ropes to %1 in a SafeZone!",_towedName]; + ["Whoops",[_msg]] call ExileClient_gui_notification_event_addNotification; + }; +}; + +SA_Attach_Tow_Ropes_Action_Check = { + private ["_vehicle","_towVehicle","_isCargoBeingTowed","_isCargoTowingCargo","_isChainingEnabled","_isTowVehicleBeingTowed","_isTowVehicleTowingCargo"]; + _vehicle = cursorTarget; + [_vehicle] call SA_Can_Attach_Tow_Ropes; +}; + +SA_Can_Attach_Tow_Ropes = { + params ["_cargo"]; + private ["_towVehicle","_isCargoBeingTowed","_isCargoTowingCargo","_isChainingEnabled","_isTowVehicleBeingTowed","_isTowVehicleTowingCargo","_canBeTowed"]; + _towVehicle = player getVariable ["SA_Tow_Ropes_Vehicle", objNull]; + if(!isNull _towVehicle && !isNull _cargo) then { + _isChainingEnabled = missionNamespace getVariable ["SA_TOW_CHAINS_ENABLED",false]; + _isCargoBeingTowed = not isNull (_cargo getVariable ["SA_TOWING_VEHICLE",objNull]); + _isCargoTowingCargo = not isNull (_cargo getVariable ["SA_TOWING_CARGO",objNull]); + _isTowVehicleBeingTowed = not isNull (_towVehicle getVariable ["SA_TOWING_VEHICLE",objNull]); + _isTowVehicleTowingCargo = not isNull (_towVehicle getVariable ["SA_TOWING_CARGO",objNull]); + _canBeTowed = [_towVehicle,_cargo] call SA_Is_Supported_Cargo && vehicle player == player && player distance _cargo < 10 && _towVehicle != _cargo && !_isTowVehicleTowingCargo && !_isCargoBeingTowed && ((!_isTowVehicleBeingTowed && !_isCargoTowingCargo) || _isChainingEnabled); + if!(missionNamespace getVariable ["XLD_LOCKED_NOTIFICATION",true]) then { + _canBeTowed = _canBeTowed && locked _cargo <= 1; + }; + if!(missionNamespace getVariable ["XLD_SAFEZONE_NOTIFICATION",true]) then { + if(!isNil "ExilePlayerInSafezone") then { + _canBeTowed = _canBeTowed && !ExilePlayerInSafezone; + }; + }; + _canBeTowed; + } else { + false; + }; +}; + +SA_Attach_Tow_Ropes_Action_Disabled_Check = { + private ["_vehicle","_towVehicle"]; + _vehicle = cursorTarget; + _towVehicle = player getVariable ["SA_Tow_Ropes_Vehicle", objNull]; + if(!isNull _towVehicle && !isNull _vehicle) then { + not([_towVehicle,_vehicle] call SA_Is_Supported_Cargo) && vehicle player == player && player distance _vehicle < 10 && _towVehicle != _vehicle; + } else { + false; + }; +}; + +SA_Take_Tow_Ropes_Action_Check = { + private ["_vehicle"]; + _vehicle = cursorTarget; + if([_vehicle] call SA_Is_Supported_Vehicle) then { + _existingTowRopes = _vehicle getVariable ["SA_Tow_Ropes",[]]; + _towVehicle = player getVariable ["SA_Tow_Ropes_Vehicle", objNull]; + vehicle player == player && player distance _vehicle < 10 && (count _existingTowRopes) == 0 && isNull _towVehicle; + } else { + false; + }; +}; + +SA_Put_Away_Tow_Ropes_Action_Check = { + private ["_vehicle"]; + _vehicle = cursorTarget; + if([_vehicle] call SA_Is_Supported_Vehicle) then { + _existingTowRopes = _vehicle getVariable ["SA_Tow_Ropes",[]]; + vehicle player == player && player distance _vehicle < 10 && (count _existingTowRopes) > 0; + } else { + false; + }; +}; + +SA_Drop_Tow_Ropes_Action_Check = { + !isNull (player getVariable ["SA_Tow_Ropes_Vehicle", objNull]) && vehicle player == player; +}; + +SA_Pickup_Tow_Ropes_Action_Check = { + isNull (player getVariable ["SA_Tow_Ropes_Vehicle", objNull]) && count (missionNamespace getVariable ["SA_Nearby_Tow_Vehicles",[]]) > 0 && vehicle player == player; +}; + +SA_Pickup_Tow_Ropes_Action = { + private ["_nearbyTowVehicles"]; + _nearbyTowVehicles = missionNamespace getVariable ["SA_Nearby_Tow_Vehicles",[]]; + if(count _nearbyTowVehicles > 0) then { + [_nearbyTowVehicles select 0, player] call SA_Pickup_Tow_Ropes; + }; +}; + +SA_Drop_Tow_Ropes_Action = { + private ["_vehicle"]; + _vehicle = player getVariable ["SA_Tow_Ropes_Vehicle", objNull]; + if(!isNull _vehicle) then { + [_vehicle, player] call SA_Drop_Tow_Ropes; + }; +}; + +SA_Is_Supported_Vehicle = { + params ["_vehicle","_isSupported"]; + _isSupported = false; + if(not isNull _vehicle) then { + { + if(_vehicle isKindOf _x) then { + _isSupported = true; + }; + } forEach (missionNamespace getVariable ["SA_TOW_SUPPORTED_VEHICLES_OVERRIDE",SA_TOW_SUPPORTED_VEHICLES]); + }; + _isSupported; +}; + +SA_Is_Supported_Cargo = { + params ["_vehicle","_cargo"]; + private ["_canTow"]; + _canTow = false; + if(not isNull _vehicle && not isNull _cargo) then { + { + if(_vehicle isKindOf (_x select 0)) then { + if(_cargo isKindOf (_x select 2)) then { + if( (toUpper (_x select 1)) == "CAN_TOW" ) then { + _canTow = true; + } else { + _canTow = false; + }; + }; + }; + } forEach (missionNamespace getVariable ["SA_TOW_RULES_OVERRIDE",SA_TOW_RULES]); + }; + _canTow; +}; + +SA_Hint_Whoops = { + params ["_msg"]; + /*Team XLD(DS) - Send proper Exile Whoops notification message to player*/ + ["Whoops",[_msg]] call ExileClient_gui_notification_event_addNotification; +}; +SA_Hint_Success = { + params ["_msg"]; + /*Team XLD(DS) - Send proper Exile Success notification message to player*/ + ["Success",[_msg]] call ExileClient_gui_notification_event_addNotification; +}; + +SA_Hide_Object_Global = { + params ["_obj"]; + hideObjectGlobal _obj; +}; + +SA_Set_Owner = { + params ["_obj","_client"]; + _obj setOwner _client; +}; + +SA_Take_Tow_Ropes_Action = { + private ["_vehicle"]; + _vehicle = cursorTarget; + /*Team XLD(DS) - Prevent Towing from Locked Vehicles*/ + _isNotLocked = (locked ExileClientInteractionObject !=2); + /*Team XLD(DS) - Prevent Deploying Rope in Safezones (troll stopper)*/ + if(!ExilePlayerInSafezone) then { + if(([_vehicle] call SA_Is_Supported_Vehicle) && (_isNotLocked)) then { + [_vehicle,player] call SA_Take_Tow_Ropes; + } else { + /*Team XLD(DS) - Send proper Exile Whoops notification message to player*/ + _towingName=getText (configFile >> "CfgVehicles" >> typeOf _vehicle >> "displayName"); + _msg = format["The %1 is LOCKED!",_towingName]; + ["Whoops",[_msg]] call ExileClient_gui_notification_event_addNotification; + }; + } else { + /*Team XLD(DS) - Send proper Exile Whoops notification message to player*/ + _towingName=getText (configFile >> "CfgVehicles" >> typeOf _vehicle >> "displayName"); + _msg = format["Your %1 can't tow in a SafeZone!",_towingName]; + ["Whoops",[_msg]] call ExileClient_gui_notification_event_addNotification; + }; +}; + + +SA_Put_Away_Tow_Ropes_Action = { + private ["_vehicle"]; + _vehicle = cursorTarget; + if([_vehicle] call SA_Is_Supported_Vehicle) then { + [_vehicle,player] call SA_Put_Away_Tow_Ropes; + }; +}; + +SA_Add_Player_Tow_Actions = { + + player addAction ["Deploy Tow Ropes", { + [] call SA_Take_Tow_Ropes_Action; + }, nil, 0, false, true, "", "call SA_Take_Tow_Ropes_Action_Check"]; + + player addAction ["Put Away Tow Ropes", { + [] call SA_Put_Away_Tow_Ropes_Action; + }, nil, 0, false, true, "", "call SA_Put_Away_Tow_Ropes_Action_Check"]; + + player addAction ["Attach To Tow Ropes", { + [] call SA_Attach_Tow_Ropes_Action; + }, nil, 0, false, true, "", "call SA_Attach_Tow_Ropes_Action_Check"]; + + player addAction ["Cannot Attach Tow Ropes", { + //hint "Your vehicle is not strong enough to tow this. Find a larger vehicle!"; + /*Team XLD(DS) - Send proper Exile Notification for players*/ + ["Whoops",["Your vehicle is not strong enough to tow this. Find a larger vehicle!"]] call ExileClient_gui_notification_event_addNotification; + }, nil, 0, false, true, "", "call SA_Attach_Tow_Ropes_Action_Disabled_Check"]; + + player addAction ["Drop Tow Ropes", { + [] call SA_Drop_Tow_Ropes_Action; + }, nil, 0, false, true, "", "call SA_Drop_Tow_Ropes_Action_Check"]; + + player addAction ["Pickup Tow Ropes", { + [] call SA_Pickup_Tow_Ropes_Action; + }, nil, 0, false, true, "", "call SA_Pickup_Tow_Ropes_Action_Check"]; + + player addEventHandler ["Respawn", { + player setVariable ["SA_Tow_Actions_Loaded",false]; + }]; + +}; + +SA_Find_Nearby_Tow_Vehicles = { + private ["_nearVehicles","_nearVehiclesWithTowRopes","_vehicle","_ends","_end1","_end2"]; + _nearVehicles = []; + { + _nearVehicles append (position player nearObjects [_x, 30]); + } forEach (missionNamespace getVariable ["SA_TOW_SUPPORTED_VEHICLES_OVERRIDE",SA_TOW_SUPPORTED_VEHICLES]); + _nearVehiclesWithTowRopes = []; + { + _vehicle = _x; + { + _ends = ropeEndPosition _x; + if(count _ends == 2) then { + _end1 = _ends select 0; + _end2 = _ends select 1; + if(((position player) distance _end1) < 5 || ((position player) distance _end2) < 5 ) then { + _nearVehiclesWithTowRopes pushBack _vehicle; + } + }; + } forEach (_vehicle getVariable ["SA_Tow_Ropes",[]]); + } forEach _nearVehicles; + _nearVehiclesWithTowRopes; +}; + + +if(!isDedicated) then { + [] spawn { + while {true} do { + if(!isNull player && isPlayer player) then { + if!( player getVariable ["SA_Tow_Actions_Loaded",false] ) then { + [] call SA_Add_Player_Tow_Actions; + player setVariable ["SA_Tow_Actions_Loaded",true]; + //player setVariable ["XLD_TOWED_ARRAY",false]; + player setVariable ["XLD_TOWED_COUNTER",0]; + }; + }; + missionNamespace setVariable ["SA_Nearby_Tow_Vehicles", (call SA_Find_Nearby_Tow_Vehicles)]; + sleep 2; + }; + }; +}; + +diag_log "Advanced Towing Loaded"; diff --git a/MPMissions/Exile.Altis/init.sqf b/MPMissions/Exile.Altis/init.sqf new file mode 100644 index 0000000..2591723 --- /dev/null +++ b/MPMissions/Exile.Altis/init.sqf @@ -0,0 +1,17 @@ +/** + * fn_advancedTowingInit.sqf + * + * eXileLoneDevs presents SethDuda's Advanced Towing for Exile + * Originally by SethDuda, modified by Team XLD + * www.DonkeyPunch.INFO -or- www.ExileMod.Com + * © 2016 DirtySanchez / ka0s<3 + * +The MIT License (MIT) +Copyright (c) 2016 Seth Duda +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. +*/ + +if (!hasInterface && !isDedicated) exitWith {}; +[] execVM "Custom\advSlingTow\fn_advancedTowingInit.sqf"; \ No newline at end of file diff --git a/addons/SA_AdvancedTowing.pbo.AdvancedTowing.bisign b/addons/SA_AdvancedTowing.pbo.AdvancedTowing.bisign deleted file mode 100644 index d4a1816f81842d52d4daa179904459c5f383a24e..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 567 zcmV-70?7SAWOiY0V`XGiZ+B^KX8@D{000I80000a002@`K`{UX000310RUNt&OfzOi$AIZo+^6)A(Pzg!y+Bg#_I$7b74?mq~X zHBtcYPsdIhLs;8sc8se(7%~cKu08&m?z?s12bdj}L11i5Bux?KngM>BdTKf+Phdf> zmN(lVn*g)M+ET$dL9$m>oxgwp006@8z!vNy;EpwZU?c!Lti4{7vy7F384 zug-p-4A}90-COfzOi$AIZo+^6)A(Pzg!y+Bg#_I$7b74?mq~X zHBtcYPsdIhLs;8sc8se(7%~cKu08&m?z?s12bdj}L11i5Bux?KngM>BdTKf+Phdf> VmN(lVn*g)M+ET$dL9$m>oxha(M27$X From 69a553a03d45ea76931d8a5a2224230138ae2389 Mon Sep 17 00:00:00 2001 From: DonkeyPunchINFO Date: Thu, 24 Mar 2016 15:09:59 -0500 Subject: [PATCH 2/4] Initial Public Release --- .../addons/xld_advanced_sling_tow.pbo | Bin 29937 -> 29882 bytes .../functions/fn_advancedTowingInit.sqf | 5 ++--- .../advSlingTow/fn_advancedTowingInit.sqf | 5 ++--- 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/@exileserver/addons/xld_advanced_sling_tow.pbo b/@exileserver/addons/xld_advanced_sling_tow.pbo index f080810e4122b27271a0248c714428f7e3d4ae6a..386fd819f70ac1a9d48636e52ebcafa4ffab4d04 100644 GIT binary patch delta 72 zcmezPl5y8d#t9erB#RippyL1MFv+5c4@EY9nq@n=-h_SgWIGen$wB#|lk-fZC+n50 b7nygnx=Yr>;8jz_5#=}5E1%VGnEea@MwcJ) delta 90 zcmdn>lJVn9#t9er0*V;G;PuPTVF5)GABt@JG|QGrNojMRouw(0zW(Hcu4*i4i8;lS t_ZDk%Is1qDg}4SO=@?9YU%XvplJ@e=brMSw4oR~4t~GuayQh7TD*$0GBohDt diff --git a/@exileserver/addons/xld_advanced_sling_tow/functions/fn_advancedTowingInit.sqf b/@exileserver/addons/xld_advanced_sling_tow/functions/fn_advancedTowingInit.sqf index 9bd3cf5..71e7302 100644 --- a/@exileserver/addons/xld_advanced_sling_tow/functions/fn_advancedTowingInit.sqf +++ b/@exileserver/addons/xld_advanced_sling_tow/functions/fn_advancedTowingInit.sqf @@ -305,7 +305,7 @@ SA_Attach_Tow_Ropes = { SA_Take_Tow_Ropes = { params ["_vehicle","_player"]; _hasItems = ("Exile_Item_Rope" in (magazines _player)); - _vehTowedArray = _player getVariable ["XLD_TOWED_ARRAY",""]; + _vehTowedArray = _player getVariable ["XLD_TOWED_ARRAY",[]]; if (_hasItems) then { if(local _vehicle) then { diag_log format ["Take Tow Ropes Called %1", _this]; @@ -671,8 +671,7 @@ if(!isDedicated) then { if!( player getVariable ["SA_Tow_Actions_Loaded",false] ) then { [] call SA_Add_Player_Tow_Actions; player setVariable ["SA_Tow_Actions_Loaded",true]; - //player setVariable ["XLD_TOWED_ARRAY",false]; - player setVariable ["XLD_TOWED_COUNTER",0]; + player setVariable ["XLD_TOWED_ARRAY",[]]; }; }; missionNamespace setVariable ["SA_Nearby_Tow_Vehicles", (call SA_Find_Nearby_Tow_Vehicles)]; diff --git a/MPMissions/Exile.Altis/Custom/advSlingTow/fn_advancedTowingInit.sqf b/MPMissions/Exile.Altis/Custom/advSlingTow/fn_advancedTowingInit.sqf index 9bd3cf5..71e7302 100644 --- a/MPMissions/Exile.Altis/Custom/advSlingTow/fn_advancedTowingInit.sqf +++ b/MPMissions/Exile.Altis/Custom/advSlingTow/fn_advancedTowingInit.sqf @@ -305,7 +305,7 @@ SA_Attach_Tow_Ropes = { SA_Take_Tow_Ropes = { params ["_vehicle","_player"]; _hasItems = ("Exile_Item_Rope" in (magazines _player)); - _vehTowedArray = _player getVariable ["XLD_TOWED_ARRAY",""]; + _vehTowedArray = _player getVariable ["XLD_TOWED_ARRAY",[]]; if (_hasItems) then { if(local _vehicle) then { diag_log format ["Take Tow Ropes Called %1", _this]; @@ -671,8 +671,7 @@ if(!isDedicated) then { if!( player getVariable ["SA_Tow_Actions_Loaded",false] ) then { [] call SA_Add_Player_Tow_Actions; player setVariable ["SA_Tow_Actions_Loaded",true]; - //player setVariable ["XLD_TOWED_ARRAY",false]; - player setVariable ["XLD_TOWED_COUNTER",0]; + player setVariable ["XLD_TOWED_ARRAY",[]]; }; }; missionNamespace setVariable ["SA_Nearby_Tow_Vehicles", (call SA_Find_Nearby_Tow_Vehicles)]; From 891ec9c719e80d89b1563e02e00992354b865399 Mon Sep 17 00:00:00 2001 From: DonkeyPunchINFO Date: Thu, 7 Apr 2016 23:40:10 -0500 Subject: [PATCH 3/4] v0.9Merged Newest version from sethduda with the initial xld touches added back in. Rope still required and all the lovely notifications are back. No locked towing, no safezone towing. Will bring back chaining and max limits after the coming few weeks. --- ...ed_sling_tow.pbo => SA_AdvancedTowing.pbo} | Bin 29882 -> 33791 bytes .../addons/xld_advanced_sling_tow/$PBOPREFIX$ | 1 - .../addons/xld_advanced_sling_tow/$PREFIX$ | 1 - .../xld_advanced_sling_tow/PboPrefix.txt | 1 - .../addons/xld_advanced_sling_tow/config.cpp | 18 - .../functions/fn_advancedTowingInit.sqf | 683 ------------------ .../CfgRemoteExec.hpp -or- Description.ext | 3 +- .../advSlingTow/fn_advancedTowingInit.sqf | 683 ------------------ MPMissions/Exile.Altis/init.sqf | 17 - 9 files changed, 1 insertion(+), 1406 deletions(-) rename @exileserver/addons/{xld_advanced_sling_tow.pbo => SA_AdvancedTowing.pbo} (54%) delete mode 100644 @exileserver/addons/xld_advanced_sling_tow/$PBOPREFIX$ delete mode 100644 @exileserver/addons/xld_advanced_sling_tow/$PREFIX$ delete mode 100644 @exileserver/addons/xld_advanced_sling_tow/PboPrefix.txt delete mode 100644 @exileserver/addons/xld_advanced_sling_tow/config.cpp delete mode 100644 @exileserver/addons/xld_advanced_sling_tow/functions/fn_advancedTowingInit.sqf rename MPMissions/{Exile.Altis => }/CfgRemoteExec.hpp -or- Description.ext (83%) delete mode 100644 MPMissions/Exile.Altis/Custom/advSlingTow/fn_advancedTowingInit.sqf delete mode 100644 MPMissions/Exile.Altis/init.sqf diff --git a/@exileserver/addons/xld_advanced_sling_tow.pbo b/@exileserver/addons/SA_AdvancedTowing.pbo similarity index 54% rename from @exileserver/addons/xld_advanced_sling_tow.pbo rename to @exileserver/addons/SA_AdvancedTowing.pbo index 386fd819f70ac1a9d48636e52ebcafa4ffab4d04..a182ee5f41d040476fa0551b6bdd86a2e081d3bb 100644 GIT binary patch literal 33791 zcmeHQTW=#rcBZ{S5E(F#_W(hefp;k{XLK1~*1H}f9EzG@Rw4zGqp??38ZELZaZRzg z-Q-+6J3)Z_i9F>oFL?-p?&s90 zs_sgfM8}ofzj+dkCoe1gM$i~N4`;(@G>BhJX6Kd4FrJMk=l9PhGwyQsuJru*fB)Yx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w5n@lWvBj8%J*<_Qp!G*!R|-b`$C^LrpfD^l^=#nk71K#& zoie5YgVP)dn!}++?7FI8_Rw@CjYYu0N-@^qF0jruA1-MkXmKu;u5<}TFYJfNbo&lk zO%VBXo`rAEboZ18G{*)79*4iYq0Q;L)HJo?d8#FDFgOFijLe!OIKEbH0>LIkW58d_Yuq_<|^x$ zH;7gA1&YEtpIJB^l1gw=($3>N(uJ0-%-meu0CzgW*zM(~O4KhsRHBKajoi3FHap%i z1h+0a1e%>I+=1APL7_A$&}lOdHdL_m30a$o&A6?|;RBRQ#VaGm2Y!6< z)PYiZo2aww)lrsd*h9%7*tO72lSd=(X33QIN*cS;gZkjXI`m(~%#Js6_KFu8Vm5d$wi_-l)S{S^@R8%~ zFdV9bx1;^JzbywWIk)^*3o%C&1j2PJRcS#LQW{&%*GmX zn7H4eM;jWt9ij1KKVc(hn) z)MNM-+6V^>3y0yZy7Tt@!(8FQfz{imhQnBIyLVuLoEB2XP0!V($1B#}8{TBQN~e|L zkc54Nz&eR}yk>@-zGdiNI8g#s!f+52x)CD{xf!*-I_nW+S_<6kI)mQ#vyOz0i`Uu2 z>T)G;o+We|Qwy^Y&PVi+hMfw#c~>$^37pc{phi33KH`^Tys{=qyxzir$qb_|<1A*2oTBdLl&h83~`O>@~2;1_*G@A(v)aaDn%;28scySc3r!TH+={8V;#qMse1O+ Z>mTnJ?|=KrweKJN-O$~8*%v;4?_V_{8o~eo diff --git a/@exileserver/addons/xld_advanced_sling_tow/$PBOPREFIX$ b/@exileserver/addons/xld_advanced_sling_tow/$PBOPREFIX$ deleted file mode 100644 index 545d7f5..0000000 --- a/@exileserver/addons/xld_advanced_sling_tow/$PBOPREFIX$ +++ /dev/null @@ -1 +0,0 @@ -x\addons\xld_advanced_sling_tow \ No newline at end of file diff --git a/@exileserver/addons/xld_advanced_sling_tow/$PREFIX$ b/@exileserver/addons/xld_advanced_sling_tow/$PREFIX$ deleted file mode 100644 index 545d7f5..0000000 --- a/@exileserver/addons/xld_advanced_sling_tow/$PREFIX$ +++ /dev/null @@ -1 +0,0 @@ -x\addons\xld_advanced_sling_tow \ No newline at end of file diff --git a/@exileserver/addons/xld_advanced_sling_tow/PboPrefix.txt b/@exileserver/addons/xld_advanced_sling_tow/PboPrefix.txt deleted file mode 100644 index 545d7f5..0000000 --- a/@exileserver/addons/xld_advanced_sling_tow/PboPrefix.txt +++ /dev/null @@ -1 +0,0 @@ -x\addons\xld_advanced_sling_tow \ No newline at end of file diff --git a/@exileserver/addons/xld_advanced_sling_tow/config.cpp b/@exileserver/addons/xld_advanced_sling_tow/config.cpp deleted file mode 100644 index e1b4d52..0000000 --- a/@exileserver/addons/xld_advanced_sling_tow/config.cpp +++ /dev/null @@ -1,18 +0,0 @@ -class CfgPatches { - class xld_advanced_sling_tow { - units[] = {}; - weapons[] = {}; - requiredVersion = 0.1; - requiredAddons[] = {"A3_Modules_F","exile_server_config"}; - }; -}; -class CfgFunctions { - class XLDAdvSlingTow { - class main { - file = "\x\addons\xld_advanced_sling_tow\functions"; - class advancedTowingInit { - preInit = 1; - }; - }; - }; -}; \ No newline at end of file diff --git a/@exileserver/addons/xld_advanced_sling_tow/functions/fn_advancedTowingInit.sqf b/@exileserver/addons/xld_advanced_sling_tow/functions/fn_advancedTowingInit.sqf deleted file mode 100644 index 71e7302..0000000 --- a/@exileserver/addons/xld_advanced_sling_tow/functions/fn_advancedTowingInit.sqf +++ /dev/null @@ -1,683 +0,0 @@ -/** - * fn_advancedTowingInit.sqf - * - * eXileLoneDevs presents SethDuda's Advanced Towing for Exile - * Originally by SethDuda, modified by Team XLD - * www.DonkeyPunch.INFO -or- www.ExileMod.Com - * © 2016 DirtySanchez / ka0s<3 - * -The MIT License (MIT) - -Copyright (c) 2016 Seth Duda - -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. -*/ - -//Set chaining enabled -SA_TOW_CHAINS_ENABLED = true; -// Set your maximum allowed towed vehicles(only works if Chains enabled = true;) -XLD_MAX_TOWED_VEHICLES = 3; -// Set in-safezone check notifications true=ON (alerts player on failed attempt while in safezone) false=OFF (no options in safezone for towing) -XLD_SAFEZONE_NOTIFICATION = true; -// Set in-safezone check notifications true=ON (alerts player on failed attempt while vehicle is Locked) false=OFF (no options while vehicle is Locked for towing) -XLD_LOCKED_NOTIFICATION = true; -// Set vehicle types supported -SA_TOW_SUPPORTED_VEHICLES = ["Tank", "Car", "Ship"]; -//Set vehicle rules for towing -SA_TOW_RULES = [ - ["Tank","CAN_TOW","Tank"], - ["Tank","CAN_TOW","Car"], - ["Tank","CAN_TOW","Ship"], - ["Tank","CAN_TOW","Air"], - ["Tank","CAN_TOW","Cargo_base_F"], - ["Car","CAN_TOW","Car"], - ["Car","CAN_TOW","Ship"], - ["Car","CAN_TOW","Air"], - ["Car","CANT_TOW","Helicopter"], - ["Truck_F","CAN_TOW","Helicopter"], - ["Truck_F","CAN_TOW","Cargo_base_F"], - ["Ship","CAN_TOW","Ship"] -]; - -/////////////////////////////////////////////////////////////////////// -#define SA_Find_Surface_ASL_Under_Position(_object,_positionAGL,_returnSurfaceASL,_canFloat) \ -_objectASL = AGLToASL (_object modelToWorldVisual (getCenterOfMass _object)); \ -_surfaceIntersectStartASL = [_positionAGL select 0, _positionAGL select 1, (_objectASL select 2) + 1]; \ -_surfaceIntersectEndASL = [_positionAGL select 0, _positionAGL select 1, (_objectASL select 2) - 10]; \ -_surfaces = lineIntersectsSurfaces [_surfaceIntersectStartASL, _surfaceIntersectEndASL, _object, objNull, true, 2]; \ -_returnSurfaceASL = [_positionAGL select 0, _positionAGL select 1, 0]; \ -if(count _surfaces > 0) then { \ - if!(((_surfaces select 0) select 2) isKindOf "RopeSegment") then { \ - _returnSurfaceASL = (_surfaces select 0) select 0; \ - } else { \ - if(count _surfaces > 1) then { \ - if!(((_surfaces select 1) select 2) isKindOf "RopeSegment") then { \ - _returnSurfaceASL = (_surfaces select 1) select 0; \ - }; \ - }; \ - }; \ - if(_canFloat && (_returnSurfaceASL select 2) < 0) then { \ - _returnSurfaceASL set [2,0]; \ - }; \ -}; - -#define SA_Find_Surface_ASL_Under_Model(_object,_modelOffset,_returnSurfaceASL,_canFloat) \ -SA_Find_Surface_ASL_Under_Position(_object, (_object modelToWorldVisual _modelOffset), _returnSurfaceASL,_canFloat); - -#define SA_Find_Surface_AGL_Under_Model(_object,_modelOffset,_returnSurfaceAGL,_canFloat) \ -SA_Find_Surface_ASL_Under_Model(_object,_modelOffset,_returnSurfaceAGL,_canFloat); \ -_returnSurfaceAGL = ASLtoAGL _returnSurfaceAGL; - -diag_log "Advanced Towing Loading..."; - -SA_TOW_INIT = true; - -SA_Simulate_Towing = { - - params ["_vehicle","_vehicleHitchModelPos","_cargo","_cargoHitchModelPos","_ropeLength"]; - - _cargo setVariable ["SA_TOWING_VEHICLE",_vehicle,true]; - _vehicle setVariable ["SA_TOWING_CARGO",_cargo,true]; - - private ["_lastCargoHitchPosition","_lastCargoVectorDir","_cargoLength","_maxDistanceToCargo","_lastMovedCargoPosition","_cargoHitchPoints"]; - private ["_vehicleHitchPosition","_cargoHitchPosition","_newCargoHitchPosition","_cargoVector","_movedCargoVector","_attachedObjects"]; - private ["_newCargoDir","_lastCargoVectorDir","_newCargoPosition","_doExit","_cargoPosition","_vehiclePosition","_maxVehicleSpeed","_vehicleMass","_cargoMass","_cargoCanFloat"]; - private ["_cargoCorner1AGL","_cargoCorner1ASL","_cargoCorner2AGL","_cargoCorner2ASL","_cargoCorner3AGL","_cargoCorner3ASL","_cargoCorner4AGL","_cargoCorner4ASL","_surfaceNormal1","_surfaceNormal2","_surfaceNormal"]; - - _maxVehicleSpeed = getNumber (configFile >> "CfgVehicles" >> typeOf _vehicle >> "maxSpeed"); - _cargoCanFloat = if( getNumber (configFile >> "CfgVehicles" >> typeOf _cargo >> "canFloat") == 1 ) then { true } else { false }; - - private ["_cargoCenterOfMassAGL","_cargoModelCenterGroundPosition"]; - SA_Find_Surface_AGL_Under_Model(_cargo,getCenterOfMass _cargo,_cargoCenterOfMassAGL,_cargoCanFloat); - _cargoModelCenterGroundPosition = _cargo worldToModelVisual _cargoCenterOfMassAGL; - _cargoModelCenterGroundPosition set [0,0]; - _cargoModelCenterGroundPosition set [1,0]; - - // Calculate cargo model corner points - private ["_cargoCornerPoints"]; - _cargoCornerPoints = [_vehicle] call SA_Get_Corner_Points; - _corner1 = _cargoCornerPoints select 0; - _corner2 = _cargoCornerPoints select 1; - _corner3 = _cargoCornerPoints select 2; - _corner4 = _cargoCornerPoints select 3; - - - // Try to set cargo owner if the towing client doesn't own the cargo - if(local _vehicle && !local _cargo) then { - [_cargo, clientOwner] remoteExec ["SA_Set_Owner", 2]; - }; - - _vehicleHitchModelPos set [2,0]; - _cargoHitchModelPos set [2,0]; - - _lastCargoHitchPosition = _cargo modelToWorld _cargoHitchModelPos; - _lastCargoVectorDir = vectorDir _cargo; - _lastMovedCargoPosition = getPos _cargo; - - _cargoHitchPoints = [_cargo] call SA_Get_Hitch_Points; - _cargoLength = (_cargoHitchPoints select 0) distance (_cargoHitchPoints select 1); - - _vehicleMass = 1 max (getMass _vehicle); - _cargoMass = getMass _cargo; - if(_cargoMass == 0) then { - _cargoMass = _vehicleMass; - }; - - _maxDistanceToCargo = _ropeLength; - - _doExit = false; - - while {!_doExit} do { - - _vehicleHitchPosition = _vehicle modelToWorld _vehicleHitchModelPos; - _vehicleHitchPosition set [2,0]; - _cargoHitchPosition = _lastCargoHitchPosition; - _cargoHitchPosition set [2,0]; - - _cargoPosition = getPos _cargo; - _vehiclePosition = getPos _vehicle; - - if(_vehicleHitchPosition distance _cargoHitchPosition > _maxDistanceToCargo) then { - - // Calculated simulated towing position + direction - _newCargoHitchPosition = _vehicleHitchPosition vectorAdd ((_vehicleHitchPosition vectorFromTo _cargoHitchPosition) vectorMultiply _ropeLength); - _cargoVector = _lastCargoVectorDir vectorMultiply _cargoLength; - _movedCargoVector = _newCargoHitchPosition vectorDiff _lastCargoHitchPosition; - _newCargoDir = vectorNormalized (_cargoVector vectorAdd _movedCargoVector); - //if(_isRearCargoHitch) then { - // _newCargoDir = _newCargoDir vectorMultiply -1; - //}; - _lastCargoVectorDir = _newCargoDir; - _newCargoPosition = _newCargoHitchPosition vectorAdd (_newCargoDir vectorMultiply -(vectorMagnitude (_cargoHitchModelPos))); - - SA_Find_Surface_ASL_Under_Position(_cargo,_newCargoPosition,_newCargoPosition,_cargoCanFloat); - - // Calculate surface normal (up) (more realistic than surfaceNormal function) - SA_Find_Surface_ASL_Under_Model(_cargo,_corner1,_cargoCorner1ASL,_cargoCanFloat); - SA_Find_Surface_ASL_Under_Model(_cargo,_corner2,_cargoCorner2ASL,_cargoCanFloat); - SA_Find_Surface_ASL_Under_Model(_cargo,_corner3,_cargoCorner3ASL,_cargoCanFloat); - SA_Find_Surface_ASL_Under_Model(_cargo,_corner4,_cargoCorner4ASL,_cargoCanFloat); - _surfaceNormal1 = (_cargoCorner1ASL vectorFromTo _cargoCorner3ASL) vectorCrossProduct (_cargoCorner1ASL vectorFromTo _cargoCorner2ASL); - _surfaceNormal2 = (_cargoCorner4ASL vectorFromTo _cargoCorner2ASL) vectorCrossProduct (_cargoCorner4ASL vectorFromTo _cargoCorner3ASL); - _surfaceNormal = _surfaceNormal1 vectorAdd _surfaceNormal2; - - _newCargoPosition = _newCargoPosition vectorAdd ( _cargoModelCenterGroundPosition vectorMultiply -1 ); - - _cargo setVectorDir _newCargoDir; - _cargo setVectorUp _surfaceNormal; - _cargo setPosWorld _newCargoPosition; - - _lastCargoHitchPosition = _newCargoHitchPosition; - _maxDistanceToCargo = _vehicleHitchPosition distance _newCargoHitchPosition; - _lastMovedCargoPosition = _cargoPosition; - - _massAdjustedMaxSpeed = (0.1 * _maxVehicleSpeed) max ((0.75 * _maxVehicleSpeed) * ( 1 min (_vehicleMass / _cargoMass) )); - if(speed _vehicle > (_massAdjustedMaxSpeed)+0.1 && _massAdjustedMaxSpeed > 0) then { - _vehicle setVelocity ((vectorNormalized (velocity _vehicle)) vectorMultiply (_massAdjustedMaxSpeed/3.6)); - }; - - } else { - - if(_lastMovedCargoPosition distance _cargoPosition > 2) then { - _lastCargoHitchPosition = _cargo modelToWorld _cargoHitchModelPos; - _lastCargoVectorDir = vectorDir _cargo; - }; - - }; - - if(!local _vehicle) then { - _this remoteExec ["SA_Simulate_Towing", _vehicle]; - _doExit = true; - }; - - if( count (ropeAttachedObjects _vehicle) == 0 ) then { - _doExit = true; - } else { - _attachedObjects = ropeAttachedObjects _vehicle; - if( (attachedTo (_attachedObjects select 0)) != _cargo ) then { - _doExit = true; - }; - }; - - sleep 0.01; - - }; - - _cargo setVariable ["SA_TOWING_VEHICLE",nil,true]; - _vehicle setVariable ["SA_TOWING_CARGO",nil,true]; - -}; - -SA_Get_Corner_Points = { - params ["_vehicle"]; - private ["_centerOfMass","_bbr","_p1","_p2","_rearCorner","_rearCorner2","_frontCorner","_frontCorner2"]; - private ["_maxWidth","_widthOffset","_maxLength","_lengthOffset"]; - _centerOfMass = getCenterOfMass _vehicle; - _bbr = boundingBoxReal _vehicle; - _p1 = _bbr select 0; - _p2 = _bbr select 1; - _maxWidth = abs ((_p2 select 0) - (_p1 select 0)); - _widthOffset = ((_maxWidth / 2) - abs ( _centerOfMass select 0 )) * 0.75; - _maxLength = abs ((_p2 select 1) - (_p1 select 1)); - _lengthOffset = ((_maxLength / 2) - abs (_centerOfMass select 1 )) * 0.75; - _rearCorner = [(_centerOfMass select 0) + _widthOffset, (_centerOfMass select 1) - _lengthOffset, _centerOfMass select 2]; - _rearCorner2 = [(_centerOfMass select 0) - _widthOffset, (_centerOfMass select 1) - _lengthOffset, _centerOfMass select 2]; - _frontCorner = [(_centerOfMass select 0) + _widthOffset, (_centerOfMass select 1) + _lengthOffset, _centerOfMass select 2]; - _frontCorner2 = [(_centerOfMass select 0) - _widthOffset, (_centerOfMass select 1) + _lengthOffset, _centerOfMass select 2]; - [_rearCorner,_rearCorner2,_frontCorner,_frontCorner2]; -}; - -SA_Get_Hitch_Points = { - params ["_vehicle"]; - private ["_cornerPoints","_rearCorner","_rearCorner2","_frontCorner","_frontCorner2","_rearHitchPoint"]; - private ["_frontHitchPoint","_sideLeftPoint","_sideRightPoint"]; - _cornerPoints = [_vehicle] call SA_Get_Corner_Points; - _rearCorner = _cornerPoints select 0; - _rearCorner2 = _cornerPoints select 1; - _frontCorner = _cornerPoints select 2; - _frontCorner2 = _cornerPoints select 3; - _rearHitchPoint = ((_rearCorner vectorDiff _rearCorner2) vectorMultiply 0.5) vectorAdd _rearCorner2; - _frontHitchPoint = ((_frontCorner vectorDiff _frontCorner2) vectorMultiply 0.5) vectorAdd _frontCorner2; - //_sideLeftPoint = ((_frontCorner vectorDiff _rearCorner) vectorMultiply 0.5) vectorAdd _frontCorner; - //_sideRightPoint = ((_frontCorner2 vectorDiff _rearCorner2) vectorMultiply 0.5) vectorAdd _frontCorner2; - [_frontHitchPoint,_rearHitchPoint]; -}; - -SA_Attach_Tow_Ropes = { - params ["_cargo","_player"]; - _vehicle = _player getVariable ["SA_Tow_Ropes_Vehicle", objNull]; - if(!isNull _vehicle) then { - if(local _vehicle) then { - private ["_towRopes","_vehicleHitch","_cargoHitch","_objDistance","_ropeLength"]; - _towRopes = _vehicle getVariable ["SA_Tow_Ropes",[]]; - if(count _towRopes == 1) then { - /*Team XLD(DS) - Prevent players from doing a Loop of towed Vehicles*/ - if((count (ropeAttachedObjects _cargo)) < 1 ) then { - /*Team XLD(DS) - Get number of currently towed vehicles for Max limit settings*/ - _vehTowedArray = _player getVariable ["XLD_TOWED_ARRAY",[]]; - _vehTowedCounter = count _vehTowedArray; - if (XLD_MAX_TOWED_VEHICLES > _vehTowedCounter) then { - _cargoHitch = ([_cargo] call SA_Get_Hitch_Points) select 0; - _vehicleHitch = ([_vehicle] call SA_Get_Hitch_Points) select 1; - _ropeLength = (ropeLength (_towRopes select 0)); - _objDistance = ((_vehicle modelToWorld _vehicleHitch) distance (_cargo modelToWorld _cargoHitch)); - if( _objDistance > _ropeLength ) then { - /*Team XLD(DS) - Add proper Exile notification message to player*/ - _towingName=getText (configFile >> "CfgVehicles" >> typeOf _vehicle >> "displayName"); - format["The tow ropes are too short. Move your %1 closer.",_towingName] remoteExec ["SA_Hint_Whoops", _player]; - } else { - [_vehicle,_player] call SA_Drop_Tow_Ropes; - _helper = "Land_Can_V2_F" createVehicle position _cargo; - _helper attachTo [_cargo, _cargoHitch]; - hideObject _helper; - [_helper] remoteExec ["SA_Hide_Object_Global",2]; - [_helper, [0,0,0], [0,0,-1]] ropeAttachTo (_towRopes select 0); - [_vehicle,_vehicleHitch,_cargo,_cargoHitch,_ropeLength] spawn SA_Simulate_Towing; - /*Team XLD(DS) - Add proper Exile notification message to player*/ - _towedName=getText (configFile >> "CfgVehicles" >> typeOf _cargo >> "displayName"); - format["You have attached the ropes to the %1!",_towedName] remoteExec ["SA_Hint_Success", _player]; - _vehTowedArray = _vehTowedArray + [_towRopes]; - _player setVariable["XLD_TOWED_ARRAY",_vehTowedArray]; - }; - } else { - /*Team XLD(DS) - Add proper Exile notification message to player*/ - _towedName=getText (configFile >> "CfgVehicles" >> typeOf _cargo >> "displayName"); - _msg=format["You can't tow more than %1 vehicles with your %2",XLD_MAX_TOWED_VEHICLES,_towedName]; - ["Whoops",[_msg]] call ExileClient_gui_notification_event_addNotification; - }; - } else { - /*Team XLD(DS) - Add proper Exile notification message to player*/ - _towedName=getText (configFile >> "CfgVehicles" >> typeOf _cargo >> "displayName"); - _msg=format["The %1 is the lead vehicle of another chain",_towedName]; - ["Whoops",[_msg]] call ExileClient_gui_notification_event_addNotification; - }; - }; - } else { - _this remoteExecCall ["SA_Attach_Tow_Ropes", _vehicle]; - }; - }; -}; - -SA_Take_Tow_Ropes = { - params ["_vehicle","_player"]; - _hasItems = ("Exile_Item_Rope" in (magazines _player)); - _vehTowedArray = _player getVariable ["XLD_TOWED_ARRAY",[]]; - if (_hasItems) then { - if(local _vehicle) then { - diag_log format ["Take Tow Ropes Called %1", _this]; - private ["_existingTowRopes","_hitchPoint","_rope"]; - _existingTowRopes = _vehicle getVariable ["SA_Tow_Ropes",[]]; - if(count _existingTowRopes == 0) then { - _hitchPoint = [_vehicle] call SA_Get_Hitch_Points select 1; - _rope = ropeCreate [_vehicle, _hitchPoint, 10]; - _vehicle setVariable ["SA_Tow_Ropes",[_rope],true]; - _this call SA_Pickup_Tow_Ropes; - /*Team XLD(DS) - remove rope from player*/ - _player removeItem "Exile_Item_Rope"; - //_vehTowedArray = [_vehTowedArray] + [_existingTowRopes]; - //player setVariable ["XLD_TOWED_ARRAY",_vehTowedArray]; - }; - } else { - _this remoteExecCall ["SA_Take_Tow_Ropes", _vehicle]; - }; - } else { - /*Team XLD(DS) - Send notification of rope required to tow*/ - _towingName=getText (configFile >> "CfgVehicles" >> typeOf _vehicle >> "displayName"); - _msg = format["You dont have any rope to tow with the %1!",_towingName]; - ["Whoops",[_msg]] call ExileClient_gui_notification_event_addNotification; - }; -}; - -SA_Put_Away_Tow_Ropes = { - params ["_vehicle","_player"]; - if(local _vehicle) then { - private ["_existingTowRopes","_hitchPoint","_rope"]; - _existingTowRopes = _vehicle getVariable ["SA_Tow_Ropes",[]]; - if(count _existingTowRopes > 0) then { - _this call SA_Pickup_Tow_Ropes; - _this call SA_Drop_Tow_Ropes; - { - ropeDestroy _x; - } forEach _existingTowRopes; - _vehicle setVariable ["SA_Tow_Ropes",nil,true]; - /*Team XLD(DS) - Return rope on successful put away*/ - _player addItem "Exile_Item_Rope"; - /*Team XLD(DS) - Remove 1 count on successful put away*/ - _vehTowedArray = _player getVariable ["XLD_TOWED_ARRAY",[]]; - _vehTowedArray = _vehTowedArray - [_existingTowRopes]; - _player setVariable ["XLD_TOWED_ARRAY",_vehTowedArray]; - }; - } else { - _this remoteExecCall ["SA_Put_Away_Tow_Ropes", _vehicle]; - }; -}; - -SA_Pickup_Tow_Ropes = { - params ["_vehicle","_player"]; - _towRopes = _vehicle getVariable ["SA_Tow_Ropes",[]]; - if(local _vehicle) then { - private ["_attachedObj","_helper"]; - { - _attachedObj = _x; - { - _attachedObj ropeDetach _x; - } forEach (_vehicle getVariable ["SA_Tow_Ropes",[]]); - } forEach ropeAttachedObjects _vehicle; - _helper = "Land_Can_V2_F" createVehicle position _player; - { - [_helper, [0, 0, 0], [0,0,-1]] ropeAttachTo _x; - _helper attachTo [_player, [-0.1, 0.1, 0.15], "Pelvis"]; - } forEach (_vehicle getVariable ["SA_Tow_Ropes",[]]); - hideObject _helper; - [_helper] remoteExec ["SA_Hide_Object_Global",2]; - _player setVariable ["SA_Tow_Ropes_Vehicle", _vehicle,true]; - _player setVariable ["SA_Tow_Ropes_Pick_Up_Helper", _helper,true]; - _vehTowedArray = _player getVariable ["XLD_TOWED_ARRAY",[]]; - _vehTowedArray = _vehTowedArray - [_towRopes]; - _player setVariable ["XLD_TOWED_ARRAY",_vehTowedArray]; - } else { - _this remoteExecCall ["SA_Pickup_Tow_Ropes", _vehicle]; - }; -}; - -SA_Drop_Tow_Ropes = { - params ["_vehicle","_player"]; - if(local _vehicle) then { - private ["_helper"]; - _helper = (_player getVariable ["SA_Tow_Ropes_Pick_Up_Helper", objNull]); - if(!isNull _helper) then { - { - _helper ropeDetach _x; - } forEach (_vehicle getVariable ["SA_Tow_Ropes",[]]); - detach _helper; - deleteVehicle _helper; - }; - _player setVariable ["SA_Tow_Ropes_Vehicle", nil,true]; - _player setVariable ["SA_Tow_Ropes_Pick_Up_Helper", nil,true]; - } else { - _this remoteExecCall ["SA_Drop_Tow_Ropes", _vehicle]; - }; -}; - -SA_Attach_Tow_Ropes_Action = { - private ["_vehicle","_towVehicle"]; - _vehicle = cursorTarget; - _towVehicle = player getVariable ["SA_Tow_Ropes_Vehicle", objNull]; - /*Team XLD(DS) - Prevent Towing from Locked Vehicles*/ - _isNotLocked = (locked ExileClientInteractionObject !=2); - /*Team XLD(DS) - Prevent Deploying Rope in Safezones (troll stopper)*/ - if(!ExilePlayerInSafezone) then { - if(_isNotLocked) then { - if([_vehicle] call SA_Can_Attach_Tow_Ropes) then { - [_vehicle,player] call SA_Attach_Tow_Ropes; - } else { - false; - }; - } else { - /*Team XLD(DS) - Send proper Exile Whoops notification message to player*/ - _towedName=getText (configFile >> "CfgVehicles" >> typeOf _vehicle >> "displayName"); - _msg = format["The %1 is LOCKED!",_towedName]; - ["Whoops",[_msg]] call ExileClient_gui_notification_event_addNotification; - }; - } else { - /*Team XLD(DS) - Send proper Exile Whoops notification message to player*/ - _towedName=getText (configFile >> "CfgVehicles" >> typeOf _vehicle >> "displayName"); - _msg = format["You can't attach ropes to %1 in a SafeZone!",_towedName]; - ["Whoops",[_msg]] call ExileClient_gui_notification_event_addNotification; - }; -}; - -SA_Attach_Tow_Ropes_Action_Check = { - private ["_vehicle","_towVehicle","_isCargoBeingTowed","_isCargoTowingCargo","_isChainingEnabled","_isTowVehicleBeingTowed","_isTowVehicleTowingCargo"]; - _vehicle = cursorTarget; - [_vehicle] call SA_Can_Attach_Tow_Ropes; -}; - -SA_Can_Attach_Tow_Ropes = { - params ["_cargo"]; - private ["_towVehicle","_isCargoBeingTowed","_isCargoTowingCargo","_isChainingEnabled","_isTowVehicleBeingTowed","_isTowVehicleTowingCargo","_canBeTowed"]; - _towVehicle = player getVariable ["SA_Tow_Ropes_Vehicle", objNull]; - if(!isNull _towVehicle && !isNull _cargo) then { - _isChainingEnabled = missionNamespace getVariable ["SA_TOW_CHAINS_ENABLED",false]; - _isCargoBeingTowed = not isNull (_cargo getVariable ["SA_TOWING_VEHICLE",objNull]); - _isCargoTowingCargo = not isNull (_cargo getVariable ["SA_TOWING_CARGO",objNull]); - _isTowVehicleBeingTowed = not isNull (_towVehicle getVariable ["SA_TOWING_VEHICLE",objNull]); - _isTowVehicleTowingCargo = not isNull (_towVehicle getVariable ["SA_TOWING_CARGO",objNull]); - _canBeTowed = [_towVehicle,_cargo] call SA_Is_Supported_Cargo && vehicle player == player && player distance _cargo < 10 && _towVehicle != _cargo && !_isTowVehicleTowingCargo && !_isCargoBeingTowed && ((!_isTowVehicleBeingTowed && !_isCargoTowingCargo) || _isChainingEnabled); - if!(missionNamespace getVariable ["XLD_LOCKED_NOTIFICATION",true]) then { - _canBeTowed = _canBeTowed && locked _cargo <= 1; - }; - if!(missionNamespace getVariable ["XLD_SAFEZONE_NOTIFICATION",true]) then { - if(!isNil "ExilePlayerInSafezone") then { - _canBeTowed = _canBeTowed && !ExilePlayerInSafezone; - }; - }; - _canBeTowed; - } else { - false; - }; -}; - -SA_Attach_Tow_Ropes_Action_Disabled_Check = { - private ["_vehicle","_towVehicle"]; - _vehicle = cursorTarget; - _towVehicle = player getVariable ["SA_Tow_Ropes_Vehicle", objNull]; - if(!isNull _towVehicle && !isNull _vehicle) then { - not([_towVehicle,_vehicle] call SA_Is_Supported_Cargo) && vehicle player == player && player distance _vehicle < 10 && _towVehicle != _vehicle; - } else { - false; - }; -}; - -SA_Take_Tow_Ropes_Action_Check = { - private ["_vehicle"]; - _vehicle = cursorTarget; - if([_vehicle] call SA_Is_Supported_Vehicle) then { - _existingTowRopes = _vehicle getVariable ["SA_Tow_Ropes",[]]; - _towVehicle = player getVariable ["SA_Tow_Ropes_Vehicle", objNull]; - vehicle player == player && player distance _vehicle < 10 && (count _existingTowRopes) == 0 && isNull _towVehicle; - } else { - false; - }; -}; - -SA_Put_Away_Tow_Ropes_Action_Check = { - private ["_vehicle"]; - _vehicle = cursorTarget; - if([_vehicle] call SA_Is_Supported_Vehicle) then { - _existingTowRopes = _vehicle getVariable ["SA_Tow_Ropes",[]]; - vehicle player == player && player distance _vehicle < 10 && (count _existingTowRopes) > 0; - } else { - false; - }; -}; - -SA_Drop_Tow_Ropes_Action_Check = { - !isNull (player getVariable ["SA_Tow_Ropes_Vehicle", objNull]) && vehicle player == player; -}; - -SA_Pickup_Tow_Ropes_Action_Check = { - isNull (player getVariable ["SA_Tow_Ropes_Vehicle", objNull]) && count (missionNamespace getVariable ["SA_Nearby_Tow_Vehicles",[]]) > 0 && vehicle player == player; -}; - -SA_Pickup_Tow_Ropes_Action = { - private ["_nearbyTowVehicles"]; - _nearbyTowVehicles = missionNamespace getVariable ["SA_Nearby_Tow_Vehicles",[]]; - if(count _nearbyTowVehicles > 0) then { - [_nearbyTowVehicles select 0, player] call SA_Pickup_Tow_Ropes; - }; -}; - -SA_Drop_Tow_Ropes_Action = { - private ["_vehicle"]; - _vehicle = player getVariable ["SA_Tow_Ropes_Vehicle", objNull]; - if(!isNull _vehicle) then { - [_vehicle, player] call SA_Drop_Tow_Ropes; - }; -}; - -SA_Is_Supported_Vehicle = { - params ["_vehicle","_isSupported"]; - _isSupported = false; - if(not isNull _vehicle) then { - { - if(_vehicle isKindOf _x) then { - _isSupported = true; - }; - } forEach (missionNamespace getVariable ["SA_TOW_SUPPORTED_VEHICLES_OVERRIDE",SA_TOW_SUPPORTED_VEHICLES]); - }; - _isSupported; -}; - -SA_Is_Supported_Cargo = { - params ["_vehicle","_cargo"]; - private ["_canTow"]; - _canTow = false; - if(not isNull _vehicle && not isNull _cargo) then { - { - if(_vehicle isKindOf (_x select 0)) then { - if(_cargo isKindOf (_x select 2)) then { - if( (toUpper (_x select 1)) == "CAN_TOW" ) then { - _canTow = true; - } else { - _canTow = false; - }; - }; - }; - } forEach (missionNamespace getVariable ["SA_TOW_RULES_OVERRIDE",SA_TOW_RULES]); - }; - _canTow; -}; - -SA_Hint_Whoops = { - params ["_msg"]; - /*Team XLD(DS) - Send proper Exile Whoops notification message to player*/ - ["Whoops",[_msg]] call ExileClient_gui_notification_event_addNotification; -}; -SA_Hint_Success = { - params ["_msg"]; - /*Team XLD(DS) - Send proper Exile Success notification message to player*/ - ["Success",[_msg]] call ExileClient_gui_notification_event_addNotification; -}; - -SA_Hide_Object_Global = { - params ["_obj"]; - hideObjectGlobal _obj; -}; - -SA_Set_Owner = { - params ["_obj","_client"]; - _obj setOwner _client; -}; - -SA_Take_Tow_Ropes_Action = { - private ["_vehicle"]; - _vehicle = cursorTarget; - /*Team XLD(DS) - Prevent Towing from Locked Vehicles*/ - _isNotLocked = (locked ExileClientInteractionObject !=2); - /*Team XLD(DS) - Prevent Deploying Rope in Safezones (troll stopper)*/ - if(!ExilePlayerInSafezone) then { - if(([_vehicle] call SA_Is_Supported_Vehicle) && (_isNotLocked)) then { - [_vehicle,player] call SA_Take_Tow_Ropes; - } else { - /*Team XLD(DS) - Send proper Exile Whoops notification message to player*/ - _towingName=getText (configFile >> "CfgVehicles" >> typeOf _vehicle >> "displayName"); - _msg = format["The %1 is LOCKED!",_towingName]; - ["Whoops",[_msg]] call ExileClient_gui_notification_event_addNotification; - }; - } else { - /*Team XLD(DS) - Send proper Exile Whoops notification message to player*/ - _towingName=getText (configFile >> "CfgVehicles" >> typeOf _vehicle >> "displayName"); - _msg = format["Your %1 can't tow in a SafeZone!",_towingName]; - ["Whoops",[_msg]] call ExileClient_gui_notification_event_addNotification; - }; -}; - - -SA_Put_Away_Tow_Ropes_Action = { - private ["_vehicle"]; - _vehicle = cursorTarget; - if([_vehicle] call SA_Is_Supported_Vehicle) then { - [_vehicle,player] call SA_Put_Away_Tow_Ropes; - }; -}; - -SA_Add_Player_Tow_Actions = { - - player addAction ["Deploy Tow Ropes", { - [] call SA_Take_Tow_Ropes_Action; - }, nil, 0, false, true, "", "call SA_Take_Tow_Ropes_Action_Check"]; - - player addAction ["Put Away Tow Ropes", { - [] call SA_Put_Away_Tow_Ropes_Action; - }, nil, 0, false, true, "", "call SA_Put_Away_Tow_Ropes_Action_Check"]; - - player addAction ["Attach To Tow Ropes", { - [] call SA_Attach_Tow_Ropes_Action; - }, nil, 0, false, true, "", "call SA_Attach_Tow_Ropes_Action_Check"]; - - player addAction ["Cannot Attach Tow Ropes", { - //hint "Your vehicle is not strong enough to tow this. Find a larger vehicle!"; - /*Team XLD(DS) - Send proper Exile Notification for players*/ - ["Whoops",["Your vehicle is not strong enough to tow this. Find a larger vehicle!"]] call ExileClient_gui_notification_event_addNotification; - }, nil, 0, false, true, "", "call SA_Attach_Tow_Ropes_Action_Disabled_Check"]; - - player addAction ["Drop Tow Ropes", { - [] call SA_Drop_Tow_Ropes_Action; - }, nil, 0, false, true, "", "call SA_Drop_Tow_Ropes_Action_Check"]; - - player addAction ["Pickup Tow Ropes", { - [] call SA_Pickup_Tow_Ropes_Action; - }, nil, 0, false, true, "", "call SA_Pickup_Tow_Ropes_Action_Check"]; - - player addEventHandler ["Respawn", { - player setVariable ["SA_Tow_Actions_Loaded",false]; - }]; - -}; - -SA_Find_Nearby_Tow_Vehicles = { - private ["_nearVehicles","_nearVehiclesWithTowRopes","_vehicle","_ends","_end1","_end2"]; - _nearVehicles = []; - { - _nearVehicles append (position player nearObjects [_x, 30]); - } forEach (missionNamespace getVariable ["SA_TOW_SUPPORTED_VEHICLES_OVERRIDE",SA_TOW_SUPPORTED_VEHICLES]); - _nearVehiclesWithTowRopes = []; - { - _vehicle = _x; - { - _ends = ropeEndPosition _x; - if(count _ends == 2) then { - _end1 = _ends select 0; - _end2 = _ends select 1; - if(((position player) distance _end1) < 5 || ((position player) distance _end2) < 5 ) then { - _nearVehiclesWithTowRopes pushBack _vehicle; - } - }; - } forEach (_vehicle getVariable ["SA_Tow_Ropes",[]]); - } forEach _nearVehicles; - _nearVehiclesWithTowRopes; -}; - - -if(!isDedicated) then { - [] spawn { - while {true} do { - if(!isNull player && isPlayer player) then { - if!( player getVariable ["SA_Tow_Actions_Loaded",false] ) then { - [] call SA_Add_Player_Tow_Actions; - player setVariable ["SA_Tow_Actions_Loaded",true]; - player setVariable ["XLD_TOWED_ARRAY",[]]; - }; - }; - missionNamespace setVariable ["SA_Nearby_Tow_Vehicles", (call SA_Find_Nearby_Tow_Vehicles)]; - sleep 2; - }; - }; -}; - -diag_log "Advanced Towing Loaded"; diff --git a/MPMissions/Exile.Altis/CfgRemoteExec.hpp -or- Description.ext b/MPMissions/CfgRemoteExec.hpp -or- Description.ext similarity index 83% rename from MPMissions/Exile.Altis/CfgRemoteExec.hpp -or- Description.ext rename to MPMissions/CfgRemoteExec.hpp -or- Description.ext index 42b9363..8a171f3 100644 --- a/MPMissions/Exile.Altis/CfgRemoteExec.hpp -or- Description.ext +++ b/MPMissions/CfgRemoteExec.hpp -or- Description.ext @@ -11,8 +11,7 @@ class CfgRemoteExec class SA_Pickup_Tow_Ropes { allowedTargets=0; }; class SA_Drop_Tow_Ropes { allowedTargets=0; }; class SA_Set_Owner { allowedTargets=2; }; - class SA_Hint_Success { allowedTargets=1; }; - class SA_Hint_Whoops { allowedTargets=1; }; + class SA_Hint { allowedTargets=1; }; class SA_Hide_Object_Global { allowedTargets=2; }; }; class Commands diff --git a/MPMissions/Exile.Altis/Custom/advSlingTow/fn_advancedTowingInit.sqf b/MPMissions/Exile.Altis/Custom/advSlingTow/fn_advancedTowingInit.sqf deleted file mode 100644 index 71e7302..0000000 --- a/MPMissions/Exile.Altis/Custom/advSlingTow/fn_advancedTowingInit.sqf +++ /dev/null @@ -1,683 +0,0 @@ -/** - * fn_advancedTowingInit.sqf - * - * eXileLoneDevs presents SethDuda's Advanced Towing for Exile - * Originally by SethDuda, modified by Team XLD - * www.DonkeyPunch.INFO -or- www.ExileMod.Com - * © 2016 DirtySanchez / ka0s<3 - * -The MIT License (MIT) - -Copyright (c) 2016 Seth Duda - -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. -*/ - -//Set chaining enabled -SA_TOW_CHAINS_ENABLED = true; -// Set your maximum allowed towed vehicles(only works if Chains enabled = true;) -XLD_MAX_TOWED_VEHICLES = 3; -// Set in-safezone check notifications true=ON (alerts player on failed attempt while in safezone) false=OFF (no options in safezone for towing) -XLD_SAFEZONE_NOTIFICATION = true; -// Set in-safezone check notifications true=ON (alerts player on failed attempt while vehicle is Locked) false=OFF (no options while vehicle is Locked for towing) -XLD_LOCKED_NOTIFICATION = true; -// Set vehicle types supported -SA_TOW_SUPPORTED_VEHICLES = ["Tank", "Car", "Ship"]; -//Set vehicle rules for towing -SA_TOW_RULES = [ - ["Tank","CAN_TOW","Tank"], - ["Tank","CAN_TOW","Car"], - ["Tank","CAN_TOW","Ship"], - ["Tank","CAN_TOW","Air"], - ["Tank","CAN_TOW","Cargo_base_F"], - ["Car","CAN_TOW","Car"], - ["Car","CAN_TOW","Ship"], - ["Car","CAN_TOW","Air"], - ["Car","CANT_TOW","Helicopter"], - ["Truck_F","CAN_TOW","Helicopter"], - ["Truck_F","CAN_TOW","Cargo_base_F"], - ["Ship","CAN_TOW","Ship"] -]; - -/////////////////////////////////////////////////////////////////////// -#define SA_Find_Surface_ASL_Under_Position(_object,_positionAGL,_returnSurfaceASL,_canFloat) \ -_objectASL = AGLToASL (_object modelToWorldVisual (getCenterOfMass _object)); \ -_surfaceIntersectStartASL = [_positionAGL select 0, _positionAGL select 1, (_objectASL select 2) + 1]; \ -_surfaceIntersectEndASL = [_positionAGL select 0, _positionAGL select 1, (_objectASL select 2) - 10]; \ -_surfaces = lineIntersectsSurfaces [_surfaceIntersectStartASL, _surfaceIntersectEndASL, _object, objNull, true, 2]; \ -_returnSurfaceASL = [_positionAGL select 0, _positionAGL select 1, 0]; \ -if(count _surfaces > 0) then { \ - if!(((_surfaces select 0) select 2) isKindOf "RopeSegment") then { \ - _returnSurfaceASL = (_surfaces select 0) select 0; \ - } else { \ - if(count _surfaces > 1) then { \ - if!(((_surfaces select 1) select 2) isKindOf "RopeSegment") then { \ - _returnSurfaceASL = (_surfaces select 1) select 0; \ - }; \ - }; \ - }; \ - if(_canFloat && (_returnSurfaceASL select 2) < 0) then { \ - _returnSurfaceASL set [2,0]; \ - }; \ -}; - -#define SA_Find_Surface_ASL_Under_Model(_object,_modelOffset,_returnSurfaceASL,_canFloat) \ -SA_Find_Surface_ASL_Under_Position(_object, (_object modelToWorldVisual _modelOffset), _returnSurfaceASL,_canFloat); - -#define SA_Find_Surface_AGL_Under_Model(_object,_modelOffset,_returnSurfaceAGL,_canFloat) \ -SA_Find_Surface_ASL_Under_Model(_object,_modelOffset,_returnSurfaceAGL,_canFloat); \ -_returnSurfaceAGL = ASLtoAGL _returnSurfaceAGL; - -diag_log "Advanced Towing Loading..."; - -SA_TOW_INIT = true; - -SA_Simulate_Towing = { - - params ["_vehicle","_vehicleHitchModelPos","_cargo","_cargoHitchModelPos","_ropeLength"]; - - _cargo setVariable ["SA_TOWING_VEHICLE",_vehicle,true]; - _vehicle setVariable ["SA_TOWING_CARGO",_cargo,true]; - - private ["_lastCargoHitchPosition","_lastCargoVectorDir","_cargoLength","_maxDistanceToCargo","_lastMovedCargoPosition","_cargoHitchPoints"]; - private ["_vehicleHitchPosition","_cargoHitchPosition","_newCargoHitchPosition","_cargoVector","_movedCargoVector","_attachedObjects"]; - private ["_newCargoDir","_lastCargoVectorDir","_newCargoPosition","_doExit","_cargoPosition","_vehiclePosition","_maxVehicleSpeed","_vehicleMass","_cargoMass","_cargoCanFloat"]; - private ["_cargoCorner1AGL","_cargoCorner1ASL","_cargoCorner2AGL","_cargoCorner2ASL","_cargoCorner3AGL","_cargoCorner3ASL","_cargoCorner4AGL","_cargoCorner4ASL","_surfaceNormal1","_surfaceNormal2","_surfaceNormal"]; - - _maxVehicleSpeed = getNumber (configFile >> "CfgVehicles" >> typeOf _vehicle >> "maxSpeed"); - _cargoCanFloat = if( getNumber (configFile >> "CfgVehicles" >> typeOf _cargo >> "canFloat") == 1 ) then { true } else { false }; - - private ["_cargoCenterOfMassAGL","_cargoModelCenterGroundPosition"]; - SA_Find_Surface_AGL_Under_Model(_cargo,getCenterOfMass _cargo,_cargoCenterOfMassAGL,_cargoCanFloat); - _cargoModelCenterGroundPosition = _cargo worldToModelVisual _cargoCenterOfMassAGL; - _cargoModelCenterGroundPosition set [0,0]; - _cargoModelCenterGroundPosition set [1,0]; - - // Calculate cargo model corner points - private ["_cargoCornerPoints"]; - _cargoCornerPoints = [_vehicle] call SA_Get_Corner_Points; - _corner1 = _cargoCornerPoints select 0; - _corner2 = _cargoCornerPoints select 1; - _corner3 = _cargoCornerPoints select 2; - _corner4 = _cargoCornerPoints select 3; - - - // Try to set cargo owner if the towing client doesn't own the cargo - if(local _vehicle && !local _cargo) then { - [_cargo, clientOwner] remoteExec ["SA_Set_Owner", 2]; - }; - - _vehicleHitchModelPos set [2,0]; - _cargoHitchModelPos set [2,0]; - - _lastCargoHitchPosition = _cargo modelToWorld _cargoHitchModelPos; - _lastCargoVectorDir = vectorDir _cargo; - _lastMovedCargoPosition = getPos _cargo; - - _cargoHitchPoints = [_cargo] call SA_Get_Hitch_Points; - _cargoLength = (_cargoHitchPoints select 0) distance (_cargoHitchPoints select 1); - - _vehicleMass = 1 max (getMass _vehicle); - _cargoMass = getMass _cargo; - if(_cargoMass == 0) then { - _cargoMass = _vehicleMass; - }; - - _maxDistanceToCargo = _ropeLength; - - _doExit = false; - - while {!_doExit} do { - - _vehicleHitchPosition = _vehicle modelToWorld _vehicleHitchModelPos; - _vehicleHitchPosition set [2,0]; - _cargoHitchPosition = _lastCargoHitchPosition; - _cargoHitchPosition set [2,0]; - - _cargoPosition = getPos _cargo; - _vehiclePosition = getPos _vehicle; - - if(_vehicleHitchPosition distance _cargoHitchPosition > _maxDistanceToCargo) then { - - // Calculated simulated towing position + direction - _newCargoHitchPosition = _vehicleHitchPosition vectorAdd ((_vehicleHitchPosition vectorFromTo _cargoHitchPosition) vectorMultiply _ropeLength); - _cargoVector = _lastCargoVectorDir vectorMultiply _cargoLength; - _movedCargoVector = _newCargoHitchPosition vectorDiff _lastCargoHitchPosition; - _newCargoDir = vectorNormalized (_cargoVector vectorAdd _movedCargoVector); - //if(_isRearCargoHitch) then { - // _newCargoDir = _newCargoDir vectorMultiply -1; - //}; - _lastCargoVectorDir = _newCargoDir; - _newCargoPosition = _newCargoHitchPosition vectorAdd (_newCargoDir vectorMultiply -(vectorMagnitude (_cargoHitchModelPos))); - - SA_Find_Surface_ASL_Under_Position(_cargo,_newCargoPosition,_newCargoPosition,_cargoCanFloat); - - // Calculate surface normal (up) (more realistic than surfaceNormal function) - SA_Find_Surface_ASL_Under_Model(_cargo,_corner1,_cargoCorner1ASL,_cargoCanFloat); - SA_Find_Surface_ASL_Under_Model(_cargo,_corner2,_cargoCorner2ASL,_cargoCanFloat); - SA_Find_Surface_ASL_Under_Model(_cargo,_corner3,_cargoCorner3ASL,_cargoCanFloat); - SA_Find_Surface_ASL_Under_Model(_cargo,_corner4,_cargoCorner4ASL,_cargoCanFloat); - _surfaceNormal1 = (_cargoCorner1ASL vectorFromTo _cargoCorner3ASL) vectorCrossProduct (_cargoCorner1ASL vectorFromTo _cargoCorner2ASL); - _surfaceNormal2 = (_cargoCorner4ASL vectorFromTo _cargoCorner2ASL) vectorCrossProduct (_cargoCorner4ASL vectorFromTo _cargoCorner3ASL); - _surfaceNormal = _surfaceNormal1 vectorAdd _surfaceNormal2; - - _newCargoPosition = _newCargoPosition vectorAdd ( _cargoModelCenterGroundPosition vectorMultiply -1 ); - - _cargo setVectorDir _newCargoDir; - _cargo setVectorUp _surfaceNormal; - _cargo setPosWorld _newCargoPosition; - - _lastCargoHitchPosition = _newCargoHitchPosition; - _maxDistanceToCargo = _vehicleHitchPosition distance _newCargoHitchPosition; - _lastMovedCargoPosition = _cargoPosition; - - _massAdjustedMaxSpeed = (0.1 * _maxVehicleSpeed) max ((0.75 * _maxVehicleSpeed) * ( 1 min (_vehicleMass / _cargoMass) )); - if(speed _vehicle > (_massAdjustedMaxSpeed)+0.1 && _massAdjustedMaxSpeed > 0) then { - _vehicle setVelocity ((vectorNormalized (velocity _vehicle)) vectorMultiply (_massAdjustedMaxSpeed/3.6)); - }; - - } else { - - if(_lastMovedCargoPosition distance _cargoPosition > 2) then { - _lastCargoHitchPosition = _cargo modelToWorld _cargoHitchModelPos; - _lastCargoVectorDir = vectorDir _cargo; - }; - - }; - - if(!local _vehicle) then { - _this remoteExec ["SA_Simulate_Towing", _vehicle]; - _doExit = true; - }; - - if( count (ropeAttachedObjects _vehicle) == 0 ) then { - _doExit = true; - } else { - _attachedObjects = ropeAttachedObjects _vehicle; - if( (attachedTo (_attachedObjects select 0)) != _cargo ) then { - _doExit = true; - }; - }; - - sleep 0.01; - - }; - - _cargo setVariable ["SA_TOWING_VEHICLE",nil,true]; - _vehicle setVariable ["SA_TOWING_CARGO",nil,true]; - -}; - -SA_Get_Corner_Points = { - params ["_vehicle"]; - private ["_centerOfMass","_bbr","_p1","_p2","_rearCorner","_rearCorner2","_frontCorner","_frontCorner2"]; - private ["_maxWidth","_widthOffset","_maxLength","_lengthOffset"]; - _centerOfMass = getCenterOfMass _vehicle; - _bbr = boundingBoxReal _vehicle; - _p1 = _bbr select 0; - _p2 = _bbr select 1; - _maxWidth = abs ((_p2 select 0) - (_p1 select 0)); - _widthOffset = ((_maxWidth / 2) - abs ( _centerOfMass select 0 )) * 0.75; - _maxLength = abs ((_p2 select 1) - (_p1 select 1)); - _lengthOffset = ((_maxLength / 2) - abs (_centerOfMass select 1 )) * 0.75; - _rearCorner = [(_centerOfMass select 0) + _widthOffset, (_centerOfMass select 1) - _lengthOffset, _centerOfMass select 2]; - _rearCorner2 = [(_centerOfMass select 0) - _widthOffset, (_centerOfMass select 1) - _lengthOffset, _centerOfMass select 2]; - _frontCorner = [(_centerOfMass select 0) + _widthOffset, (_centerOfMass select 1) + _lengthOffset, _centerOfMass select 2]; - _frontCorner2 = [(_centerOfMass select 0) - _widthOffset, (_centerOfMass select 1) + _lengthOffset, _centerOfMass select 2]; - [_rearCorner,_rearCorner2,_frontCorner,_frontCorner2]; -}; - -SA_Get_Hitch_Points = { - params ["_vehicle"]; - private ["_cornerPoints","_rearCorner","_rearCorner2","_frontCorner","_frontCorner2","_rearHitchPoint"]; - private ["_frontHitchPoint","_sideLeftPoint","_sideRightPoint"]; - _cornerPoints = [_vehicle] call SA_Get_Corner_Points; - _rearCorner = _cornerPoints select 0; - _rearCorner2 = _cornerPoints select 1; - _frontCorner = _cornerPoints select 2; - _frontCorner2 = _cornerPoints select 3; - _rearHitchPoint = ((_rearCorner vectorDiff _rearCorner2) vectorMultiply 0.5) vectorAdd _rearCorner2; - _frontHitchPoint = ((_frontCorner vectorDiff _frontCorner2) vectorMultiply 0.5) vectorAdd _frontCorner2; - //_sideLeftPoint = ((_frontCorner vectorDiff _rearCorner) vectorMultiply 0.5) vectorAdd _frontCorner; - //_sideRightPoint = ((_frontCorner2 vectorDiff _rearCorner2) vectorMultiply 0.5) vectorAdd _frontCorner2; - [_frontHitchPoint,_rearHitchPoint]; -}; - -SA_Attach_Tow_Ropes = { - params ["_cargo","_player"]; - _vehicle = _player getVariable ["SA_Tow_Ropes_Vehicle", objNull]; - if(!isNull _vehicle) then { - if(local _vehicle) then { - private ["_towRopes","_vehicleHitch","_cargoHitch","_objDistance","_ropeLength"]; - _towRopes = _vehicle getVariable ["SA_Tow_Ropes",[]]; - if(count _towRopes == 1) then { - /*Team XLD(DS) - Prevent players from doing a Loop of towed Vehicles*/ - if((count (ropeAttachedObjects _cargo)) < 1 ) then { - /*Team XLD(DS) - Get number of currently towed vehicles for Max limit settings*/ - _vehTowedArray = _player getVariable ["XLD_TOWED_ARRAY",[]]; - _vehTowedCounter = count _vehTowedArray; - if (XLD_MAX_TOWED_VEHICLES > _vehTowedCounter) then { - _cargoHitch = ([_cargo] call SA_Get_Hitch_Points) select 0; - _vehicleHitch = ([_vehicle] call SA_Get_Hitch_Points) select 1; - _ropeLength = (ropeLength (_towRopes select 0)); - _objDistance = ((_vehicle modelToWorld _vehicleHitch) distance (_cargo modelToWorld _cargoHitch)); - if( _objDistance > _ropeLength ) then { - /*Team XLD(DS) - Add proper Exile notification message to player*/ - _towingName=getText (configFile >> "CfgVehicles" >> typeOf _vehicle >> "displayName"); - format["The tow ropes are too short. Move your %1 closer.",_towingName] remoteExec ["SA_Hint_Whoops", _player]; - } else { - [_vehicle,_player] call SA_Drop_Tow_Ropes; - _helper = "Land_Can_V2_F" createVehicle position _cargo; - _helper attachTo [_cargo, _cargoHitch]; - hideObject _helper; - [_helper] remoteExec ["SA_Hide_Object_Global",2]; - [_helper, [0,0,0], [0,0,-1]] ropeAttachTo (_towRopes select 0); - [_vehicle,_vehicleHitch,_cargo,_cargoHitch,_ropeLength] spawn SA_Simulate_Towing; - /*Team XLD(DS) - Add proper Exile notification message to player*/ - _towedName=getText (configFile >> "CfgVehicles" >> typeOf _cargo >> "displayName"); - format["You have attached the ropes to the %1!",_towedName] remoteExec ["SA_Hint_Success", _player]; - _vehTowedArray = _vehTowedArray + [_towRopes]; - _player setVariable["XLD_TOWED_ARRAY",_vehTowedArray]; - }; - } else { - /*Team XLD(DS) - Add proper Exile notification message to player*/ - _towedName=getText (configFile >> "CfgVehicles" >> typeOf _cargo >> "displayName"); - _msg=format["You can't tow more than %1 vehicles with your %2",XLD_MAX_TOWED_VEHICLES,_towedName]; - ["Whoops",[_msg]] call ExileClient_gui_notification_event_addNotification; - }; - } else { - /*Team XLD(DS) - Add proper Exile notification message to player*/ - _towedName=getText (configFile >> "CfgVehicles" >> typeOf _cargo >> "displayName"); - _msg=format["The %1 is the lead vehicle of another chain",_towedName]; - ["Whoops",[_msg]] call ExileClient_gui_notification_event_addNotification; - }; - }; - } else { - _this remoteExecCall ["SA_Attach_Tow_Ropes", _vehicle]; - }; - }; -}; - -SA_Take_Tow_Ropes = { - params ["_vehicle","_player"]; - _hasItems = ("Exile_Item_Rope" in (magazines _player)); - _vehTowedArray = _player getVariable ["XLD_TOWED_ARRAY",[]]; - if (_hasItems) then { - if(local _vehicle) then { - diag_log format ["Take Tow Ropes Called %1", _this]; - private ["_existingTowRopes","_hitchPoint","_rope"]; - _existingTowRopes = _vehicle getVariable ["SA_Tow_Ropes",[]]; - if(count _existingTowRopes == 0) then { - _hitchPoint = [_vehicle] call SA_Get_Hitch_Points select 1; - _rope = ropeCreate [_vehicle, _hitchPoint, 10]; - _vehicle setVariable ["SA_Tow_Ropes",[_rope],true]; - _this call SA_Pickup_Tow_Ropes; - /*Team XLD(DS) - remove rope from player*/ - _player removeItem "Exile_Item_Rope"; - //_vehTowedArray = [_vehTowedArray] + [_existingTowRopes]; - //player setVariable ["XLD_TOWED_ARRAY",_vehTowedArray]; - }; - } else { - _this remoteExecCall ["SA_Take_Tow_Ropes", _vehicle]; - }; - } else { - /*Team XLD(DS) - Send notification of rope required to tow*/ - _towingName=getText (configFile >> "CfgVehicles" >> typeOf _vehicle >> "displayName"); - _msg = format["You dont have any rope to tow with the %1!",_towingName]; - ["Whoops",[_msg]] call ExileClient_gui_notification_event_addNotification; - }; -}; - -SA_Put_Away_Tow_Ropes = { - params ["_vehicle","_player"]; - if(local _vehicle) then { - private ["_existingTowRopes","_hitchPoint","_rope"]; - _existingTowRopes = _vehicle getVariable ["SA_Tow_Ropes",[]]; - if(count _existingTowRopes > 0) then { - _this call SA_Pickup_Tow_Ropes; - _this call SA_Drop_Tow_Ropes; - { - ropeDestroy _x; - } forEach _existingTowRopes; - _vehicle setVariable ["SA_Tow_Ropes",nil,true]; - /*Team XLD(DS) - Return rope on successful put away*/ - _player addItem "Exile_Item_Rope"; - /*Team XLD(DS) - Remove 1 count on successful put away*/ - _vehTowedArray = _player getVariable ["XLD_TOWED_ARRAY",[]]; - _vehTowedArray = _vehTowedArray - [_existingTowRopes]; - _player setVariable ["XLD_TOWED_ARRAY",_vehTowedArray]; - }; - } else { - _this remoteExecCall ["SA_Put_Away_Tow_Ropes", _vehicle]; - }; -}; - -SA_Pickup_Tow_Ropes = { - params ["_vehicle","_player"]; - _towRopes = _vehicle getVariable ["SA_Tow_Ropes",[]]; - if(local _vehicle) then { - private ["_attachedObj","_helper"]; - { - _attachedObj = _x; - { - _attachedObj ropeDetach _x; - } forEach (_vehicle getVariable ["SA_Tow_Ropes",[]]); - } forEach ropeAttachedObjects _vehicle; - _helper = "Land_Can_V2_F" createVehicle position _player; - { - [_helper, [0, 0, 0], [0,0,-1]] ropeAttachTo _x; - _helper attachTo [_player, [-0.1, 0.1, 0.15], "Pelvis"]; - } forEach (_vehicle getVariable ["SA_Tow_Ropes",[]]); - hideObject _helper; - [_helper] remoteExec ["SA_Hide_Object_Global",2]; - _player setVariable ["SA_Tow_Ropes_Vehicle", _vehicle,true]; - _player setVariable ["SA_Tow_Ropes_Pick_Up_Helper", _helper,true]; - _vehTowedArray = _player getVariable ["XLD_TOWED_ARRAY",[]]; - _vehTowedArray = _vehTowedArray - [_towRopes]; - _player setVariable ["XLD_TOWED_ARRAY",_vehTowedArray]; - } else { - _this remoteExecCall ["SA_Pickup_Tow_Ropes", _vehicle]; - }; -}; - -SA_Drop_Tow_Ropes = { - params ["_vehicle","_player"]; - if(local _vehicle) then { - private ["_helper"]; - _helper = (_player getVariable ["SA_Tow_Ropes_Pick_Up_Helper", objNull]); - if(!isNull _helper) then { - { - _helper ropeDetach _x; - } forEach (_vehicle getVariable ["SA_Tow_Ropes",[]]); - detach _helper; - deleteVehicle _helper; - }; - _player setVariable ["SA_Tow_Ropes_Vehicle", nil,true]; - _player setVariable ["SA_Tow_Ropes_Pick_Up_Helper", nil,true]; - } else { - _this remoteExecCall ["SA_Drop_Tow_Ropes", _vehicle]; - }; -}; - -SA_Attach_Tow_Ropes_Action = { - private ["_vehicle","_towVehicle"]; - _vehicle = cursorTarget; - _towVehicle = player getVariable ["SA_Tow_Ropes_Vehicle", objNull]; - /*Team XLD(DS) - Prevent Towing from Locked Vehicles*/ - _isNotLocked = (locked ExileClientInteractionObject !=2); - /*Team XLD(DS) - Prevent Deploying Rope in Safezones (troll stopper)*/ - if(!ExilePlayerInSafezone) then { - if(_isNotLocked) then { - if([_vehicle] call SA_Can_Attach_Tow_Ropes) then { - [_vehicle,player] call SA_Attach_Tow_Ropes; - } else { - false; - }; - } else { - /*Team XLD(DS) - Send proper Exile Whoops notification message to player*/ - _towedName=getText (configFile >> "CfgVehicles" >> typeOf _vehicle >> "displayName"); - _msg = format["The %1 is LOCKED!",_towedName]; - ["Whoops",[_msg]] call ExileClient_gui_notification_event_addNotification; - }; - } else { - /*Team XLD(DS) - Send proper Exile Whoops notification message to player*/ - _towedName=getText (configFile >> "CfgVehicles" >> typeOf _vehicle >> "displayName"); - _msg = format["You can't attach ropes to %1 in a SafeZone!",_towedName]; - ["Whoops",[_msg]] call ExileClient_gui_notification_event_addNotification; - }; -}; - -SA_Attach_Tow_Ropes_Action_Check = { - private ["_vehicle","_towVehicle","_isCargoBeingTowed","_isCargoTowingCargo","_isChainingEnabled","_isTowVehicleBeingTowed","_isTowVehicleTowingCargo"]; - _vehicle = cursorTarget; - [_vehicle] call SA_Can_Attach_Tow_Ropes; -}; - -SA_Can_Attach_Tow_Ropes = { - params ["_cargo"]; - private ["_towVehicle","_isCargoBeingTowed","_isCargoTowingCargo","_isChainingEnabled","_isTowVehicleBeingTowed","_isTowVehicleTowingCargo","_canBeTowed"]; - _towVehicle = player getVariable ["SA_Tow_Ropes_Vehicle", objNull]; - if(!isNull _towVehicle && !isNull _cargo) then { - _isChainingEnabled = missionNamespace getVariable ["SA_TOW_CHAINS_ENABLED",false]; - _isCargoBeingTowed = not isNull (_cargo getVariable ["SA_TOWING_VEHICLE",objNull]); - _isCargoTowingCargo = not isNull (_cargo getVariable ["SA_TOWING_CARGO",objNull]); - _isTowVehicleBeingTowed = not isNull (_towVehicle getVariable ["SA_TOWING_VEHICLE",objNull]); - _isTowVehicleTowingCargo = not isNull (_towVehicle getVariable ["SA_TOWING_CARGO",objNull]); - _canBeTowed = [_towVehicle,_cargo] call SA_Is_Supported_Cargo && vehicle player == player && player distance _cargo < 10 && _towVehicle != _cargo && !_isTowVehicleTowingCargo && !_isCargoBeingTowed && ((!_isTowVehicleBeingTowed && !_isCargoTowingCargo) || _isChainingEnabled); - if!(missionNamespace getVariable ["XLD_LOCKED_NOTIFICATION",true]) then { - _canBeTowed = _canBeTowed && locked _cargo <= 1; - }; - if!(missionNamespace getVariable ["XLD_SAFEZONE_NOTIFICATION",true]) then { - if(!isNil "ExilePlayerInSafezone") then { - _canBeTowed = _canBeTowed && !ExilePlayerInSafezone; - }; - }; - _canBeTowed; - } else { - false; - }; -}; - -SA_Attach_Tow_Ropes_Action_Disabled_Check = { - private ["_vehicle","_towVehicle"]; - _vehicle = cursorTarget; - _towVehicle = player getVariable ["SA_Tow_Ropes_Vehicle", objNull]; - if(!isNull _towVehicle && !isNull _vehicle) then { - not([_towVehicle,_vehicle] call SA_Is_Supported_Cargo) && vehicle player == player && player distance _vehicle < 10 && _towVehicle != _vehicle; - } else { - false; - }; -}; - -SA_Take_Tow_Ropes_Action_Check = { - private ["_vehicle"]; - _vehicle = cursorTarget; - if([_vehicle] call SA_Is_Supported_Vehicle) then { - _existingTowRopes = _vehicle getVariable ["SA_Tow_Ropes",[]]; - _towVehicle = player getVariable ["SA_Tow_Ropes_Vehicle", objNull]; - vehicle player == player && player distance _vehicle < 10 && (count _existingTowRopes) == 0 && isNull _towVehicle; - } else { - false; - }; -}; - -SA_Put_Away_Tow_Ropes_Action_Check = { - private ["_vehicle"]; - _vehicle = cursorTarget; - if([_vehicle] call SA_Is_Supported_Vehicle) then { - _existingTowRopes = _vehicle getVariable ["SA_Tow_Ropes",[]]; - vehicle player == player && player distance _vehicle < 10 && (count _existingTowRopes) > 0; - } else { - false; - }; -}; - -SA_Drop_Tow_Ropes_Action_Check = { - !isNull (player getVariable ["SA_Tow_Ropes_Vehicle", objNull]) && vehicle player == player; -}; - -SA_Pickup_Tow_Ropes_Action_Check = { - isNull (player getVariable ["SA_Tow_Ropes_Vehicle", objNull]) && count (missionNamespace getVariable ["SA_Nearby_Tow_Vehicles",[]]) > 0 && vehicle player == player; -}; - -SA_Pickup_Tow_Ropes_Action = { - private ["_nearbyTowVehicles"]; - _nearbyTowVehicles = missionNamespace getVariable ["SA_Nearby_Tow_Vehicles",[]]; - if(count _nearbyTowVehicles > 0) then { - [_nearbyTowVehicles select 0, player] call SA_Pickup_Tow_Ropes; - }; -}; - -SA_Drop_Tow_Ropes_Action = { - private ["_vehicle"]; - _vehicle = player getVariable ["SA_Tow_Ropes_Vehicle", objNull]; - if(!isNull _vehicle) then { - [_vehicle, player] call SA_Drop_Tow_Ropes; - }; -}; - -SA_Is_Supported_Vehicle = { - params ["_vehicle","_isSupported"]; - _isSupported = false; - if(not isNull _vehicle) then { - { - if(_vehicle isKindOf _x) then { - _isSupported = true; - }; - } forEach (missionNamespace getVariable ["SA_TOW_SUPPORTED_VEHICLES_OVERRIDE",SA_TOW_SUPPORTED_VEHICLES]); - }; - _isSupported; -}; - -SA_Is_Supported_Cargo = { - params ["_vehicle","_cargo"]; - private ["_canTow"]; - _canTow = false; - if(not isNull _vehicle && not isNull _cargo) then { - { - if(_vehicle isKindOf (_x select 0)) then { - if(_cargo isKindOf (_x select 2)) then { - if( (toUpper (_x select 1)) == "CAN_TOW" ) then { - _canTow = true; - } else { - _canTow = false; - }; - }; - }; - } forEach (missionNamespace getVariable ["SA_TOW_RULES_OVERRIDE",SA_TOW_RULES]); - }; - _canTow; -}; - -SA_Hint_Whoops = { - params ["_msg"]; - /*Team XLD(DS) - Send proper Exile Whoops notification message to player*/ - ["Whoops",[_msg]] call ExileClient_gui_notification_event_addNotification; -}; -SA_Hint_Success = { - params ["_msg"]; - /*Team XLD(DS) - Send proper Exile Success notification message to player*/ - ["Success",[_msg]] call ExileClient_gui_notification_event_addNotification; -}; - -SA_Hide_Object_Global = { - params ["_obj"]; - hideObjectGlobal _obj; -}; - -SA_Set_Owner = { - params ["_obj","_client"]; - _obj setOwner _client; -}; - -SA_Take_Tow_Ropes_Action = { - private ["_vehicle"]; - _vehicle = cursorTarget; - /*Team XLD(DS) - Prevent Towing from Locked Vehicles*/ - _isNotLocked = (locked ExileClientInteractionObject !=2); - /*Team XLD(DS) - Prevent Deploying Rope in Safezones (troll stopper)*/ - if(!ExilePlayerInSafezone) then { - if(([_vehicle] call SA_Is_Supported_Vehicle) && (_isNotLocked)) then { - [_vehicle,player] call SA_Take_Tow_Ropes; - } else { - /*Team XLD(DS) - Send proper Exile Whoops notification message to player*/ - _towingName=getText (configFile >> "CfgVehicles" >> typeOf _vehicle >> "displayName"); - _msg = format["The %1 is LOCKED!",_towingName]; - ["Whoops",[_msg]] call ExileClient_gui_notification_event_addNotification; - }; - } else { - /*Team XLD(DS) - Send proper Exile Whoops notification message to player*/ - _towingName=getText (configFile >> "CfgVehicles" >> typeOf _vehicle >> "displayName"); - _msg = format["Your %1 can't tow in a SafeZone!",_towingName]; - ["Whoops",[_msg]] call ExileClient_gui_notification_event_addNotification; - }; -}; - - -SA_Put_Away_Tow_Ropes_Action = { - private ["_vehicle"]; - _vehicle = cursorTarget; - if([_vehicle] call SA_Is_Supported_Vehicle) then { - [_vehicle,player] call SA_Put_Away_Tow_Ropes; - }; -}; - -SA_Add_Player_Tow_Actions = { - - player addAction ["Deploy Tow Ropes", { - [] call SA_Take_Tow_Ropes_Action; - }, nil, 0, false, true, "", "call SA_Take_Tow_Ropes_Action_Check"]; - - player addAction ["Put Away Tow Ropes", { - [] call SA_Put_Away_Tow_Ropes_Action; - }, nil, 0, false, true, "", "call SA_Put_Away_Tow_Ropes_Action_Check"]; - - player addAction ["Attach To Tow Ropes", { - [] call SA_Attach_Tow_Ropes_Action; - }, nil, 0, false, true, "", "call SA_Attach_Tow_Ropes_Action_Check"]; - - player addAction ["Cannot Attach Tow Ropes", { - //hint "Your vehicle is not strong enough to tow this. Find a larger vehicle!"; - /*Team XLD(DS) - Send proper Exile Notification for players*/ - ["Whoops",["Your vehicle is not strong enough to tow this. Find a larger vehicle!"]] call ExileClient_gui_notification_event_addNotification; - }, nil, 0, false, true, "", "call SA_Attach_Tow_Ropes_Action_Disabled_Check"]; - - player addAction ["Drop Tow Ropes", { - [] call SA_Drop_Tow_Ropes_Action; - }, nil, 0, false, true, "", "call SA_Drop_Tow_Ropes_Action_Check"]; - - player addAction ["Pickup Tow Ropes", { - [] call SA_Pickup_Tow_Ropes_Action; - }, nil, 0, false, true, "", "call SA_Pickup_Tow_Ropes_Action_Check"]; - - player addEventHandler ["Respawn", { - player setVariable ["SA_Tow_Actions_Loaded",false]; - }]; - -}; - -SA_Find_Nearby_Tow_Vehicles = { - private ["_nearVehicles","_nearVehiclesWithTowRopes","_vehicle","_ends","_end1","_end2"]; - _nearVehicles = []; - { - _nearVehicles append (position player nearObjects [_x, 30]); - } forEach (missionNamespace getVariable ["SA_TOW_SUPPORTED_VEHICLES_OVERRIDE",SA_TOW_SUPPORTED_VEHICLES]); - _nearVehiclesWithTowRopes = []; - { - _vehicle = _x; - { - _ends = ropeEndPosition _x; - if(count _ends == 2) then { - _end1 = _ends select 0; - _end2 = _ends select 1; - if(((position player) distance _end1) < 5 || ((position player) distance _end2) < 5 ) then { - _nearVehiclesWithTowRopes pushBack _vehicle; - } - }; - } forEach (_vehicle getVariable ["SA_Tow_Ropes",[]]); - } forEach _nearVehicles; - _nearVehiclesWithTowRopes; -}; - - -if(!isDedicated) then { - [] spawn { - while {true} do { - if(!isNull player && isPlayer player) then { - if!( player getVariable ["SA_Tow_Actions_Loaded",false] ) then { - [] call SA_Add_Player_Tow_Actions; - player setVariable ["SA_Tow_Actions_Loaded",true]; - player setVariable ["XLD_TOWED_ARRAY",[]]; - }; - }; - missionNamespace setVariable ["SA_Nearby_Tow_Vehicles", (call SA_Find_Nearby_Tow_Vehicles)]; - sleep 2; - }; - }; -}; - -diag_log "Advanced Towing Loaded"; diff --git a/MPMissions/Exile.Altis/init.sqf b/MPMissions/Exile.Altis/init.sqf deleted file mode 100644 index 2591723..0000000 --- a/MPMissions/Exile.Altis/init.sqf +++ /dev/null @@ -1,17 +0,0 @@ -/** - * fn_advancedTowingInit.sqf - * - * eXileLoneDevs presents SethDuda's Advanced Towing for Exile - * Originally by SethDuda, modified by Team XLD - * www.DonkeyPunch.INFO -or- www.ExileMod.Com - * © 2016 DirtySanchez / ka0s<3 - * -The MIT License (MIT) -Copyright (c) 2016 Seth Duda -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. -*/ - -if (!hasInterface && !isDedicated) exitWith {}; -[] execVM "Custom\advSlingTow\fn_advancedTowingInit.sqf"; \ No newline at end of file From 01f22fc5d8bfa7be0b17112dc9ca8471c374ecc4 Mon Sep 17 00:00:00 2001 From: DonkeyPunchINFO Date: Sat, 16 Apr 2016 23:02:17 -0500 Subject: [PATCH 4/4] XLD Merge 4-16 Merged newest version by SethDuda, removed the safezone check for pickup and put away tow ropes. Fixed vehicle name on several notifications. --- @exileserver/addons/SA_AdvancedTowing.pbo | Bin 33791 -> 35419 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/@exileserver/addons/SA_AdvancedTowing.pbo b/@exileserver/addons/SA_AdvancedTowing.pbo index a182ee5f41d040476fa0551b6bdd86a2e081d3bb..c0acf188b1f33b3f3172e743f6c5233daccb2bd0 100644 GIT binary patch delta 2694 zcmbVOO>7%Q6eg|;3J@R#AyN@|EK+NOA@SN3LKP~`e-$?k3Z#b+E#uwsdZNvYnO!HK zsM-rsI3jI1a^M0IQV(b^NQDa$$BF|N1eYE;a03aDkjk6gwY#?0!LBV!-r4uQ`S!he z-?w*LpU&%yU+u3bL<`lHilgB!EcmniqBtZvn`qGq^l*&rreqs(r4 z0}HxZ*(V=trK5sRA7|n3XJ60d<}U>2XTJz`;K|^qawhz9_SPdg)(Gytd){AKUU+BK zSl*~E)RvdDA~cBO(%k}hP0HbD>fuTJutuJ_8_WUCC59&s4U5*>wn3!C|0S(Acrq&n z-T-Zj+1#i`IV&2Nk`j+@`?SeSht`Bi9N3vJ;&=CAylWPaJ``v?oN@=pA7C^dP^AMj z2F~^50ac+^`l|^p^)`izT?fM?(iV$CawkV@;%3f5nGVLiKG*?9Vic=}Mh@(_OI z6YV9no&Z~lHn$4VK}_1v8Afb)b+zURBnWxK41Ow3``gTI-#fpB zxKaI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