• Which the release of FS2020 we see an explosition of activity on the forun and of course we are very happy to see this. But having all questions about FS2020 in one forum becomes a bit messy. So therefore we would like to ask you all to use the following guidelines when posting your questions:

    • Tag FS2020 specific questions with the MSFS2020 tag.
    • Questions about making 3D assets can be posted in the 3D asset design forum. Either post them in the subforum of the modelling tool you use or in the general forum if they are general.
    • Questions about aircraft design can be posted in the Aircraft design forum
    • Questions about airport design can be posted in the FS2020 airport design forum. Once airport development tools have been updated for FS2020 you can post tool speciifc questions in the subforums of those tools as well of course.
    • Questions about terrain design can be posted in the FS2020 terrain design forum.
    • Questions about SimConnect can be posted in the SimConnect forum.

    Any other question that is not specific to an aspect of development or tool can be posted in the General chat forum.

    By following these guidelines we make sure that the forums remain easy to read for everybody and also that the right people can find your post to answer it.

P3D v3 SimConnect_FlightLoad from Scenario Setup Startup Window

Messages
22
Country
russia
Hi All!

Writing little utilite which load custom scenario file. Function SimConnect_FlightLoad works ok in ran simulator. But from initial screen (title "Prepar3D Scenario Setup") after startup P3D, scenario won't load. Precisely speaking, scenario file actually loaded, but simulator don't start automatically. If manually clicking button "Ok" - simulator starts and loaded correct scenario file.

What need me additionaly to do? How starts P3D from startup screen? Which function? Variant with programmatically hit button "Ok" - looks not a good idea.

Thanks!
 
Messages
87
Country
russia
Hi, Lavrik.

I'm using command line arguments to start Prepar3D and to load custom scenario file. This is the easiest way to do it without any programming. Just basic Windows user skilles and SDK documentation Command Line Switches.

I have saved scenario file (*.fxml) in known location. Then start Prepar3D using <Windows>+<R> and command
Code:
C:\Program Files\Lockheed Martin\Prepar3D v4\Prepar3D.exe "-fxml:C:\Users\Pilot\Documents\Prepar3D v4 Files\my_scenery.fxml"
You can also make shortcut with the same string.

If you don't want to see "Prepar3D Scenario Setup" screen just unmark the "Show At Startup" setting on that windows or in the menu "Options" -> "General" -> "Show Scenario Startup Screen".
 
Messages
22
Country
russia
If you don't want to see "Prepar3D Scenario Setup" screen just unmark the "Show At Startup" setting on that windows or in the menu "Options" -> "General" -> "Show Scenario Startup Screen".
I am writing something kind of like instructor seat (using SimConnect). I need to provide selecting aircraft, initial location and so on before loading scenario (and of course when scenario active - in this case function "SimConnect_FlightLoad" works ok).
If unmark "Show At Startup" - I have deprive initial selecting aircraft and so on.
 
Messages
87
Country
russia
I'm a little confused.
Do you need to initial selection of aircraft and so on in Prepar3D or this is already done in scenery file? I meen the type of aircaft, its position and system states, etc. are written in *.fxml file. Or your utilite must initialy do that instead of default "Startup Screen"?
I remember not a very old days when Prepar3D had no "Startup Screen" at all. Much people pleased them to add that screen. And others do some kind of that screen by themselves. That is why guys created this tiny setting you don't want to unmark. I don't use "Startup screen" for example.

Using SimConnect_RequestSystemState you can check from Prepar3D that user in the "Sim" or in the UI (Startup screen or settings window). Unfortunate you can't set the "Sim" using SimConnect_SetSystemState as described in SDK.
 
Messages
22
Country
russia
Do you need to initial selection of aircraft and so on in Prepar3D
Yes

I meen the type of aircaft, its position and system states, etc. are written in *.fxml file
Yes, i know. My program preparing scenario save file (*.fxml), and then calling function SimConnect_FlightLoad. When Prepar3D actually running - this works. When Prepar3D on initial startup screen - this fails.

Or your utilite must initialy do that instead of default "Startup Screen"?
Yes, it part of functionality.

I don't use "Startup screen" for example.
If don't use "Startup screen" - need have already prepared *fxml to startup directly. But program window show only after P3D starting (because SimConnect architecture).

Unfortunate you can't set the "Sim" using SimConnect_SetSystemState as described in SDK.
And i think no other way to do this.
 
Messages
87
Country
russia
But program window show only after P3D starting (because SimConnect architecture).

I guess your utility is EXE so you can start it independently of Prepar3D when you want to. And as you said
My program preparing scenario save file (*.fxml)
and can do it without SimConnect.

How about next logic?
1. Start your utility with or without Prepar3D.
2. Prepare/change scenario file and save it in the fxml-file.
3. Try SimConnect_Open.
If it returns S_OK then Prepar3D is already launched and in actualy in the "sim state" (without Startup Screen) so use SimConnect_FlightLoad with your scenario file as you done early.
If it returns E_FAIL then Prepar3D is not running yet. In your utility CreateProcess and start Prepar3D.exe with command line argument and path to your fxml-file from your utility and get what you want without that screen. After that you can try again SimConnect_Open if you want to do something else.

Using Command Line Switches you can also via -cfgdir switch to another configuration directory with another Prepar3D.cfg that have "SHOW_SCENARIO_WINDOW=0" that meen "Do not Show Scenario Startup Screen". And this config doesn't change your default %APPDATA%\Lockheed Martin\Prepar3D v4\Prepar3D.cfg that have "SHOW_SCENARIO_WINDOW=1" and when you start Prepar3D from your desktop shortcut you will see default screen.
 
Top