• 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 v5 Is there a way

euroastar350

Resource contributor
Messages
863
Country
us-delaware
Howdy y'all,

Is there a way to load model(s) with different configurations based on one model/different liveries instead of using multiple models? For example, my work in progress Squirrel has multiple parts coded in and controlled via a tablet/gauge, but the part(s) selected will not be saved if the model is reloaded. In X-Plane and depending on the model, some authors use an "ini" or "dat" configuration file to achieve these results and I need something similar for P3D. Any help is appreciated
2025-11-22_14-9-7-920.jpg
 
What I have done is to code the config gauge to detect certain words in the title= line in the aircraft.cfg file. That allows me to customize the configuration for each livery.
 
Here is an example. This tests if the title= line has the word military in it:

XML:
(A:Title, string) lc 'military' sstr -1 !=

lc sets all characters to lower case, then sstr searches the title= string for the word military. If this is present, the test is true. If not, false.

Hope this helps,
 
The late (and very great) Roman Stoviak (Spokes2112) wrote what he called a 'logic gauge' in XML that we used on several of the LDR Development projects (modified to suit each release). It would remember all sorts of configurations and settings. Here is an example of the saved states on the LDR C-119 Boxcar:


All Variants

ASI BugsHeater Zone SwitchesOil Dilution Switch
Astro-dome Light SwitchHydraulic Brakes SwitchOil Transfer Switch
Auto-pilot Inverter SwitchInterphone Selector SwitchesParking Brake Latch
Auto-pilot SlaveInterphone SwitchesPassing Light Switch
Cargo Heat SwitchInterphone Volume KnobsSunglasses
Cockpit Air SwitchInverter SwitchesSwitch Toggle Guards
Code Select SwitchJATO Control SwitchTorquemeter Heater Switch
DME SourceLight Code SwitchWindshield De-Ice Switch
Engine Accessory Heat SwitchMagnetic Compass Light SwitchWindshield Wiper Switch
Formation Light SwitchNAV SlaveYoke Visibility
Fuselage Signal Light SwitchNAV 2 Slave
Heater Master SwitchesOil Cooler Switch

Non-Tanker Specific

Cargo OptionsJump Control Co-pilot Jump SwitchJump Control Pilot Jump Switch
Clamshell VisibilityJump Control Co-pilot Jump Master SwitchJump Control Pilot Jump Master Switch
JATO AvailabilityJump Master Control

Tanker Specific

Cheat OptionRadar Contrast (Non-FFX)Tank Arm Master Switch
FFX OptionRadar Power (Non-FFX)Tank Quantities
Nose SelectionRadar Range (Non-FFX)Tank Selected Switches

The gauge would remember all of those states when you exited the aircraft and would set the states accordingly when you went back into it so it always remembered how you had configured the aircraft previously.

As it was all written in XML it could be used in all versions of FSX and P3D but I am not sure if XMLTools is/was a requirement for this specific gauge but it was a required part of the aircraft install overall.

If you think it might be useful to you I could post the cab file or you could just download the released aircraft from the Sim-Outhouse library (https://sim-outhouse.org/sohforums/resources/ldr-c-119-boxcar.28179/) and crack open the CAB to see how it was done. ;)

The bottom line is yes it can be done, yes we did it on several different aircraft, but don't ask me what witchcraft Roman used to do it as I am a modeller not a coder! :oops::cool:
 
What I have done is to code the config gauge to detect certain words in the title= line in the aircraft.cfg file. That allows me to customize the configuration for each livery.


Hi Tom,

Do you mind sharing some examples that I can work with? I'm still weighing out my options for the final build(s) as xmltools barely works in P3DV6 and most similar DLLs aren't compatible with later versions of the platform
 
I did post example code. You would use that in your cfg gauge. If true, display the desired part(s). Multiple words could be checked to allow a mix of variations.

To be more specific, I would need to know the gauge code you use to display a specific part, as an example.
 
I did post example code. You would use that in your cfg gauge. If true, display the desired part(s). Multiple words could be checked to allow a mix of variations.

To be more specific, I would need to know the gauge code you use to display a specific part, as an example.


This is one of many that's controlled via a config gauge with associated click spots

Code:
<Element>
      <Position X="432" Y="400"/>
      <Select>
         <Value>(L:wirecutter, bool)</Value>
         <Case Value="0">
            <Image Name="check.bmp"/>
         </Case>
         <Case Value="1">
            <Image Name="checkb.bmp"/>
         </Case>
      </Select>
   </Element>

Code:
<Area Left="432" Top="400" Width="15" Height="15">
         <Cursor Type="Hand"/>
         <Click>(L:wirecutter, bool) ! (>L:wirecutter, bool)</Click>
      </Area>
 
OK, here is my first attempt.

XML:
<Value>(A:Title, string) lc 'military' sstr -1 != if{ 1 (>L:wirecutter, bool) } els{ 0 (>L:wirecutter, bool) } </Value>

This would be placed in an additional Element. Using your Element section above as a template this would replace the Value line in your code. Delete the Case and Position lines. No extra mouse section required.

If the word military appears in the title= line, the variable is set to 1, if not it’s set to 0.

Note that this would override your onscreen cfg option, so if retained a flag variable would need to be set in the cfg code mouse section when clicked. That would then be used as a check in my code to see if the onscreen cfg has been used instead.

Example:

XML:
<Click>(L:wirecutter, bool) ! (>L:wirecutter, bool) 1 (>L:cfgcheck, bool) </Click>

And

<Value>(A:Title, string) lc 'military' sstr -1 != (L:cfgcheck, bool) ! &amp;&amp; if{ 1 (>L:wirecutter, bool) } els{ 0 (>L:wirecutter, bool) } </Value>

This would be irreversible in this code. Once the onscreen cfg is used my code is inactivated.

Hope this helps,
 
Last edited:
Back
Top