nickexists Posted March 19, 2015 Posted March 19, 2015 I'm trying to use mist.dynAdd() and I keep receiving this error: [string "C:\Users\Nick\AppData\Local\Temp\DCS\/~mis000063E1"]:613: bad argument #1 to 'pairs' (table expected, got nil) How can I gain better insight into what is causing the error?, as far as I can tell the error report doesn't give me hardly any useful to help narrow it down. These vague error reports are constantly an issue for me, am I missing something?
nickexists Posted March 19, 2015 Author Posted March 19, 2015 I figured it out. Documentation led me to believe that it should be vars.unitsTable when it should actually be vars.units. Information about how to track down bugs is still appreciated though.
FSFIan Posted March 19, 2015 Posted March 19, 2015 If you have not already, take a look at DCS Witchcraft (link in my sig). It provides an interactive Lua console that allows you to execute Lua snippets in a running mission and get the results. See this thread for an example of how to use it to interactively try out new functions. To debug your error, I would probably have looked at line 613 in mist.lua, noticed it was looking for "newGroup.units" instead of "newGroup.unitsTable" and then used the Lua Console to quickly confirm that this solves the issue. DCS-BIOS | How to export CMSP, RWR, etc. through MonitorSetup.lua
nickexists Posted March 19, 2015 Author Posted March 19, 2015 Thanks. I actually have been using witchcraft and it's great. But since the error is occurring in an underlying script and not in the actual code the problem area doesn't get highlighted. I hadn't realised that the number was a line number that is very useful.
Recommended Posts