-
-
Notifications
You must be signed in to change notification settings - Fork 219
Lua Debugging (VSCode)
Ben Dol edited this page Dec 8, 2023
·
7 revisions
Will be added in https://github.com/mehah/otclient/pull/671/files (remove me when merged)
Open & build your the project in VSCode (make sure you build using debug, i.e. Windows - Debug (MSVC)
)
Install the VSCode Local Lua Debugger extension
Go to File > Preferences > Settings
and search for Lua-local: Interpreter
make sure this is set to lua5.1
Add the following configuration to your otclient/.vscode/launch.json
configuration file (if it doesn't exist create it and paste all of the below into it. Otherwise add just the contents of "configurations": [
as a new configuration).
{
"version": "0.2.0",
"configurations": [
{
"type": "lua-local",
"request": "launch",
"name": "Debug Lua Executable",
"program": {
"command": "${workspaceFolder}/otclient.exe"
},
"args": [
"${workspaceFolder}"
],
"scriptRoots": [
"${workspaceFolder}/modules",
"${workspaceFolder}/mods"
],
"scriptFiles": [
"${workspaceFolder}/modules/**/*.lua",
"${workspaceFolder}/mods/**/*.lua"
],
}
]
}
Launch the new launch configuration Debug Lua Executable
Now you can add breakpoints to your lua code directly and profit.