Jump to content

Needing Export.lau help: Heading/Bearing


Recommended Posts

Posted (edited)

Hello! I am just now learning how to export data through the Export.lua file.

I've created a little "dashboard" app in Unity to display some information about my plane (F-5 specifically). I've gotten almost all of the information I need except for my planes heading/bearing. No matter what I try, I cannot get the export to work correctly. It's like DCS hangs it up, and my Unity app never connects.

Here's the relevant code:

function LuaExportAfterNextFrame()

	local IAS = LoGetIndicatedAirSpeed()
	local Alt = LoGetAltitudeAboveSeaLevel()
	local HSI = LoGetControlPanel_HSI()
	local engine = LoGetEngineInfo()
	local snares = LoGetSnares()
	local guns = LoGetPayloadInfo()

	socket.try(MySocket:send(string.format("%.4f, %.4f, %.4f, %.4f, %.4f, %.4f, %d, %d, %d, %.3f\n", IAS, Alt, engine.fuel_internal, engine.fuel_external, engine.FuelConsumption.left, engine.FuelConsumption.right, snares.chaff, snares.flare, guns.Cannon.shells, 57.3*HSI.Course)))
end

Everything works until I try to add something from HSI. It doesn't matter what it is. I've tried ADF, RMI, Heading, Heading_raw, and Course. I've tried them plain and also with the "57.3*" from the example on Hoggit. I've tried it with %d, %.2f, %.3f, and %.4f. I've even tried isolating them where I return nothing else but one of those variables. It's the same result no matter what... just a hang.

I'm completely confused, so I am looking for assistance. Any help would be greatly appreciated! 😄

 

On a side note, the engine.fuel_external variable always returns zero... even when I have three full tanks on my plane. The fuel just gets added to engine.fuel_internal. Is that normal?

 

Thank you so much! 😄

Edited by Kageseigi
  • Recently Browsing   0 members

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