dikkeduif Posted May 9, 2013 Posted May 9, 2013 Hi guys, Just some general questions regarding the scripting possibilities in dcs world. I've been trying to make a small lua script as a test, nothing too exciting. I've managed to load it (I think), but I don't know if there are any debug commands I can use to print to a log file or to the screen. Also it seems when making a change in the lua script the change is not packed inside the miz file, so I have to manually insert the lua script into the miz file and overwrite the old one. Any way I can avoid this? Is there any way to use sqlite or mysql by importing these additional libraries into the miz file?
Grimes Posted May 9, 2013 Posted May 9, 2013 http://en.wiki.eagle.ru/wiki/Simulator_Scripting_Engine_Documentation env.info('print equivalent') is a print() statement that will print the contents to dcs.log found in users/userName/savedGames/DCS Simply reloading the lua file from a do script file trigger will update it within the .miz. It is impossible to import additional libraries. 1 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
dikkeduif Posted May 10, 2013 Author Posted May 10, 2013 Thanks for answering my question yesterday regarding script reload and importing additional libraries to a miz file. I've been playing around today, and basically I've found a way to write stuff from dcs to a database. I haven't tested the other way around but I think it should be possible. The way it works is that from within dcs I write to a log file. I wrote a small java program that polls a directory every x seconds to see if there is a file (queue) and reads it, parses it and transfers the data to a db. It seems it's also possible to read text files in dcs, so in theory the java program can create a queue with commands for dcs to read, parse and perform an action (like create units etc etc). Again in theory I think I should be able to keep track of statistics, status of planes, ground units etc, but since I'm fairly new to dcs scripting/lua, I'm not really sure if this little experiment can lead to anything useful. I don't know the limitations of the dcs scripting engine to make any assumptions. Just wondering, how useful is this in fact. I read (and I also saw in your mist scripting tools) that there is a new function for adding units dynamically on the map. So maybe these two combined can lead to something interesting.
leonpo Posted May 10, 2013 Posted May 10, 2013 why not just coomunicate via network with this java service? in lua you can easily open tcp/udp channel leon
Recommended Posts