Jump to content

Basics of exporting DCS data via Export.lua help


Recommended Posts

If anyone will help please,

I'm attempting to follow the below video by "DCS Flighttraining" instructions on how to export data via the Export.lua file. However, I'm having no success. Can anyone tell me what I'm doing wrong? Thanks.

Here is a copy of the Export.lua file.

[EDIT] I found the error, a syntax error, see if you can see it (I marked it in bold red). It ":" should not be there... :doh: :wallbash:

Thanks for help guys .... :glare: :badmood:

:D

 

local log_file = nil

function LuaExportStart()

   log_file = io.open("C:/Users/Username/Saved Games/DCS/Logs/Data.txt", "w")

end

function LuaExportBeforeNextFrame()
end

function LuaExportAfterNextFrame()

   local IAS = LoGetIndicatedAirSpeed()
   
   log_file:write(string.format("IAS: %.4f 
",IAS))
end

function LuaExportStop()
   
   log_file:write(string.format("exit"))
   
   if log_file[b][color=Red]:[/color][/b] then
     log_file:close()
     log_file = nil
   end
end

function LuaExportActivityNextEvent(t)
   
end

Edited by DigitalEngine
Found the Error

CPU = Intel i7-6700K

Motherboard = ASUS ROG Maximus VIII Hero Alpha, w/ the Intel Z170 Chipset,

RAM = 64 Gigs of Ripjaws V F4-3400C16Q.

GPU = Zotac GTX980ti Amp Extreme

Hard-drive = Samsung V-NAD SSD 950 PRO M.2

Link to comment
Share on other sites

  • 7 months later...
  • 2 months later...
  • 1 month later...
Were you ever able to get this working? I have done it in the past.. If you still want to know I can take a look for you, but I'll wait to hear back from ya

Yes, I did! :chef:

This is what I was looking to accomplish:

local log_file = nil

   function LuaExportStart()
       log_file = io.open("C:/Users/George/Documents/Web Page Projects/rising-thunder-alpha-test/data/dcs-time.txt", "w")

   end

   function LuaExportBeforeNextFrame()
   end

   function LuaExportAfterNextFrame()
       
   end

   function LuaExportActivityNextEvent(t)
       local tNext = t
       local TIME = LoGetModelTime()
       log_file:write(string.format("Time: %.0f \n",TIME))
       tNext = tNext + 6
       return tNext
   end
   
   function LuaExportStop()
       log_file:write(string.format("EXIT"))
       if log_file then
           log_file:close()
           log_file = nil
       end
   end

Here is a link to a "static" working example on github (it's static as the "time-data.txt" file is not being actively written onto on github). But it demonstrates what I am attempting to accomplish.


Edited by DigitalEngine
gramatical

CPU = Intel i7-6700K

Motherboard = ASUS ROG Maximus VIII Hero Alpha, w/ the Intel Z170 Chipset,

RAM = 64 Gigs of Ripjaws V F4-3400C16Q.

GPU = Zotac GTX980ti Amp Extreme

Hard-drive = Samsung V-NAD SSD 950 PRO M.2

Link to comment
Share on other sites

  • Recently Browsing   0 members

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