Jump to content

Bug in output of getBarometricAltitude() from get_base_data()


heclak

Recommended Posts

There is a bug in the value returned by get_base_data().getBarometricAltitude() which is provided by the sim to obtain the aircraft's barometric altitude via Lua devices. This function should correctly return the current barometric altitude of the aircraft but it is currently broken in DCS 2.5.5.32533 Open Beta. It is uncertain how many versions back did this function break.

 

The function has been tested on Caucasus, Nevada, and the Persian Gulf with the same error.

 

Steps to reproduce the behaviour:

1) Create an aircraft on any map with the QNH set at 2992. Use a Lua device to return altitude information. Relevant functions are listed below.

 

local sensor_data = get_base_data()
print_message_to_user(sensor_data.getBarometricAltitude())

2) Check the correct altitude print out against the value provided in the status bar (Ctrl + Y). Altitude does not match.

 

Expected behaviour

Barometric altitude output should match the value in the status bar. It is understood that the function returns barometric altitude in metres. The necessary conversions have been done for comparison.

 

Screenshots

60500373-ce5e1d00-9cec-11e9-9bcd-26efe3f0ccdf.png

This screenshot shows the raw output of the getBarometricAltitude() function with the value converted to feet. The discrepancy can be observed between the status bar and barometric altitude value.

Link to comment
Share on other sites

Interesting

Hardware: T-50 Mongoose, VKB STECS, Saitek 3 Throttle Quadrant, Homemade 32-function Leo Bodnar Button Box, MFG Crosswind Pedals Oculus Rift S

System Specs: MSI MPG X570 GAMING PLUS, RTX 3090, Ryzen 7 5800X3D, 32GB DDR4-3200, Samsung 860 EVO, Samsung 970 EVO 250GB

Modules: AH-64D, Ka-50, Mi-8MTV2, F-16C, F-15E, F/A-18C, F-14B, F-5E, P-51D, Spitfire Mk LF Mk. IXc, Bf-109K-4, Fw-190A-8

Maps: Normandy, Nevada, Persian Gulf, Syria

 

Link to comment
Share on other sites

  • 6 months later...
  • ED Team
Wasn't this issue checked yet?

 

No

 

looks like this one has been overlooked.

 

If you add a short track replay showing the behaviour I will take a look at tit.

 

thanks

smallCATPILOT.PNG.04bbece1b27ff1b2c193b174ec410fc0.PNG

Forum rules - DCS Crashing? Try this first - Cleanup and Repair - Discord BIGNEWY#8703 - Youtube - Patch Status

Windows 11, NVIDIA MSI RTX 3090, Intel® i9-10900K 3.70GHz, 5.30GHz Turbo, Corsair Hydro Series H150i Pro, 64GB DDR @3200, ASUS ROG Strix Z490-F Gaming, HP Reverb G2

Link to comment
Share on other sites

If you add a short track replay showing the behaviour I will take a look at tit.

Hi Bignewy,

 

I've made a video explaining the bug instead as I'm not sure how a mission track would help troubleshoot a bug with the output of a Lua function. I've included the mission track file from the video in case it really is useful.

 

 

Mission Track File

 

Mission File

 

The relevant Lua code is here:

 

local sensor_data = get_base_data()

-- round altitude to two decimal places
baroAltitude_meter = math.floor(sensor_data.getBarometricAltitude()*100) / 100
baroAltitude_feet = math.floor(sensor_data.getBarometricAltitude()*3.28084*100) / 100

print_message_to_user("Output of getBarometricAltitude()
"
                       ..baroAltitude_meter.." meters 
"
                       ..baroAltitude_feet.." feet"
                   )

 

 

I've included a modified Lua file with the above function for the A-4E if it makes things more convenient for your programmers. Replacing this file in the A-4E would output the function values. Or the code above could be paste into the update() loop of a Lua device. Modified avionics.lua file for A-4E-C (Cockpit/Scripts/Systems/avionics.lua


Edited by heclak
Added mission file. Fix youtube embed.
Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...