0% found this document useful (0 votes)
14 views

Lua Debugging

This document provides instructions for debugging Noita's Lua scripts using the Decoda IDE graphical debugger. It explains how to set up the debugger, set breakpoints, and provides tips on debugging. It also describes how to use luacheck to statically check Lua scripts.

Uploaded by

Cicada
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
14 views

Lua Debugging

This document provides instructions for debugging Noita's Lua scripts using the Decoda IDE graphical debugger. It explains how to set up the debugger, set breakpoints, and provides tips on debugging. It also describes how to use luacheck to statically check Lua scripts.

Uploaded by

Cicada
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 1

This file contains instructions for debugging Noita's Lua scripts.

We assume that you have basic experience using a graphical debugger (e.g.
understand the concept of a breakpoint).
Please note that running the game with the -debug_lua parameter enables some lua
sandbox escape exploits, so you shouldn't do that when any untrusted mods are
enabled.

1) Download and install the Decoda IDE: https://unknownworlds.com/decoda/download/


2) Start Decoda
3) Select Project -> Settings
4) In the dialog set "Command" to point to your noita_dev.exe
5) Set "Command arguments" to -debug_lua
6) Set "Working directory" to point to the directory where noita_dev.exe is located
7) Select Debug -> Start debugging (or press F5)
8) Press F9 or click the bar on the left side of the source view to add/remove a
breakpoint on the current source line

Tips:
- In case you'd like to debug a lua file before it's been loaded by the game (and
auto-added to Project Explorer), drag and drop the file to Project explorer, open
the file and set breakpoints where needed, then press F5 to start debugging.
- Adding _G to the Watch window allows you to watch the entire state of a lua
context.
- Please note that Noita runs lua scripts inside multiple lua contexts.

Using luacheck to statically check lua scripts


---
1) Get a copy of luacheck.exe (https://github.com/luarocks/luacheck) and place it
into Noita/tools_modding. A precompiled 64-bit binary can be found here:
https://github.com/mpeterv/luacheck/releases/download/0.23.0/luacheck.exe
2) Open a command line and set your working directory to Noita/tools_modding
3) Run luacheck_all

You might also like