You can use this extension to easily debug your Aseprite scripts and extensions.
To start the debugger, first open Aseprite and navigate to:
File > Scripts > Debugger
and enable the debugger with the Enable Debugger button.
Now the debugger is ready to accept connections. This extension provides Visual Studio Code with the necessary configuration to do this directly.
The easiest way to debug a script is open the "scripts" folder in Visual Studio Code, you can find it in File > Scripts > Open Scripts Folder.
Navigate to the "Run and Debug" tab and then click on the "create a launch.json file" link. This will create a file where you'll be able to select the "Aseprite Debugger" configuration, which will come with a few defaults and look like this:
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"request": "launch",
"scriptFilename": "",
"extensionName": "",
"address": "localhost",
"port": 58000,
"name": "Debug",
"type": "aseprite-lua"
}
]
}You should fill up this JSON file with the connection information from the debugger window in Aseprite (or just leave it default) and then fill out the scriptFilename field with the path to the .lua file you intend to debug. This can be a path relative to the lua scripts folder, or an absolute path to a script somewhere else.
Once this is configured you can press the "Run" button and this will cause Aseprite to run your script like it would if you had clicked on it from the Scripts menu. You can then add breakpoints and use the debugger features as normal.
The process is basically the same as for individual script files but with a few key difference:
- The extension has to be installed, and its
"name"must be in the"extensionName"field. - The "Run" button will re-enable the extensions and perform initialization so that this can be debugged.

