Gronank Posted April 30, 2021 Share Posted April 30, 2021 Over the last few weeks, I've gotten more and more into scripting, but I feel productivity suffers from constantly checking references for spelling and fixing syntax errors. These are problems that are solved with a good IDE. That is not to say that there aren't good IDEs for Lua: I think Visual Studio Code does a fairly good job of the important bits, intellisense and syntax highlighting and validation. There are others too, but VSC is the the one I tried. However, in order to work properly, an IDE needs to be aware of the scripting environment. For us, this means all the scripting types (Group, Unit, env, et.c). I haven't found them defined anywhere in the game folder and I suspect that this is because they're defined in a dll somewhere (Scripting.dll perhaps). My plan for the near future is to create a mockup of the Lua types in the DCS script environment. It would let me do things like this: This, as you might imagine, would come in quite handy and make scripting life far kinder to my hair line. The limited type system in lua will mean it wont be perfect, but I think it will at least be useful. Before I begin, I have three questions: * Am I mistaken, and all these definitions already exist somewhere? * Alternatively, has someone already done this? * Does anyone know of a IDE/plugin/syntax/whatever that lets me provide hints for argument and return value types? Link to comment Share on other sites More sharing options...
exil Posted April 30, 2021 Share Posted April 30, 2021 Isn't this exactly what eclipse ldt with intellisense is doing? At least, I can do it with it. GeForce RTX 4090 Founders Edition - AMD Ryzen 7 5800X3D - 64Gb RAM - Win11 - HP Reverb G1 - Thrustmaster Warthog HOTAS (40cm extension) - VKB Sim T-Rudder MKIV Pedals Link to comment Share on other sites More sharing options...
Gronank Posted April 30, 2021 Author Share Posted April 30, 2021 Yes, eclipse is another IDE with intellisense, but is it aware of the dcs types? If you write "Unit.", does it show the methods of the unit type? Link to comment Share on other sites More sharing options...
fargo007 Posted May 1, 2021 Share Posted May 1, 2021 On 4/30/2021 at 11:59 AM, Gronank said: Yes, eclipse is another IDE with intellisense, but is it aware of the dcs types? If you write "Unit.", does it show the methods of the unit type? Not sure about "Unit.", but if you add MOOSE to the build path it certainly does work this way with the MOOSE objects. e.g. GROUP: would produce a drop down with all the methods. Same with all the other MOOSE classes. Have fun. Don't suck. Kill bad guys. https://discord.gg/blacksharkden/ Link to comment Share on other sites More sharing options...
exil Posted May 2, 2021 Share Posted May 2, 2021 (edited) On 4/30/2021 at 6:59 PM, Gronank said: Yes, eclipse is another IDE with intellisense, but is it aware of the dcs types? If you write "Unit.", does it show the methods of the unit type? Well, at least mine does it. I just setup moose and the ingame commands were added too. Just to clarify, if I type unit: it shows me a drop down list as shown in your picture with e. g. "getbyname", "get velocity"... Edited May 2, 2021 by exil GeForce RTX 4090 Founders Edition - AMD Ryzen 7 5800X3D - 64Gb RAM - Win11 - HP Reverb G1 - Thrustmaster Warthog HOTAS (40cm extension) - VKB Sim T-Rudder MKIV Pedals Link to comment Share on other sites More sharing options...
Zyll Posted January 5, 2023 Share Posted January 5, 2023 i realize i'm necroing an old thread, but the DCS.lua which is included in the Moose package has all the DCS scripting API prototypes, so if you just include this in your project, then you have intellisense for the DCS script language (more or less) Link to comment Share on other sites More sharing options...
Elphaba Posted January 5, 2023 Share Posted January 5, 2023 2 hours ago, Zyll said: i realize i'm necroing an old thread, but the DCS.lua which is included in the Moose package has all the DCS scripting API prototypes, so if you just include this in your project, then you have intellisense for the DCS script language (more or less) I can't find that on github. Link to comment Share on other sites More sharing options...
Zyll Posted January 5, 2023 Share Posted January 5, 2023 https://github.com/FlightControl-Master/MOOSE/tree/master/Moose Development/Moose Link to comment Share on other sites More sharing options...
Elphaba Posted January 5, 2023 Share Posted January 5, 2023 1 hour ago, Zyll said: https://github.com/FlightControl-Master/MOOSE/tree/master/Moose Development/Moose LOL. I didn’t mean Moose; I meant that file - ‘dcs.lua’. Link to comment Share on other sites More sharing options...
ADHS Posted January 5, 2023 Share Posted January 5, 2023 On 5/1/2021 at 12:48 AM, Gronank said: an IDE needs to be aware of the scripting environment Hello. Good idea and i wish you to do it. Sadly there were too many questions that they never got an answer even here. These links may help you further. Good luck. https://www.digitalcombatsimulator.com/en/support/faq/1249/ https://wiki.hoggitworld.com/view/Category:Scripting https://wiki.hoggitworld.com/view/Category:Class_Functions https://wiki.hoggitworld.com/view/DCS_Scripting_orig_Part_1 http://www.dcs-tutorial-collection.de/contents/pages/1genprofs.php https://wiki.hoggitworld.com/view/Mission_Scripting_Tools_Documentation Democracy was already invented, while Scrat was eating oak fruits. Link to comment Share on other sites More sharing options...
Gronank Posted January 5, 2023 Author Share Posted January 5, 2023 7 hours ago, ADHS said: Hello. Good idea and i wish you to do it. Sadly there were too many questions that they never got an answer even here. These links may help you further. Good luck. https://www.digitalcombatsimulator.com/en/support/faq/1249/ https://wiki.hoggitworld.com/view/Category:Scripting https://wiki.hoggitworld.com/view/Category:Class_Functions https://wiki.hoggitworld.com/view/DCS_Scripting_orig_Part_1 http://www.dcs-tutorial-collection.de/contents/pages/1genprofs.php https://wiki.hoggitworld.com/view/Mission_Scripting_Tools_Documentation I actually managed to get MOOSE and the native script api running in VSCode a while back with live debugging. Attached is an instruction for how I set it up: VsCodeSetup.pdf There's also a script file needed for debugging: remote-debugging.lua The script is an amalgamation of devcat's debugee script and its dependencies The instructions significantly based on some instructions I found somewhere, unfortunately I forgot where so I can't give credit where it's due. 1 2 Link to comment Share on other sites More sharing options...
Zyll Posted January 5, 2023 Share Posted January 5, 2023 LOL. I didn’t mean Moose; I meant that file - ‘dcs.lua’. The DCS.lua is downloadable from that link. It's included in Moose, but you don't need Moose to use it.Zyll @ TAW Link to comment Share on other sites More sharing options...
Elphaba Posted January 5, 2023 Share Posted January 5, 2023 Yeah I looked through all the folders for code files. Never found 'DCS.lua' - that was my point. Link to comment Share on other sites More sharing options...
Zyll Posted January 5, 2023 Share Posted January 5, 2023 its right here: https://github.com/FlightControl-Master/MOOSE/tree/master/Moose Development/Moose null 1 1 Link to comment Share on other sites More sharing options...
Elphaba Posted January 6, 2023 Share Posted January 6, 2023 1 hour ago, Zyll said: its right here: https://github.com/FlightControl-Master/MOOSE/tree/master/Moose Development/Moose null Ha! I should have gone to Specsavers... Thanks! 1 Link to comment Share on other sites More sharing options...
jross194 Posted March 19, 2023 Share Posted March 19, 2023 On 1/5/2023 at 11:33 AM, Gronank said: I actually managed to get MOOSE and the native script api running in VSCode a while back with live debugging. Attached is an instruction for how I set it up: VsCodeSetup.pdf 82.5 kB · 20 downloads There's also a script file needed for debugging: remote-debugging.lua 50.35 kB · 13 downloads The script is an amalgamation of devcat's debugee script and its dependencies The instructions significantly based on some instructions I found somewhere, unfortunately I forgot where so I can't give credit where it's due. I could kiss you. Been trying to get away from LDT for months. Never had time to figure out how to get this 'attached' in VSC. Thank you SO MUCH! i6700k 4.4mhz, 32Gb, nVidia 1080, Odyssey+, CH Products, Derek Speare Designs button box, Bass shaker w/SimShaker For Aviators Link to comment Share on other sites More sharing options...
winghunter Posted March 19, 2023 Share Posted March 19, 2023 (edited) I've created an interactive scripting IDE that works in the browser (via ace) It would be nice to integrate your code completion if it works as an ace plugin. Edited March 19, 2023 by winghunter 2 DCS Web Editor - New 3D Mission Editor for DCS that runs in your browser DCS Web Viewer free browser based mission planner / viewer 4090 RTX, 13700KF, water cooled Link to comment Share on other sites More sharing options...
Recommended Posts