Jump to content
Sign in to follow this  
Munky

How to get AI to taxi on airfield?

Recommended Posts

Was just wondering if there's any way to get an AI to takeoff, fly around, land, then taxi along airfield, stop at a pre-defined position, then move to take off again?

main reason im asking is for a cargo idea using C-130's that randomly are spawned, land, "drop off cargo" then take off again. if not i could just have them "disappear" but thats no fun lol

Share this post


Link to post
Share on other sites

Bad idea using the C130, because its turning radius is too big. It won't be able too stay on the taxyways.

Secondly, planes have the habit to take off as soon there is a pilot in the cockpit. You won't be able to tell them to stop on the ground except by telling them to disembark. Even then they won't stop where you want them to do. Controlling planes on the ground is impossible.

Share this post


Link to post
Share on other sites

As neat as it is to have a 'real system' working, it's more realistic to virtualize this kind of thing. Spawn in the C-130 when you need it in the air, have it do it's drop (hint: check out BIS_fnc_SupplyDrop) then delete the plane once it's out of view.

Share this post


Link to post
Share on other sites

Hello,

Not 100% relevant, but I will share something I came across the other day. I was messing about in the editor, placing aircraft on the runway on the island so I could get familiar with each one.

Now here is the funny thing that actually amased me, the fixed wing aircraft taxied and took off by themselves without any input from me. No waypoints, not grouped to anyone else (not even me), nothing special at all. Just literally placed on the ground in the editor on the runway.

The aircraft taxied down the taxiway parallel to the runway, then turned onto the runway at the end, and took off down it!

Why the crew did that or even had the sense to do it without any triggers, waypoints and what not I will never know, but you shouldn't have any trouble in making them takeoff that is for sure! I didn't wait around long enough to see if they landed again, but perhaps that is something you can look out for. In any case, the AI can certainly land and takeoff with ease based on my experience.

James

Share this post


Link to post
Share on other sites

I'm not sure about that specific case, but AI does seem to like "keeping themselves active", and will often move as they see fit even if you don't really see a reason for them to.

Share this post


Link to post
Share on other sites

just tried it and the AI are cack, my harrier got stuck on a tree 9 times out of 10 lol hmmm need more work on it

Share this post


Link to post
Share on other sites

Thanks all for the replies!

guess there's also the option of having the plane land, then once it reaches end of runway, have it despawn. then instead of having it taxi, "simulate" it by spawning it at end of runway.

oh yea an idea for keeping the AI's from taxi'ing/turning on engines -- remove all thier fuel via script?

and hmmm, i'll have to check out that BIS_fnc_SupplyDrop. thanks. might be a good idea to look into dropping supplies without landing too, maybe i'll do both.

edit, i cant seem to find it with a quick search -- any tips on how to use it?

Edited by Munky

Share this post


Link to post
Share on other sites

I want to have a plane land and then have the pilot and all the crew disembark, and considering that planes without pilots have no problem standing still I thought that would work (besides, the plane needs to land in an airfield you're capturing, so despawning stuff is out of the question). For some reason none of the commands I've tried made the pilot disembark. Can anyone point to the command that will make the pilot (and cargo) stop the plane and get out after landing?

I don't care all that much where they disembark, as long as they all disembark soon after the landing.

Share this post


Link to post
Share on other sites

After removing all fuel the plane actually stopped, and I could get the pilot to disembark, however he will run back into the plane afterwards. Not a big deal, but annoying.

Of course, now when trying to make the cargo disembark, they don't do it properly and stand on top of eachother, get stuck, die etc.

Edited by galzohar

Share this post


Link to post
Share on other sites

They get back in because they are still assigned to the plane

If you put

 unassignVehicle _pilot;

in the On Act field of the Get Out waypoint they'll stay out the plane.

As an alternative to setFuel

 _plane EngineOn false 

will also stop the plane. I guess I just like the idea of my pilot actually turning the engine of rather than dumping the fuel ;)

but if the plane stops that's all that matters in the long run :sigh:

hmm getting the same problem with the squad, have to look at that tomorrow.

Edited by Padjur

Share this post


Link to post
Share on other sites

I thought as long as there is an AI pilot inside he will turn the engine back on?

Anyway, I still have problems disembarking them (they step over eachother and get hurt/die etc), I guess I'll just have to go with a paradrop.

Share this post


Link to post
Share on other sites

Well..... yes and no depending on whether the vehicle is empty or not. :) I've tried this loads of ways and finally found one that works. The first method I tried was the empty vehicle, so I could get the pilot to get out and this is when engineOn false works. The problem is, either the squad are suspended in mid air and die or the pilot.

Best Method with empty Vehicle:

1.place an empty C130j and name it.(A1)(flying) with

A1 landAt 0;

2.place a pilot and name it.(P1) with

 P1 moveinDriver A1;

3.place squad and name it. (S1) with

S1=group this;  {_x moveInCargo A1} foreach units this;

4.give the pilot a get in waypoint over the plane and a getout waypoint mid runway. On Act

 A1 engineOn false or A1 setFuel 0;P1 unassignVehicle P1;

5.give squad get in waypoint over the plane and a getout waypoint mid runway. On Act

  {unassignvehicle _x} foreach units s1;

6. Synchronize both get out waypoints.

Result squad get out Pilot suspended mid air and die's.

Best Method (nobody dies):

1.place a C130j and name it.(A1)(flying) with

A1 landAt 0;

2. give the C130j a transport unload waypoint. On Act

 A1 setFuel 0;

3. place squad and name it. (S1) with

 S1=group this;  {_x moveInCargo A1} foreach units this;

4. give squad get in waypoint over the plane and a getout waypoint mid runway. On Act

 {unassignvehicle _x} foreach units s1;

5.Synchronize, transport unload and get out waypoints.

Result :yay:

Share this post


Link to post
Share on other sites

The last one still makes people die because they step on top of eachtoher and/or clip with the aircraft/eachother when they get out.

Share this post


Link to post
Share on other sites

Yea in further tests if there is anything else going on other than the landing of the plane and the squad getting out it doesn't work. Which leads me to conclude that kylania is right

As neat as it is to have a 'real system' working, it's more realistic to virtualize this kind of thing. Spawn in the C-130 when you need it in the air, have it do it's drop (hint: check out BIS_fnc_SupplyDrop) then delete the plane once it's out of view.
I was thinking it might be cool to have a script that has a c130 fly low over a runway, annimate the cargo doors and drop a vehicle with parachute :).....but maybe that's one for the winter ;)

In the meantime I'll stick with 50 plus meters, still it was worth trying to land to see what happens.

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
Sign in to follow this  

×