jcae2798 132 Posted March 29, 2015 Hi all - Does anyone know if there is a way to limit the distance one can use to fly the darter? I wanted to see if there was a way to limit the distance one can fly from controller up to 2k Meters max. For one of my missions where you are to recon areas but i want to limit this or have them use a UAV plane instead. I only want to limit the darter if possible. It's for this mission if anyone is interested: http://forums.bistudio.com/showthread.php?188758-SP-Operation-Eager-Glacier-%28BETA%29 Thanks! Share this post Link to post Share on other sites
inlesco 225 Posted March 30, 2015 Prototypal code. Been a long time since I scripted in the infamous .sqf. Feel free to test this. /* USAGE: [[uav1],[player],1000,1500] call uavConnection.sqf; PUT THIS CODE INTO AN ACTION -> CONNECT TO UAV Brought to you by: Inlesco */ _uav = _this select 0; _connectMan = _this select 1; _minDist = _this select 2; _maxDist = _this select 3; _connectMan = []; _uav = []; // if (count _connectMan == 1) then {_connectMan = _connectMan;} else {_connectMan = [];}; // if (count _connectMan == 1) then {_connectMan = _connectMan;} else {_connectMan = [];}; // if object is in the range of minDist && maxDist -> connect if (_connectMan distance _uav < _maxDist && _connectMan distance _uav > _minDist) then { _connectMan connectTerminalToUAV _uav; _conn = true; if (_conn) { hint "Connection successful."; }; } else { _connectMan connectTerminalToUAV objNull; // disconnect _coon = false; if !(_conn) then { hint "Cannot connect to the UAV."; }; }; If you needed, you can actually make a universal function for distance checks and actions depending on the type of object you're trying to count distance to. Share this post Link to post Share on other sites
jcae2798 132 Posted March 31, 2015 awesome Inlesco. I'll report back in the coming days :) Thanks for taking the time to write it up! Share this post Link to post Share on other sites
JIMMI DEE BILLY BOB 0 Posted March 30, 2022 On 3/30/2015 at 8:51 PM, inlesco said: Prototypal code. Been a long time since I scripted in the infamous .sqf. Feel free to test this. /* USAGE: [[uav1],[player],1000,1500] call uavConnection.sqf; PUT THIS CODE INTO AN ACTION -> CONNECT TO UAV Brought to you by: Inlesco */ _uav = _this select 0; _connectMan = _this select 1; _minDist = _this select 2; _maxDist = _this select 3; _connectMan = []; _uav = []; // if (count _connectMan == 1) then {_connectMan = _connectMan;} else {_connectMan = [];}; // if (count _connectMan == 1) then {_connectMan = _connectMan;} else {_connectMan = [];}; // if object is in the range of minDist && maxDist -> connect if (_connectMan distance _uav < _maxDist && _connectMan distance _uav > _minDist) then { _connectMan connectTerminalToUAV _uav; _conn = true; if (_conn) { hint "Connection successful."; }; } else { _connectMan connectTerminalToUAV objNull; // disconnect _coon = false; if !(_conn) then { hint "Cannot connect to the UAV."; }; }; If you needed, you can actually make a universal function for distance checks and actions depending on the type of object you're trying to count distance to. Hi, 2022 🙂 How do i make this work, in any way, where do I but usage? I'm very bad at these scripts, I copy paste most of the time, often there is a step by step guide :D I would like it to work on all darts. I use respawn vechicle module, I want to be able to throw the code in Expression field, and use it in a sgf file. I hope u can help me 🙂 Share this post Link to post Share on other sites