PDA

View Full Version : Debugging differences (FGC->FGU) from the Console output for script errors.



celestian
May 12th, 2020, 21:28
Here is the output in question:



[5/12/2020 3:22:33 PM] FGU v4.0.0 ULTIMATE (2020-04-28)
[5/12/2020 3:25:26 PM] [<color="red">ERROR</color>] Script execution error: [string "class_choose"]:20: attempt to index field '?' (a nil value)


Generally, with FGC, if you have a inline script in XML it will just say "line 1" with a error. Here it's showing line 20. Is that the new generalized "script error" line for FGU? If not what does the :20: refer to? It's not line 20 for the xml file for sure. There isn't 20 lines in the <script>...</script> section.

Trying to narrow down where it's complaining. The same code works in FGC so im at a loss what it's not happy with.

Moon Wizard
May 12th, 2020, 22:43
No idea. Everything after "Script execution error: " is being returned by the Lua engine. You'll probably have to add Debug.console statements into that function to see where it is failing.

Regards,
JPG

damned
May 12th, 2020, 23:44
Celestian check pairs vs ipairs

celestian
May 13th, 2020, 00:36
No idea. Everything after "Script execution error: " is being returned by the Lua engine. You'll probably have to add Debug.console statements into that function to see where it is failing.

Regards,
JPG

I just moved all the code into a script file and debugged from there. I was more curious if "line 20" is the new "line 1" (it's always line 1 in FGC) for fgu.

I guess I could just break a script in xml to find out ;)

(the problem was actually a nil control I was trying to use)