Lineaxe Posted May 25, 2020 Posted May 25, 2020 Hi All, Lua Development tools and DSC connect up but java engine does not recognize the following code: trigger.action.outText("sometext", 5) --debug line or any other code that is not basic lua code such as SET_GROUP and so on ... This is what I get when I run the debug. Happy I succeeded .but ... ---------------------------------------------------------------------------------------- Debugger v1.4.2 Debugger: Trying to connect to 127.0.0.1:10000 ... Debugger: Connection succeed. Exception in thread "main" com.naef.jnlua.LuaRuntimeException: ...ents\LUA TOOLS\workspace\Icicles\src\main-backup.lua:4: attempt to index global 'trigger' (a nil value) at com.naef.jnlua.LuaState.lua_pcall(Native Method) at com.naef.jnlua.LuaState.call(LuaState.java:555) --------------------------------------------------------------------------- Any help ?? HELP ?? HEEEELLPP out there on how to fix this?
Lineaxe Posted May 25, 2020 Author Posted May 25, 2020 Ok , I post here my short fix for this . Since I really can't dig too deeply into Eclipse or JAVA runtime ... Another video demonstrated using a continuous dynamic load . It used _g.loadfile and recognized it as just loadfile . It is written inside of DCS mission editor . It uses the same trigger (999) set to true for the program to run dynamically. A new trigger running continuously that contains a DO SCRIPT with a line in it that says : SET FLAG (999,0) and a LINE such as: assert(loadfile"C:\\yourfolderlocation\\workspace\\yourmissionfolder\\yourmission/lua")() works for me . I only need it to run the script at mission start at the moment so I changed from continuous to run trigger at mission start. Later I will experiment with it loading while the mission is running.
Lineaxe Posted May 25, 2020 Author Posted May 25, 2020 (edited) really I just want the Lua debugger to send the CODE over. Not snoop at it and complain. Freezing up the whole operation in the process..Sheesh... can't find this, can't find that... eek ;. Maybe it runs better when mission is already running and it can find stuff then ... who knows I have had no luck and I noticed many others on eclipse forums as well as here have had much similar results. So short fix does work... Do notice the DOUBLE BACK SLASH (I kinda remember that from programming in windoz long ago. Lately I have been coding in Linux last 15 years or so . Much in c++, c, json, xml, javascript for clients and so on...) Edited May 25, 2020 by Lineaxe
Hardcard Posted May 26, 2020 Posted May 26, 2020 @Lineaxe Have you joined MOOSE Discord? Please do if you haven't. [sIGPIC][/sIGPIC]
Recommended Posts