# Aircraft logic

## Recommended Posts

One question one suggestion...

So I am building out a mission where a friendly cargo plane lands at a base, which is under mortar threat; but I have two attack planes on the tarmac; they automatically seem to want to take off even though there is a hold waypoint for each. Is there a game logic that makes sure the attack planes wait until the runway is clear before taking off? Right now the first plane begins its take off roll as the cargo plane is breaking after landing and before it can turn off to the taxi way thus causing the attack plane to crash into the cargo plane then almost immediately the second plane begins its take off and crashes into the rubble of the cargo plane and the first attack plane.

Can this be avoided by increasing the skill of the pilots? Or do I need to extend the flight time of cargo plane so the attack planes can take off? Ideally I prefer the attack planes to be static but when I remove the pilots they become neutral and thus not targets for the mortar teams.

My suggestion - can we make aircraft in general assess the terrain around them so when you set a specific alt to fly at (say 2000) is doesn't try to fly relative to the terrain height? For instance - If I'm on a map where the highest point is say 500 meters, and I set my "this flyinheight" to 1500, its not going to fly at a (for lack of a better word) radar height of 1500 meters, but fly at 1500 meters above sea level? If that makes sense.

##### Share on other sites

For aircraft flying height: https://community.bistudio.com/wiki/flyInHeightASL

For the aircraft on the tarmac, you could try one of the commands to do with limiting vehicle speed (forceSpeed/limitSpeed).

##### Share on other sites

So in the scripting wiki is the example shows three numbers - I understand one is the minimum height what are the other two? Here is the example  - "cobraOne flyInHeightASL [200, 100, 400]"?

##### Share on other sites

One of the oldest trick in the book (dating back to OFP) would be to simply remove their fuel.

Alternately you coud disable the "move" AI for the pilots.

So in the scripting wiki is the example shows three numbers - I understand one is the minimum height what are the other two? Here is the example  - "cobraOne flyInHeightASL [200, 100, 400]"?

As the wiki says:

Params: height - careless/safe/aware, height - combat, height - stealth

You can specify different heights depending on the combat mode the unit is in.

##### Share on other sites

The wording on that wiki article as well as the in game description of flyinHeightASL is a bit confusing.

The three values are nothing more than altitudes for behaviors, aware/safe, combat and stealth. At least that was the order last time I tried it.

Cheers

##### Share on other sites

Thanks guys @tajin I ended up doing just that - setting fuel to zero. I wish the game had better ai logic when it came to mundane things like convoys and aircraft. I can't count the number of times playing a gunner in a convoy and it turned into a cluster because the lead vehicle stopped and everyone else piled up on it. Or like in the original post - planes crashed into each other because they tried to take off when there was traffic on the runway.