ViperAero Posted May 8, 2024 Posted May 8, 2024 (edited) I have modified my export.lua to export things like vehicle positions, attitude data, etc. It works OK when I run missions that ship with DCS but when I run missions I've created through the mission editor with multiple aircraft available to the user nothing exports. I get an error about selfData being a nil value DCS.openbeta\Scripts\Export.lua"]:73: attempt to index local 'selfData' (a nil value) stack traceback: Scripts\Export.lua"]:73: in function <[string "C:\Users\kenne\Saved Games\DCS.openbeta\Scripts\Export.lua"]:44 Line 73 is my first attempt in the script to get something from the LoGetSelfData() function. Line 44 is the beginning of the LuaExportActivityNextEvent() function I first attempted commenting out the sanitizeModule lines, deleting everything below the dofile('Scripts/ScriptingSystem.lua'), and commenting out the do loop, and I haven't seen any change. --local function sanitizeModule(name) --_G[name] = nil --package.loaded[name] = nil --end --do --sanitizeModule('os') --sanitizeModule('io') --sanitizeModule('lfs') --_G['require'] = nil --_G['loadlib'] = nil --_G['package'] = nil --end Any thoughts as to what I'm missing? Edited May 9, 2024 by ViperAero
Trigati Posted May 9, 2024 Posted May 9, 2024 At a guess when you’re at the slot selection screen it’s trying to export the data but you have not got a slot yet so self data is null values…I suggest you add a few lines of safety code that checks the values are not null before it tries to export them.Sent from my iPhone using Tapatalk
Recommended Posts