Skip to content

MSFS2020 Developer Mode, Model Behavior dialog and Console window

Jaime Leon edited this page Nov 9, 2021 · 20 revisions

This section is a very brief discussion of the Developer Mode of MSFS2020 and the parts of it that we use in searching and testing events. The simulator provides a special user interface for add-on content development called Developer Mode. It is activated from the Options menu of the simulator. Once activated, a new menu will appear at the top bar of the simulator window. Developer Mode gives you access to tools that allow you to see the inner workings of the simulator. The Model Behavior and the Console windows are two important components of Developer mode and are opened from the Windows menu of the Developer Mode menu.

image

First, the Console screen displays all the errors, warnings and messages generated internally by the simulator. This window allows you to monitor what is being executed by MSFS. The code sent by the Mobiflight wasm module to the simulator will appear as part of the error messages in the Console. This can be very helpful in confirming that the instructions are well received by MSFS. Also, the console will display any error messages related to problems encountered with the code received.

UPDATE. As of SU5 the console error messages do not show the mobiflight code to be executed, only actual errors encountered like invalid variables or events.

image

Behaviors Debug dialog tab is probably the most used tool in our search for simulator events and their respective code. It is a window that allows the user to deconstruct the inner structure of all the models being run by the simulator. Once a particular component of an airplane is selected, this tool can display all the details and the code being executed for every component of the airplane simulation, allowing us to extract these instructions for use in our panels connected to Mobiflight.

The first level of the simulator structure deals with the various models used. This information is stored in several xml files. You need to search and select the appropriate xml file for your chosen airplane operation from the many options presented. The file name will usually contain the name of the airplane and the word "interior" or "cockpit". In the image below we show the xml selection for the Citation CJ4 Cockpit.

image

The Component Search feature is used to find any component that has the search keyword in its name. For example, entering the word “engine” will show as result all the components related to the airplane’s engines. Additionally, a Templates filter can also be used to narrow down the search for particular templates. For example, I like to enter the word “code” in the templates filter, so that all of the templates that contain this word will be highlighted in yellow, and all of the sections containing “code” in their name will show in red color, including the code.

The Mouserect section displays all the mouse interactions that the simulator does for a particular component selected. It is located at the very bottom of the Model Behaviors window and it can be essential in tracking what code is being executed by MSFS. In this example we have selected the Citation CJ4 cockpit XML to begin with, and have narrowed our selection to Autopilot panel and the Heading select button. Scrolling to the very bottom we can see the button emits a "H" event called WT_CJ4_AP_HDG_PRESSED.

image

Within the Mouserect section there is another subsection called Logger. The Logger can display the status of any variables and events involved in the component selected. It is very useful when tracking how variables behave in the simulator. One mouse click on the in-sim control will immediately show in the Logger, confirming that you have selected the desired configuration.

The Behaviors dialog has another tab called “Local Variables”. There you can find a long list of all the local variables (L-vars) currently being used by MSFS with their respective value. This can be also useful in tracking how a certain L-var changes in value when doing a particular action in the simulator. It has a filter that allows us to search for variables containing certain text in their name. For example, this feature is useful to monitor your own L-vars from the simulator side.

NEW B: Events With SU5, a new class of events was created, the B: type events. These new events are now used to simplify some of the RPN code previously used in MSFS2020. Unfortunately, we do not yet have access to them for use in Mobiflight, even though the SDK documentation appears to indicate that these B events should be available.

New Input Events Tab Also with SU5, the Model Behaviors window was modified to include a new tab called "Input Events". This new section shows the code for the new B: events. There is a control panel within this page that allows the user to put an event there for monitoring its behavior and also trigger events from here. One of the nicer features of this control panel is that the code can now be selected and copy/pasted. This is something that is still missing in the main Model Behaviors tab.

Important: in order to see the code, you need to deselect the "Minimize data load" box and press the "Reload User Container" button. This will cause MSFS to reload the airplane files. After this, the code will be visible in the control panel section.

Local Variables Tab

Installation

User Interface

Examples and tutorials

MSFS2020

X-Plane

Workshops

Community Boards & Devices

Additional Information

Firmware

Clone this wiki locally