Jump to content
Sign in to follow this  
broganj

LVAR not working in Gauge XML

Recommended Posts

Hi, I have a strange problem I cant resolve. The variable for the MSFS PMDG heading window (L:ngx_HDGwindow,Number) works just fine in the Observe Variables window but when I include it in a guage XML script as per below it makes the desktop FIP window loads as just a black window and the application hangs. Can you advise where I am going wrong?

<Element>
    <Position X="570" Y="66"/>
    <GaugeText>
       <FontFace>Bahnschrift Semi-Bold</FontFace>
       <FontHeight>40</FontHeight>
       <FontColor>0xfbf8f4</FontColor>
       <HorizontalAlign>Right</HorizontalAlign>
       <Value>%(L:ngx_HDGwindow,String)%</Value>
    </GaugeText>
</Element>

 

Thanks in advance

I have also tried <Value>%(L:ngx_HDGwindow,Number)%</Value> which also works in the observe window but not in the gauge xml

This is not restricted to just this variable I cant seam to get any L: type variables to work in the gauge XML

Edited by broganj
addition

Share this post


Link to post
Share on other sites

Your Syntax is wrong. Please look at the specs again.

  • Firstly, AAO expects a Space character between the comma and the Unit, especially when you use ", String" - which only exists in AAO, not in the real sim world. Be mindful of that, you cannot just drop ", String" in when you feel like it - for example, AAO will not be able to read (L:ngx_HDGwindow, String) from the sim
  • Second, your % % defs are missing the formatting part !..!

<Value>%(L:ngx_HDGwindow, Number)%!03d!</Value>
displays an integer number.filled up with leading zeroes if it has less than three digits. 

<Value>%(L:ngx_HDGwindow, Number)%!3.2f!</Value>
Displays it as a floating point number with two digit fractions

Edited by Lorby_SI

LORBY-SI

Share this post


Link to post
Share on other sites

Thank you so much for the quick reply, this kind of support is amazing 🙂

When you refer to the 'specs' are you referring to Microsoft SDK specifications or is there another reference that I should use. A link would be really good if you have one

 

BTW, you fixed my problem, thanks again

Edited by broganj
update

Share this post


Link to post
Share on other sites
2 minutes ago, broganj said:

Thank you so much for the quick reply, this kind of support is amazing 🙂

When you refer to the 'specs' are you referring to Microsoft SDK specifications or is there another reference that I should use. A link would be really good if you have one

 

BTW, you fixed my problem, thanks again

No, I mean the AAO manual and the extra PDF about the Gauges. All RPN operators are described in the manual, there is a big table in the chapter about Scripting. But the simulator SDK spec can help too, it is just not exactly the same (AAO has more operators and additional commands for RPN, but less/different elements for gauge XML).

But the best strategy is to look at existing gauges to see how they were made. There is a lot of examples to be downloaded from the AxisAndOhs website.

Edited by Lorby_SI

LORBY-SI

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Tom Allensworth,
    Founder of AVSIM Online


  • Flight Simulation's Premier Resource!

    AVSIM is a free service to the flight simulation community. AVSIM is staffed completely by volunteers and all funds donated to AVSIM go directly back to supporting the community. Your donation here helps to pay our bandwidth costs, emergency funding, and other general costs that crop up from time to time. Thank you for your support!

    Click here for more information and to see all donations year to date.
×
×
  • Create New...