Jump to content
  • 0

AI Aircraft landing.


kheldar125

Question

Another day another question it seems. 

Over the past few days I've been troubleshooting a script iv cobbled together. The goal is to have a plane land at an airfield. Wait until a condition is met, then take off again. 

				
				_aircraft landAt 1;
					
				sleep 10; 
			
							
				waitUntil { fly == "true"};
				
				
				_wp1         = _aigroup addWaypoint [[5000.0,2.0,200],0];
				_wp1         setWaypointType "MOVE";
				_wp1        setWaypointBehaviour "CARELESS";
				_wp1 setWaypointCompletionRadius 5;
				_wp1 setWaypointSpeed  "FULL" ;
				_wp1 setWaypointCombatMode "BLUE";
				_aircraft     flyInHeight 200;

This is what I have so far, I've cut out the section where I spawn the aircraft and the AI to fly it as it works fine. 

 

After the plane lands it does jack. I'v tried to get the pilot to exit and re-enter the aircraft using ( "doGetOut _pilot;" then after a delay "_pilot    moveindriver _aircraft;" ). I've tried turning the engine off and on again. 

But it ignores anything after "_aircraft landAt 1;"

 

I've found if i kill the driver I still cant move the aircraft without getting out and back in. Just like when the landing autopilot is used. But apart from that I'm at a loss of what to try.

Any thoughts guys? 

 

Cheers

Link to comment
Share on other sites

3 answers to this question

Recommended Posts

  • 0

Little question from my side to be able to help you. What do want to do with that?

waitUntil { fly == "true"};

This looks like you are checking whether the aircraft is flying or not but I don't think that there is a variable that exists with that name. Maybe it's "_fly"? And if that's really global variable or a check, there is no point of relation so to check which object is flying or not.

If the landing procedure works like that, this line should be checked first. But maybe I am fully out of mind, that's why I am asking what this is for.

EDIT: Btw, if you want to check whether something is still flying, I would recommend a height check, just in case you wanted to do that.

Link to comment
Share on other sites

  • 0
waitUntil { fly == "true"};

waitUntil {sleep 0.5; (fly)};

 

fly = true; --------> is equal  to (fly)

fly = false; ---------->is equal to (!fly)

 

or you can use waypoints.

Quote

After the plane lands it does jack. I'v tried to get the pilot to exit and re-enter the aircraft using ( "doGetOut _pilot;" then after a delay "_pilot    moveindriver _aircraft;" ). I've tried turning the engine off and on again. 

But it ignores anything after "_aircraft landAt 1;"

_wp1 setWaypointType "GETIN NEAREST";

but is usafe use getin nearest.. cuz if thers a vehicloe player more close.. then the pilot gonna get into this vehicle.

Link to comment
Share on other sites

  • 0
13 hours ago, DAmNRelentless said:

Little question from my side to be able to help you. What do want to do with that?


waitUntil { fly == "true"};

This looks like you are checking whether the aircraft is flying or not but I don't think that there is a variable that exists with that name. Maybe it's "_fly"? And if that's really global variable or a check, there is no point of relation so to check which object is flying or not.

If the landing procedure works like that, this line should be checked first. But maybe I am fully out of mind, that's why I am asking what this is for.

EDIT: Btw, if you want to check whether something is still flying, I would recommend a height check, just in case you wanted to do that.

Its supposed to be checking for a global variable to be true, before taking off but it does nothing.

 

plane spawns, flies over and lands correctly but just sits on the runway with its engines on and doesn't move on to _wp1. 

 

 

 

 

 

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Advertisement
  • Discord

×
×
  • Create New...