Factorio 2.0 mod workspace for squirrel_madness.
This repo uses a split workflow:
- do coding, scripting, and test runs from WSL
- do in-game debugging from Windows VS Code
That split is intentional. The test wrapper is built to run well from WSL, while the factoriomod-debug VS Code extension needs to launch the Windows factorio.exe.
Install these first:
- WSL with this repo checked out on the Windows filesystem, typically at
C:\Code\SquirrelTroubleand visible in WSL as/mnt/c/Code/SquirrelTrouble - Node.js + npm available in WSL
- Factorio 2.0 installed on Windows
- VS Code on Windows
- the VS Code extension
justarandomgeek.factoriomod-debug
The repo already includes:
.vscode/launch.jsonwith Factorio debug launch entries.vscode/settings.jsonwith Factorio version entriesscripts/test-factorio.shfor WSL-friendly Factorio test runsscripts/factorio-debug-wrapper.shfor Windowsfactorio.exelaunch compatibility
- Use WSL terminals for
git, editing support tools,npm install, andnpm test. - Use Windows VS Code for live in-game debugging.
- If you open VS Code from WSL, the debugger path handling will break on Windows-vs-WSL path translation for
config.ini,modsPath, and related debug arguments.
From WSL in the repo root:
npm installThis installs the local Node dependencies and runs the repo's postinstall patch for factorio-test-cli.
Create a local .env.local in the repo root with your Factorio path.
Typical WSL setup:
FACTORIO_PATH="/mnt/c/Program Files/Factorio/bin/x64/factorio.exe"If your Windows install lives somewhere else, point FACTORIO_PATH at that factorio.exe.
Notes:
npm testcallsscripts/test-factorio.sh- when
FACTORIO_PATHpoints to a Windows.exefrom WSL, the wrapper switches to Windows path semantics automatically - the Factorio test scratch directory is
../.factorio-test
Run the full suite with:
npm testUseful variants:
npm run test:watch
npm run test:gui- Install Windows Factorio.
- Install WSL Node.js dependencies with
npm install. - Set
FACTORIO_PATHin.env.local. - Run
npm testfrom WSL.
If tests fail because the Factorio path is wrong, fix FACTORIO_PATH first. The test wrapper already handles the WSL-to-Windows launch path once the executable path is correct.
- Start Windows VS Code, not WSL VS Code.
- Open the repo at
C:\Code\SquirrelTrouble. - Install the recommended extension
justarandomgeek.factoriomod-debugif VS Code has not already done so. - Check
.vscode/settings.jsonand update the hardcoded paths if your local install differs:factorioPathconfigPath- optional
docsPathandprotosPath
- Use one of the checked-in launch configs from
.vscode/launch.json:Factorio Mod DebugFactorio Mod Debug (Settings & Data)Factorio Mod Debug (Profile)
Important:
- the debugger should be launched from Windows VS Code because it starts the Windows
factorio.exe - this repo already points the WSL-wrapper entry at
scripts/factorio-debug-wrapper.sh, but the normal contributor path is still to launch VS Code from Windows - if your repo is not at
C:\Code\SquirrelTrouble, update.vscode/settings.jsonaccordingly
The checked-in VS Code debug setup does not use your normal %AppData%\Factorio profile.
It uses the repo-local test/debug profile instead:
.vscode/settings.jsonpointsconfigPathatC:\Code\SquirrelTrouble\.factorio-test\config.ini- that config sets Factorio
write-datatoC:\Code\SquirrelTrouble\.factorio-test - the active debug mod directory is therefore
C:\Code\SquirrelTrouble\.factorio-test\mods
That means:
- the debugger will not load
squirrel_madnessfrom%AppData%\Factorio\mods - seeing no
squirrel_madnessin%AppData%\Factorio\modsis expected during this workflow - the live debug copy of the mod is the folder at
.factorio-test/mods/squirrel_madness
Why that works:
.vscode/launch.jsonusesmanageMod: true- the
factoriomod-debugextension copies or manages the repo mod into.factorio-test/mods - launching the checked-in debug configs runs Factorio against that isolated profile
Practical consequence:
- if you are debugging and want to verify what the game is actually loading, inspect
.factorio-test/mods/squirrel_madness - if behavior in the debug game does not match the repo, compare the repo files to the copy in
.factorio-test/mods/squirrel_madness
Most repo documentation assumes this layout:
- Windows repo path:
C:\Code\SquirrelTrouble - WSL repo path:
/mnt/c/Code/SquirrelTrouble
Run the integration suite with:
npm test