User Tools

Site Tools


debugging-mods

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
debugging-mods [2021/10/24 12:25] maximedebugging-mods [2021/10/25 13:00] (current) maxime
Line 8: Line 8:
  
 When the game starts and creates the lua VM, all scripts in this folder are loaded without any of the restrictions imposed on regular mod files. While this allows changing the lua environment to make mod development easier (such as by inserting a debugger), it also allows potentially unsafe scripts to run. **Mods should not use this folder for anything other than debugging, and should not require files in this folder in order to run properly.** When the game starts and creates the lua VM, all scripts in this folder are loaded without any of the restrictions imposed on regular mod files. While this allows changing the lua environment to make mod development easier (such as by inserting a debugger), it also allows potentially unsafe scripts to run. **Mods should not use this folder for anything other than debugging, and should not require files in this folder in order to run properly.**
- 
-===== Visual Studio Code ===== 
- 
-Debugging mods in Visual Studio Code can be done with the [[https://marketplace.visualstudio.com/items?itemName=tomblind.local-lua-debugger-vscode|Local Lua Debugger]] extension. A minimal debuggee script to enable communication with the game instance is shown below. 
- 
-<file lua vs_code_debug.lua> 
-require("lldebugger").start() 
-</file> 
- 
-The extension currently does not support attaching its debugger to a running executable, but we can configure it to automatically launch the game (with the debugger attached) in the project’s launch.json 
- 
-<file json> 
-{ 
-    "version": "0.2.0", 
-    "configurations": [ 
-        { 
-            "name": "Debug my mod", 
-            "type": "lua-local", 
-            "request": "launch", 
-            "program": { 
-                "command": "<path/to/foundation.exe>" 
-            }, 
-            "args": [] 
-        } 
-    ] 
-} 
-</file> 
  
 ===== ZeroBrane Studio ===== ===== ZeroBrane Studio =====
debugging-mods.1635092700.txt.gz · Last modified: 2021/10/24 12:25 by maxime

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki