Jump to content
cpt-craig

Help Using Drones and the "LAND" Command

Recommended Posts

Hi, I've been working on a script that spawns a UAV (an AL-6) from the communications menu, sends it to the location the player selected, lands it so they can take stuff from it, waits for a couple of minutes and then sends it back to where it started so it can be deleted. See the WIP code below: 

_caller = _this select 0;
_pos = _this select 1;
_drone = [getMarkerPos "droneSpawnMkr", 0, "B_UAV_06_F", (side _caller)] call BIS_fnc_spawnVehicle;

systemChat format ["%1 called for support at %2",_caller,_pos];

//Disable player meddling with UAV
_caller disableUAVConnectability [(_drone select 0),true];
(_drone select 0) enableWeaponDisassembly false;

//Send the drone to the location the player selected and land
_wpArrive = (_drone select 2) addWaypoint [_pos, 30];
_wpArrive setWaypointSpeed "FULL";
_wpArrive setWaypointType "MOVE";
_wpArrive setWaypointStatements ["true","(vehicle this) land 'LAND'"];


waitUntil {isTouchingGround (_drone select 0)};
if (!alive (_drone select 0)) exitWith {systemChat "Your Pelican has been destroyed"};
systemChat "touchdown!";
(_drone select 0) engineOn true;
//Drone departs
_wpDepart = (_drone select 2) addWaypoint [(getMarkerPos "droneSpawnMkr"), -1];
_wpDepart setWaypointType "MOVE";
_wpDepart setWaypointSpeed "FULL";
//Delete drone
_wpDepart setWaypointStatements ["true", "deleteVehicle (vehicle this);{deleteVehicle _x} forEach thislist; deleteGroup (group this);"];
waitUntil {isNull (_drone select 0)};
systemChat "drone DELETED"; 

So this was all going really well, the drone spawns, it goes to the player and it lands... but then it refuses to do anything after that. Right now I am attempting to do this all with waypoints, but I have also tried with doMove. No matter what I do, the drone lands, turns off its engine and then stays at that location forever.

The weird thing is that I tried replacing the drone with an AH-9 and the script functioned as exactly as I expected. This lead me to try a quick test where I plopped down an AH-9, an AL-6, an AR-2 and a MQ-12. I gave them each a waypoint with: 

(vehicle this) land "LAND";

  in the activation field and then a normal unaltered move waypoint... only the AH-9 actually took off after the landing was completed, all the drones stayed exactly where they landed and disregarded the follow-up waypoint.

Is there some known issue with using drones and the "Land" command? I've browsed the forums for anything about this, and I have come up blank. The wiki also does not mention anything about drones and land behaving differently.

For now I will try replacing the drone's "crew" when it needs to leave, but any insight into this issue would be appreciated. I hope I have just missed something obvious here and that I won't need a hacky work-around to get this to work correctly.

Thank you for your help.

  • Like 1

Share this post


Link to post
Share on other sites
On 02.06.2020 at 19:30, cpt-craig said:

 

hi did you solve this problem? I tried to use your script, but it gives a lot of errors. Should it be placed in init?

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

×