Jump to content

You're browsing the 2004-2023 VATSIM Forums archive. All content is preserved in a read-only fashion.
For the latest forum posts, please visit https://forum.vatsim.net.

Need to find something? Use the Google search below.

How to control the Flaps


Nico Kaan
 Share

Recommended Posts

Nico Kaan
Posted
Posted

Hello Ross,

 

In my PSXseeconTraffic program I try to set the flaps of AI aircraft at several stages in the flight. I use SimConnect's event FLAPS_SET for that. The strange thing is that I manage to set the flaps when an aircraft starts at the ground and during take-off, but in the landing phase the SimConnect evenst have no effect. I cannot set the flaps in the down position...

 

Have you any idea why, and what mechanism are you using to set the flaps of an Ai aircraft?

 

Hope you can help me.

Kind regards,

Nico Kaan (developer of VMRGenerator)

Nico Kaan

Developer: PSXseeconTraffic, ParkPosGenerator and AILGenerator

Link to comment
Share on other sites

Ross Carlson
Posted
Posted

I use the same event ... maybe the difference is the way you create the aircraft? What SimConnect method do you use to create it?

Developer: vPilot, VRC, vSTARS, vERAM, VAT-Spy

Senior Controller, Boston Virtual ARTCC

Link to comment
Share on other sites

Nico Kaan
Posted
Posted

I'm using SimConnect_AICreateNonATCAircraft to create an aircraft.

 

When I receive the SimConnect message it has been created I send these three events KEY_FREEZE_LATITUDE_LONGITUDE_SET, KEY_FREEZE_ALTITUDE_SET and KEY_FREEZE_ATTITUDE_SET, because I "slew"aircraft through space myself by calculating alt, lat,lon, pitch , bank and heading 30 times per second.

 

This goes fine at the ground and when taking of, but in the landing phase the flaps no longer respond.

Nico Kaan

Developer: PSXseeconTraffic, ParkPosGenerator and AILGenerator

Link to comment
Share on other sites

Ross Carlson
Posted
Posted

I use the same method, but in addition to sending the freeze events, I also call AIReleaseControl on the aircraft when I get the object ID. Might be worth a try.

 

I doubt this would matter, but I don't move the aircraft every 30 seconds, instead I subscribe to the sim frame event and interpolate the location at that time. That way the movement of the aircraft is in sync with the sim frame rate.

Developer: vPilot, VRC, vSTARS, vERAM, VAT-Spy

Senior Controller, Boston Virtual ARTCC

Link to comment
Share on other sites

Nico Kaan
Posted
Posted

AIReleaseControl was the solution!

Why its absence only effected the landing phase I don't know, but it now works.

Thx.

Nico Kaan

Developer: PSXseeconTraffic, ParkPosGenerator and AILGenerator

Link to comment
Share on other sites

Ross Carlson
Posted
Posted

Yes ... that is truly strange ... glad it helped, though.

Developer: vPilot, VRC, vSTARS, vERAM, VAT-Spy

Senior Controller, Boston Virtual ARTCC

Link to comment
Share on other sites

  • 1 year later...
Pascal M 1430714
Posted
Posted

Hello,

First, sorry for my English, i'm from France…

I know that it's an old topic, i have a question about AIReleaseControl.

From years, everything have been created, there's an application for all we want, but this time, just for fun, i begin to create my own little application.

I have a problem to control a plane. The plane start, takes off, but i can control it. I understand that there's a conflict between my instructions and the AI. AIReleasControl seems to be the solution. But you guess ? I don't understand how to use AIRelease control.

Is there anyone here who could give me an example of the AIReleasCOntrol use. C or VB, no matter, I just need a little help to continue.

 

Thanks in advance

Link to comment
Share on other sites

Pascal M 1430714
Posted
Posted

Thank you Kieran,

I'm going to read this.

Thanks

Link to comment
Share on other sites

 Share