Bravo020 Posted February 5, 2009 Posted February 5, 2009 (edited) Hi, Sorry if this is question has been answered already (I've searched the forums and can find no answer), and also sorry for my lack of understanding of export.lua. I am trying to export some statistics for Engine RPM (left and right) via the export.lua script and am encountering difficulty. I have been able to export some default values via the export.lua and config.lua scripts, using some of the examples already provided within export.lua. ie. export.lua function LuaExportStart() package.path = package.path..";.\\LuaSocket\\?.lua" package.cpath = package.cpath..";.\\LuaSocket\\?.dll" socket = require("socket") host = host or "localhost" port = port or 6060 c = socket.try(socket.connect(host, port)) -- connect to the listener socket c:setoption("tcp-nodelay",true) -- set immediate transmission mode end function LuaExportBeforeNextFrame() end function LuaExportAfterNextFrame() local t = LoGetModelTime() local name = LoGetPilotName() local altBar = LoGetAltitudeAboveSeaLevel() local altRad = LoGetAltitudeAboveGroundLevel() local pitch, bank, yaw = LoGetADIPitchBankYaw() [b] local engine = LoGetEngineInfo() [/b] socket.try(c:send(string.format("t = %.2f, name = %s, altBar = %.2f, altRad = %.2f, pitch = %.2f, bank = %.2f, yaw = %.2f, RPMLeft = %f, \n", t, name, altBar, altRad, 57.3*pitch, 57.3*bank,57.3*yaw[b], engine.RPM.left[/b]))) end function LuaExportStop() local tNext = t return tNext end However when I enable the code written above in bold , I am not successful in generating any RPM statistics, without the bold entries added to export.lua then I am successful in exporting the basics. I believe that I must be entering the commands incorrectly to export the table containing the engine information, or in extracting the data to send to the socket. Has anyone had any success in exporting engine information, and can see where my mistakes might lie? On a sidenote, I also made the similar changes to LockOn FC 1.12 and the export is successful, so I can only assume that something has changed with regards to the implementation within BS or the feature has been removed.....? Any assistance would be greatly appreciated. Kind regards, Bravo020. Edited February 5, 2009 by Bravo020 Made some slight corrections.
Acedy Posted February 6, 2009 Posted February 6, 2009 (edited) Yeah, it seems that LoGetEngineInfo() does not work in BS anymore. If you look at the fields of the _G table you can see that it is still registered as a function in the environment of the export script, but it returns nil when you call it. Edited February 6, 2009 by Acedy [sIGPIC][/sIGPIC] *** SERVMAN SERVER MANAGEMENT MOD V2 FOR DCS:BS V1.0.1 *** *** VERSION FOR FC2 ***
Recommended Posts