TaskPlaneChase - AI Planes

Hey there! I am working on AI Planes and trying a lot with TaskPlaneChase, but the plane is sometimes out of control at 1st „waypoint“…. Sometimes it is working an I get a good landing as well :face_with_raised_eyebrow:

So I have 3 different „TaskPlaneChase“ in a Row with a Wait between. And after the 1st one the Plane crashes down sometimes…:face_with_raised_eyebrow:

If executing tasks, without using Task Sequences, you need to wait until the first task is complete before applying another. Otherwise the new one will just overwrite the first.

If you’re trying to chase a moving entity, you’re waits between tasks need to be dynamic as the distance between the two targets will change dynamically.

hey, no its a static entity which will created when a player is entry the plane…

local vehicle = CreateVehicle(vehicleName, x,y,z, h, true, true)
Check this out, happens randomly :
2023-01-16 11-04-02.mkv (1.6 MB)
and after script restart, sometimes it works:
2023-01-16 11-08-31.mkv (3.7 MB)

So you’re telling me the planes chasing a car that’s not moving?

Do have to admit though, I was recently playing around with Plane AI and the first clip is a common occurrence, it could be that the plane propellers aren’t at full speed at takeoff and the plane gets sad, or that the XYZ argument given at a location confuses the Planes Nav Meshing.

No :stuck_out_tongue: The plane starts at Sandy Shores airfield, I must do some waypoints so the plane can catch the center line on the runway at LSIA…This waypoints are “static vehicles/aircrafts in the air”

Maybe try TaskPlaneMission?

TaskPlaneMission(pilot, plane, 0, 0, vector3(-1753.72, -2902.6, 13.94), 0, 500, 0, 238.17, 1000.0, 250.0)

These are the parameter I gave it whilst also attempting to get a plane from Sandy to LSIA. I could get it to fly there, just hadn’t got it to land yet. You’ll still need to get the plane to take off an all that, but it seems you’ve already got that!

Thanks for that - I will check it out and come back with a feedback soon!

1 Like

I got the plane into the air (with TaskPlaneChase) but it is still flying in one direction until it crashes down :face_with_raised_eyebrow: Should I do a loop for TaskPlaneMission?

So this worked;

TaskVehicleDriveToCoordLongrange(pilot, plane, 1403.0020751953, 2995.9179, 40.5507, GetVehicleModelMaxSpeed(`velum`), 16777216, 0.0)
    Wait(5000)
    TaskPlaneMission(pilot, plane, 0, 0, -1571.5589, -556.7288, 114.4482, 4, GetVehicleModelMaxSpeed(`velum`), 1.0, 0.0, 5.0, 40.0)

with a spawn vector of;

local spawn = vector4(1599.02453, 3231.2016, 40.4115, 105.7817)

Just gotta land the sucker!

Is your plane flying to the coords you set? (-1571.5589, -556.7288, 154.4482) Or just circling over vespucci? EDIT: I added a Wait, a 2nd TaskPlaneMission and a TaskPlaneLand:

Butter :smirk:

thanks for help, I guess it works now… finally, I will perfect it tomorrow :smirk:

1 Like

Awesome! It circles for me as well, I’d say the reason it circles Vespucci is AI Nav meshing

1 Like