Forum Jump :

Author Message

Posts: 1

Level: Member

Country: au
Location: Not within 10 meters of you
In-game name: Thomotron

#165624 Posted at 2014-06-09 15:35        
I've been getting stuck into scripting missions lately and have started my own UAV script which will allow a player to remotely "connect" to an MQ-9 parked in a hangar. When "connected" they are teleported into the UAV and given an option to "disconnect" which kicks them out of the UAV and teleports them back to the terminal they connected from.

My problem is making the UAV engage landing autopilot when the player disconnects mid-flight. I have experimented with teleporting an AI unit into the driver position but to no avail. The UAV just corkscrews into the ground. I have also tried having the driver's position pre-occupied in hopes of the pilot being forced into limbo but the script fails to execute properly.

Any suggestions or corrections will be greatly appreciated.

Connection script
player moveInDriver UAV;
UAV addMPEventHandler ["MPHit", "hitUAV.sqf"];

Disconnection script
player action ["getOut", UAV];
player setPos (getMarkerPos "uavPlayerRespawn");
"soldierWB" createUnit [getMarkerPos "landingAISpawn", group player, "landingAI = this;"];
landingAI moveInDriver UAV;
landingAI assignAsDriver UAV;
landingAI action ["Land", UAV];
if (speed UAV < 20) then {
  landingAI action ["getOut", UAV];
  deleteVehicle landingAI;