leonardo_c Posted Thursday at 09:43 AM Posted Thursday at 09:43 AM 2025-08-14 09:19:32.800 ERROR LuaGUI (Main): [string "./MissionEditor/modules/me_exportToMiz.lua"]:98: [string "./MissionEditor/modules/me_exportToMiz.lua"]:1835: table index is nil same mission was working fine before last DCS update. dcs.log My DCS Campaigns - DOWNLOAD
leonardo_c Posted yesterday at 12:50 AM Author Posted yesterday at 12:50 AM (edited) this correction will add some defense to me_exportToMiz.lua. hard to find the issue since the original code is really poor on logs of any sort. function createTblIds() tblGroupIds = {} tblUnitIds = {} tblGroupNames = {} tblUnitNames = {} for k,coalition in base.pairs(mission.coalition) do for kk,country in base.pairs(coalition.country) do for kkk,grType in base.pairs({"helicopter","ship","plane","vehicle","static"}) do if country[grType] and country[grType].group then for _tmp, group in base.pairs(country[grType].group) do if group.groupId ~= nil then tblGroupIds[group.groupId] = group.groupId tblGroupNames[group.name] = group.name for _tmp2, unit in base.pairs(group.units) do tblUnitIds[unit.unitId] = unit.unitId tblUnitNames[unit.name] = unit.name end else log.error("Group missing groupId: " .. group.name) end end end end end end end on the interesting side, it appears that every unit generated from a late activation template through scripting will trigger the NPE. again, this used to work fine before the latest "patch". it's very interesting that the units failing to be saved have all names plane, plane1...planeN, helicopter1...helicopterN and finally vehicle1...vehicleN which are the names of the groups that will be created by the same save feature. seems that the method is trying to save the same units it generates during this scan but those do not have an ID yet. Edited yesterday at 12:42 PM by leonardo_c My DCS Campaigns - DOWNLOAD
leonardo_c Posted 18 hours ago Author Posted 18 hours ago there's an error also saving destroyed statics, no scripting in this case. place a static warehouse on the map, destroy it and then save. reproducible every time. 2025-08-16 20:47:24.740 ERROR LuaGUI (Main): [string "./MissionEditor/modules/me_exportToMiz.lua"]:98: [string "./MissionEditor/modules/me_exportToMiz.lua"]:1939: attempt to index local 'unitDef' (a nil value) My DCS Campaigns - DOWNLOAD
Recommended Posts