Jump to content
canadian1337

Making AI pilots ignore terrain and fly straight

Recommended Posts

As in the title. You've probably seen this kind of thread multiple times.

I'm trying to create an infantry paradrop on IFA3. The only problem I'm dealing with at this point are AI pilots changing height very rapidly due to the landform.

Things I tried:
https://community.bistudio.com/wiki/flyInHeightASL
https://community.bistudio.com/wiki/flyInHeight

Share this post


Link to post
Share on other sites

Now I haven't tested this but from my understanding: 

flyInHeight = minimum height above terrain 

flyInHeightASL = minimum height above sea-level

 

To get what you are describing I recommend trying 

flyInHeight = minimum height to fly at without colliding ground obstacles, around 15-50m be good i think. 

flyInHeightASL = your flying height + approximate terrain height above sea level 

The key is to set flyInHeight low enough so that: terrainHeightASL + flyInHeight < flyInHeightASL

Share this post


Link to post
Share on other sites

Forgot to mention that they succesfully fly at defined hight but as soon as the plane reaches a hill it will start gaining altitude.

Share this post


Link to post
Share on other sites

I edited my reply as you posted incase you missed it. Just to clarify:

If the hill the plane is flying over is 60 m ASL and the plane is supposed to fly at 100m ASL you set flyInHeight to <40m and flyInHeightASL to 100m

 

If in doubt set flyInHeight to 0 and flyInHeightASL to 100. Just make sure there are no obstacles in the flight path at 100m ASL

Share this post


Link to post
Share on other sites

So I tried few different set ups and sadly the problem is still there :/. The plane does 2 strange "bounces" (nose up, 5 sec break, nose down) like if it was adjusting to the terrain below. 

Share this post


Link to post
Share on other sites

My  JBOY Fly in Formation script can probably help.  This script moves objects across the sky in formation, at a single height ignoring the terrain ups and downs (see the video in the link...first it shows birds flying, then jets).  Note the planes may have no AI while doing this.  But if you only need the planes to drop paratroopers and fly away then it would work fine. 

 

The script works by creating a single object (_birdLeader) that will be moved through the sky using setVelocity.  If the parameter of "birdCount" is greater than one, additional birds are created and attached to the _birdLeader.  Since they are attached they move in exact relative position with the leader.  I believe this can be modified to meet your paradrop needs by one of these methods:

  • Modify the script to simulate the paradrop by adding and ejecting the units from the aircraft createVehicled in the script...or...
  • Modify the script to accept an array of editor placed aircraft that have your paratroopers on board (and remove the createVehicle code from the script).

Good luck!

  • Like 2

Share this post


Link to post
Share on other sites

Gonna give it a try. Don't need to modify it since the paradrop will consist of players, not AI. Thanks!

  • Like 1

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

×