ColinM9991 Posted May 13, 2021 Share Posted May 13, 2021 (edited) Hi, I am currently playing around with the scripting environment for DCS on a dedicated server, that I'm hosting locally to test, and have registered some callbacks. I have noticed that these callbacks all work fine and are logging to the log file as expected. When I add the getMissionFilename or getMissionName functions, however, the callbacks, that I add these function calls to, stop logging with no errors being logged. 'Here's what I currently have local dcsexporter = {} function dcsexporter.onMissionLoadBegin() net.log('[DCS Exporter] onMissionLoadBegin ' + DCS.getMissionFilename()) end function dcsexporter.onSimulationStart() net.log('[DCS Exporter] onSimulationStart ' + DCS.getMissionFilename()) end if DCS.isServer() then net.log('[DCS Exporter] Adding DCS Exporter Hooks') net.log('[DCS Exporter] Running as Server') DCS.setUserCallbacks(dcsexporter) end If I remove the concatenation and the GetMissionFilename calls then everything works fine. I would appreciate if somebody could point out exactly what I'm doing wrong. Edited May 13, 2021 by ColinM9991 Link to comment Share on other sites More sharing options...
ColinM9991 Posted May 13, 2021 Author Share Posted May 13, 2021 Never mind, the issue is my IQ. My string concatenation was wrong. In LUA it's .. and not +. Example net.log('Hello, ' .. 'World!') Link to comment Share on other sites More sharing options...
Grimes Posted May 13, 2021 Share Posted May 13, 2021 String concatination in lua is two periods. If you use + it is assuming it is adding two numerical values. net.log('[DCS Exporter] onMissionLoadBegin ' .. DCS.getMissionFilename()) The right man in the wrong place makes all the difference in the world. Current Projects: Grayflag Server, Scripting Wiki Useful Links: Mission Scripting Tools MIST-(GitHub) MIST-(Thread) SLMOD, Wiki wishlist, Mission Editing Wiki!, Mission Building Forum Link to comment Share on other sites More sharing options...
Recommended Posts