Jump to content
Sign in to follow this  
TimeDeatH

Make AI fly at a certain altitude.

Recommended Posts

Is it possible to make AI fly at a certain altitude before they get to their next waypoint? I was mentioning this in another thread, I called it "Cocky Pilot Syndrome", because they kept running into trees, buildings, etc (in helicopters)... If I can make them please tell me how to. I'm pretty sure this would finish making my mission if I could do this.

Share this post


Link to post
Share on other sites

Does the 12345 stand for altitude, IE, can I put any altitude there? Also, I just put that in the init? (do I have to substitute the name of the helicopter for unit?)

Edited by TimeDeatH

Share this post


Link to post
Share on other sites

Yes. Be aware though, they'll start out at their default height then fly to the flyInHeight. Also while getting up to the altitude they won't follow waypoints until they are at the proper height.

You can use setPos to move them to a specific height quickly however.

Share this post


Link to post
Share on other sites

Why do they seem to still descend to their default height even when I both setPos and flyinheight them to the desired altitude?

Share this post


Link to post
Share on other sites

Where would I put setPos into, does it just go after the flyinheight?

Would it be: "unit flyInHeight 12345; setPos" ? Also, kylania, were you saying yes to all 3 of the questions?

Edited by TimeDeatH

Share this post


Link to post
Share on other sites

To make a plane flying in 10000 meters height at the mission start put the following in the init line of the plane:

this setPos [(getPos this select 0),(getPos this select 1),10000]; this flyInHeight 10000;

To make the plane flying in 10000 meters height at a certain waypoint put in the waypoint's on act field:

unitName flyInHeight 10000;

unitName must be the plane's name.

Edited by IndeedPete

Share this post


Link to post
Share on other sites

I put H for the helicopters name, and put on the act field of the transport unload waypoint field: h flyInHeight 185; and when they were done loading the soldiers, they took off and only went about 50 altitude off the ground, between the load, and transport unload. I want the helicopters to be flying at an altitude of 185 whenever they are in the air, but they start off on the ground so the 1st code can't be used. However it helped the mv22s that I had that do start in the air.

Share this post


Link to post
Share on other sites

Helicopter strategy is hard to "simulate" in a game.

I have tried forever to script a more realistic helicopter combat behaviour.

It all fails because the command setVectorUp makes a chopper lie on its side (90 degrees) whenever you enter the slightest small value. So it cant even be scripted to move realistically. The command doesn`t work well with manned vehicles, because the driver would try to counteract the setvectorcommand. And without a driver the engine wouldnt be on.

My point is that if a helicopter is hovering behind a hill then it would not like in Arma climb to 100 meters and fly down Stuka-style on the targetted tanks.

It would pop up just enough to get a lock-on, fire the missiles and climb down

at the same position and not to give up the valuable cover.

I observed that Arma-helicopters usually climb to a higher altitude before they attack a target, regardless if there is any AA around.

If you want your helicopter to fly really high without changing its course just to drop some parachuters,then you can easily script that with setvelocity and setpos it before to a real high altitude.

That is doable.

I believe helicopters have a flyinheight-limit of 50-100 meters. Planes don`t.

Share this post


Link to post
Share on other sites

I can't for the life of me get this to work. Can someone make a demo mission of an mh60 that is sitting on the ground, loads some units, and then has the helo fly to their desired altitude then fly over to the transport unload waypoint staying at that desired altitude, then when they get there (obviously) have the soldiers get unloaded then have the helicopter climb back to the desired altitude and move.

Share this post


Link to post
Share on other sites

flyInHeight is reset at every waypoint I think, so for each waypoint reached you need to reset flyInHeight. Haven't tested this, but saw it mentioned in a previous thread.

Share this post


Link to post
Share on other sites

I know why it wasn't working now. flyInHeight only works between 2 waypoints not just one, so you have to have it for the waypoint you just finished, and the waypoint your heading towards, otherwise it will not work. I'm pretty sure it's that or it only recognizes the flyInHeight after you have passed the waypoint.

Edit: It's only after you pass the waypoint that it flies at the correct altitude, also after you have passed the waypoint it will fly at the correct altitude as long as it's in the air (IE if you pass another waypoint your default altitude will be what you set it at.).

Edited by TimeDeatH

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  

×