Jump to content
The simFlight Network Forums

How can I start new Flight over FSUIPC4 SDK?


Recommended Posts

Hi All;

I want to start MSF X and create new flight from my application by using FSUIPC. And when I fly, I want to stop that flight and change the flight parameters and create new flight. How can I achieve kind of this operation? I have read something about that and I think I will need to know about Lua. Is it right?

And I have tried FSUIPC on MSF X Standart edition, and I want to use on MSF X Deluxe Edition. Does FSSUIPC works properly on Deluxe too?

Thanks in advance.

Umit Uzun

Link to comment
Share on other sites

I want to start MSF X and create new flight from my application by using FSUIPC. And when I fly, I want to stop that flight and change the flight parameters and create new flight. How can I achieve kind of this operation? I have read something about that and I think I will need to know about Lua. Is it right?

You don't need to do anything with Lua if you are a programmer and creating your own application. You can use whatever language you like (Lua included). You can create and edit FLT files in your program, and load them into FS using the facilities at offset 3F00 & following.

And I have tried FSUIPC on MSF X Standart edition, and I want to use on MSF X Deluxe Edition. Does FSSUIPC works properly on Deluxe too?

FSUIPC version 4.50, the current release, works on all versions of FSX and ESP.

Regards

Pete

Link to comment
Share on other sites

Hi Pete;

Thanks for reply. As you said I have looked at the 3F00 and follows, and try to open up the previous flight from my application by firstly set the filename to 3F04 and then load defined flight from 3F00 by setting 0 as you can see from the code;

DWORD dwResult;

char chOurKey[] = "Previous Flight.FLT\0";

if (FSUIPC_Write(0x3F04, 252, chOurKey, &dwResult))

{

if (FSUIPC_Process(&dwResult))

{

cout << "Successfully wrote!" << endl;

}

Sleep(5000);

}

BYTE operation = 0; // 0 to simply load the specified flight/situation.

if (FSUIPC_Write(0x3F00, 2, &operation, &dwResult))

{

if (FSUIPC_Process(&dwResult))

{

cout << "Successfully wrote!" << endl;

}

Sleep(5000);

}

All are successfully wrote bu it doesn't load the flight. What do you think? Where did I make mistake?

Best Regards.

Umit Uzun

Link to comment
Share on other sites

... then load defined flight from 3F00 by setting 0 as you can see from the code

No, you are writing one byte 0 and one byte rubbish to 3F00:

  • BYTE operation = 0; // 0 to simply load the specified flight/situation.
    if (FSUIPC_Write(0x3F00, 2, &operation, &dwResult))

Obviously "operation" needs to be a WORD not a BYTE! A byte is 1 byte long, not 2!

It would also be much more efficient to do the two writes, in that order, with one process call to send them. There is very rarely any need to do more than one process call per cycle. Always group reads and writes to save frequent process switching.

All are successfully wrote bu it doesn't load the flight. What do you think?

Where's the FSUIPC logging with IPC Writes enabled showing that you successfully did anything? Please please please use the tools provided, especially the logging, to help you develop things. I don't want to see code -- next time show me the log if you don't understand it.

Regards

Pete

Link to comment
Share on other sites

Hi Pete;

After post this message I had recognized the BYTE problem and fixed. After your message I grasp the Logging tab on FSUIPC AddOn menu and try to figure out because until now I haven't use this feature. Now I say myself how I was stupid because of not using this tool:D Thanks so much.

Now I can start flight from my application but fistly I have to start new flight by hand. I mean when I am flying I can start new flight. But while there is main MSF X splash start screen I can't start new flight. I have tried loading flight while there is splash start screen but can't achieve. And I am attaching a logging file as you suggested :)

Thanks for your awesome helps Pete.

Umit Uzun

FSUIPC4_LOG.rar

Link to comment
Share on other sites

Now I can start flight from my application but fistly I have to start new flight by hand. I mean when I am flying I can start new flight. But while there is main MSF X splash start screen I can't start new flight. I have tried loading flight while there is splash start screen but can't achieve.

By "splash screen" you mean FS's opening selection dialogue?

FSUIPC cannot do anything whilst FS is in a dialogue -- dialogues are MODAL which means nothing else in the whole process happens!

Why don't you simply set FS to run directly into your default flight? The selection screen has always been optional. Here, if you don't know how:

Change this in the FSX.cfg under the [sTARTUP] header

SHOW_OPENING_SCREEN=0 (change this from 1 to 0)

Same for FS9 and most versions before.

If you want FS to start up with your flight already loaded, start it with the flight name in the command line, something like:

FSX.exe /FLT:flightname

I think. Or maybe just

FSX.exe flightname

Try it.

Regards

Pete

Link to comment
Share on other sites

Hi Pete;

By "splash screen" you mean FS's opening selection dialogue?

Yes, exactly that.

Change this in the FSX.cfg under the [sTARTUP] header

SHOW_OPENING_SCREEN=0 (change this from 1 to 0)

I configured as you suggested and now it's all what I wanted style.

Thank you very much.

Best Regards,

Umit Uzun

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use. Guidelines Privacy Policy We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.