Jump to content

Recommended Posts

Posted

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:

LuaIDE.png

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?

 

 

Posted

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

Posted

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?

Posted
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.

 

Banner EDForum2020.jpg

Have fun. Don't suck. Kill bad guys. 👍

https://discord.gg/blacksharkden/

Posted (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 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

  • 1 year later...
Posted

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)

Posted
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. 

 

Posted
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.

Posted
7 hours ago, ADHS 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

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.

  • Like 2
  • Thanks 2
Posted
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

  • 2 months later...
Posted
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

Posted (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.

 

image.png

Edited by winghunter
  • Like 2

DCS Web Editor - New 3D Mission Editor for DCS that runs in your browser

DCS Web Viewer free browser based mission planner

dcs web editor signature2.png
4090 RTX, 13700KF, water cooled, Quest 3

 

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...