Jump to content
Sign in to follow this  
Joe98

How touse Fly Im Height?

Recommended Posts

Place a soldier on a runway and check the altitude with the GPS. The altitude is 2,000 meters.

Replace the soldier with an aircraft. in the int type this flyInheight 300

What is the altitude? 2,000 meters or 2,300 meters? i would be happy with either of those.

Except that the altitude is now 100 meters.

I have been playing A2OA for 2.5 years and assumed I just "dont get it".

What is the purpose of flyInHeight ?

Share this post


Link to post
Share on other sites

What is the smilie for "Shakes head in despair!" ?

.

Share this post


Link to post
Share on other sites

flyInHeight is doing a smooth transition, just like you'd do if you pull your nose up in an aircraft and fly up. To have an instant effect use setpos.

this setpos [getpos this select 0, getpos this select 1, 2500];

Share this post


Link to post
Share on other sites
Place a soldier on a runway and check the altitude with the GPS. The altitude is 2,000 meters.

Replace the soldier with an aircraft. in the int type this flyInheight 300

What is the altitude? 2,000 meters or 2,300 meters? i would be happy with either of those.

Except that the altitude is now 100 meters.

I have been playing A2OA for 2.5 years and assumed I just "dont get it".

What is the purpose of flyInHeight ?

There's different coordinate systems at work.

Place a player in the editor and put this in it's init field:

_nil = this spawn {while {true} do {hint format["ATL: %1  ASL: %2", (getPosATL _this) select 2, (getPosASL _this) select 2]; sleep 0.1;};};

Then walk around.. .you will see that the first value (getPosATL) always stays near 0, while the second one varies.. The ATL stands for "Above Terrain Level", and the ASL for "Above Sea level".

flyInHeight is always measured in ATL coordinates, i.e. in height above terrain.

So, why does the GPS show 2000 ? Because ASL lies to you ;) Above sea level positions are positions above the water level of the map. A map can offset that to show higher values, for example a map situated in a high mountain range would still have elevation from, say, 0 to 500, but the map maker can give a base height for the map that offsets this, so the GPS would not actually show 0 - 500, but (if the map make offsets it by, say 2000) 2000 - 2500.

In the end, the only relevant coordinates for scripting purposes are the ASL and ATL. For flyInHeight, it's ATL, so a chopper flying at a flyInheight of 100 will always stay 100 meters above the terrain, no matter where it flies to (mountains or valley).

Hope that helps

Share this post


Link to post
Share on other sites

Thank you for that explination. This will be very useful to me.

In the meantime flyInHeight does not worrk.

this flyInHeight 300 and the aircraft flys at 100 meters

this flyInHeight 400 and the aircraft flys at 100 meters

this flyInHeight 500 and the aircraft flys at 100 meters

this flyInHeight 627 and the aircraft flys at 100 meters

this flyInHeight 758 and the aircraft flys at 100 meters

I suspect there is a bug!

Share this post


Link to post
Share on other sites

flyInHeight is normally used on AI's in aircrafts to command them flying in a specific height.

If it's you who's in the aircraft this command won't have any effect, because you for yourself have to fly in the height you wish.

Share this post


Link to post
Share on other sites
this flyInHeight 300 and the aircraft flys at 100 meters

What is "this" in this case ? The pilot or the aircraft ? IIRC, putting "this flyinHeight x" on a waypoint will work, and on waypoints, this is always the team leader or the driver/pilot of the vehicle triggering the waypont...

Share this post


Link to post
Share on other sites

If aircraft is spawned empty then flyInHeight should be used on pilot.

If aircraft is spawned from West, it should be used in aircraft init.

Also check what's your starting position (should be flying instead of formation).

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  

×