Jump to content

Recommended Posts

Posted (edited)

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

  • 7 months later...
  • 2 months later...
  • 1 month later...
Posted (edited)
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

  • 4 years later...
Posted

Is the 'LuaExportBeforeNextFrame' only available in the Export environment.

CPU: i9-12900K @ 4.9Ghz

M/B: MSI MEG z690 Ace

RAM: 128GB

Video Card: MSI RTX 4090 Suprim Liquid X

VR: Varjo Aero

  • Recently Browsing   0 members

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