I have recently implemented lua scripting in my project, and it is possible for users to enter their custom scripts in the game editor, but here’s the problem… they can easily enter some random stuff and the program will die with exception…
So my question: is it possible to check lua script before executing it? And preferably point to exact place where entered script is incorrect.
I know I can add “try” block, but it’s not the best solution imo.
Upd: As was requested in comments: I’m using “LuaInterface” build for NET 4.
See error handling in the manual, specifically
lua_load. That’ll catch compile time errors. Then seelua_pcalland perhapsluaL_tracebackfor handling runtime errors.