• 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.

FSXA Convert numbers to strings

Heretic

Resource contributor
Messages
6,830
Country
germany
I want to change (A:ATC FLIGHT NUMBER, string) from an XML gauge by using XMLTools' SimVars class.

In the ESP SDK documentation, the variable is listed as settable and there's at least one external tool out there, with which a flight number change can be achieved.

However, when I try to set a new flight number with SimVars (e.g. "6969 (>C:SIMVARS:ATC FLIGHT NUMBER,string)"), I get nothing.

My suspicion is that I need to convert the numerical value to a string, but the SDK XML reference documentation doesn't seem to have an operator for that - or I'm too dumb to find it.

Can anyone push me in the right direction?



- Edit:

After having tried around 500000 tricks to get the flight number to change to no avail, I'm wondering if the variable can be set at all.
Even something simple like " '99' (>C:SIMVARS:ATC FLIGHT NUMBER,string)" does not work.
 
Last edited:
"chr" is the operator.
"scat" to put the chr to a string.

e.g
%((L:NavM_POST_Apt_Chr1,number) chr (L:NavM_POST_Apt_Chr2,number) chr scat (L:NavM_POST_Apt_Chr3,number) chr scat (L:NavM_POST_Apt_Chr4,number) chr scat)%!s!\n
 
It would appear that it is possible to change the ATC Flight number, however you need to reload the flight-plan for the change to become apparent.
 
The ATC flight number originates in the aircraft.cfg. I think you have to change it there.
Roy
 
Further to my post of yesterday.
The FSUIPC Offsets Status document page 42/68 says this
"
3130 12 ATC flight number string for currently loaded user aircraft, as
declared in the AIRCRAFT.CFG file. This is limited to a
maximum of 12 characters, including a zero terminator.
SimConnect allows this SimVar to be written, but this may not
change the Flight Number being used by ATC unless a flight
plan has been loaded too (see offset 0130)."

Looks like the definitive answer
Roy
 
Yes and no.
While the flight number is initially read from "atc_flight_number=" in the aircraft.cfg, it is also stored in the state.cfg in "C:\Users\[Username]\AppData\Roaming\Microsoft\FSX\simobjects\[airplane folder name]\" when changed. Editing the flight number in state.cfg and reloading the aircraft does change "(A:ATC Flight Number, string)" accordingly.
Furthermore, "SetFlightNumber"* uses SimConnect to change the flight number with or without a flight plan.

And yes, ATC only recognizes the new flight number unless you at least reload your current flight plan in the default flight planner.


The problem that I am simply unable to write to "ATC Flight Number, string" via XMLTools/SIMVARS remains.



* http://www.lorby-si.com/downloads.html
 
The problem that I am simply unable to write to "ATC Flight Number, string" via XMLTools/SIMVARS remains.

That's true, because there is a bug in the string save function.

I am currently updating both FSX/P3Dv3 and v4 versions with some fixes, hope to post them next week.

Tom
 
That's true, because there is a bug in the string save function.

I am currently updating both FSX/P3Dv3 and v4 versions with some fixes, hope to post them next week.

That'd be great. Thanks for looking into this!
 
That's true, because there is a bug in the string save function.

I am currently updating both FSX/P3Dv3 and v4 versions with some fixes, hope to post them next week.

Tom
Hi Tom just looking for some info about how to change this parameter with XMLTools X64 version on P3Dv4.5 I find that nothing happens may be the bug is present yet?? thx in advance for your support....
 
Last edited:
Back
Top