FlightControl-Master / MOOSE

Mission Object Oriented Scripting Environment (MOOSE) for lua mission scripting design in DCS World
http://flightcontrol-master.github.io/MOOSE/
GNU General Public License v3.0
290 stars 94 forks source link

Easy debugging for all Moosers #2093

Closed kaltokri closed 8 months ago

kaltokri commented 8 months ago

In this video series Coconut Cockpit is showing all steps needed to use PyCharm as Debugger for Moose: https://www.youtube.com/watch?v=ZtAW8RhdLYo&list=PLfvAPyO3jL_IGJx9f1RrLL77JcjW22F9N

I've tested it and the only thing I dislike is the needed modification of two files which are part of the repository:

With a simple backward compatable change in some files, we can enable everyone to use the debugger by just add the following lines of code to their MissionScripting.lua:

MOOSE_DEVELOPMENT_FOLDER="G:/DCSScripting/MOOSE/Moose Development"

package.cpath = package.cpath .. ';C:/Users/<user>/AppData/Roaming/JetBrains/PyCharmCE2023.3/plugins/EmmyLua/debugger/emmy/windows/x64/?.dll'
local dbg = require('emmy_core')
dbg.tcpConnect('localhost', 9966)

I'll create a PR for the change. Please take a look at the code to make sure I haven't overlooked anything.