• 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 Reading of a config file

Messages
52
Country
germany
Hi,
currently I’m working on a xml gauge for P3Dv5.
I want to read a special configuration for each livery.
My idea is to place a setup.ini in each texture.livery folder.
Content of this ini will be
option1=1
option2=0
option3=2
And so on.
How can I read that content in the xml and set an lvar according?
I would be very thankful if someone could help me with that.
 
Messages
1,564
Country
thailand
Logger is an xml application that can open and read any text file, line by line. You need to write xml that can parse the lines as they are read to extract the value you want, making use of text operators in xml, then store that as an L:Var. XML surely isn't an efficient way to parse text lines, but it is doable.

The Logger module can be downloaded here. It is also bundled in XMLTools

Bob
 

tgibson

Resource contributor
Messages
11,338
Country
us-california
You could also use the aircraft.cfg file, instead of a separate file in the texture folder. For each livery section you would include a special word in the title= line that signifies which configuration to use. For example this is code I used to specify versions of a DC-4. This macro code searches the title= line for "1960s" and returns a value depending on if it is found or not.

Code:
(A:Title, string) lc '1960s' sstr -1 != if{ 0.00037 } els{ 0.00026 }
 
Messages
52
Country
germany
Thank you both!
I will look into it and report back.
First will require another dll, second will be complicate if I have several option combinations.
 

rcbarend

Resource contributor
Messages
435
Country
netherlands
Alternatively, you could use Doug Dawson's freeware xml_config_x64 gauge, which allows you to save/reload Lvars between flightsim sessions.
Available at:
(second download from top-of-page)

Rob
 
Messages
440
Country
us-wisconsin
To add to Tom's post I've also used atc_flight_number=### in the aircraft.cfg, then used (A:ATC FLIGHT NUMBER, string) '###' scmi 0 == if{ do something } in the XML gauge.
Basically the same thing, just a different flavor.
No dlls necessary. 👍
 
Top