Chat Debug Mod (Factorio 2.0)
Logs chat-related events to factorio-current.log with optional system context and export tools.
What This Mod Does
- Captures player chat messages from
on_console_chat - Logs context with each line:
- tick
- player
- surface
- force
- controller
- position
- Optionally logs join/leave system events
- Keeps a rolling in-memory buffer of recent captured lines
- Supports exporting the last N captured lines as one compact searchable line
Install
- Build a Mod Portal-safe zip from this folder:
- PowerShell:
./build-mod.ps1
- Output:
-../chat-debug_0.1.5.zip - Put the zip in your Factorio mods directory (example):
%APPDATA%\Factorio\mods- Start Factorio and enable Chat Debug in the Mods menu.
- Load/start a save.
Packaging Notes (Important)
- Do not use Windows Explorer "Send to compressed (zipped) folder" or
Compress-Archivefor Mod Portal uploads. - Use
build-mod.ps1(usestar) or 7-Zip. - Archive requirements for Mod Portal:
- Internal root directory must be
chat-debug_0.1.5/ - ZIP entries must use forward slashes
/as path separators
Runtime Settings
Open: Settings -> Mod settings -> Per map
chat-debug-enabled(default: true)- Enables/disables chat-debug logging
chat-debug-log-system(default: true)- Enables/disables join/leave system event logging
Commands
/chatdebug status/chatdebug on/chatdebug off-
Applies a per-save runtime override (does not modify mod settings UI values)
-
/chatdebug-system status /chatdebug-system on/chatdebug-system off-
Applies a per-save runtime override (does not modify mod settings UI values)
-
/chatdebug-export /chatdebug-export 50- Exports last N captured lines (1..200) as one compact line to
factorio-current.log
Log Output
Search factorio-current.log for:
[CHAT DEBUG][CHAT DEBUG EXPORT]
Typical Workflow
- Keep
/chatdebug on - Reproduce an issue while chatting/using debug UI
- Run
/chatdebug-export 50 - Open
factorio-current.log - Search for
[CHAT DEBUG EXPORT]and copy one line for analysis
Notes
- If no chat happened yet,
/chatdebug-exportreports no captured lines. - Editor warnings in VS Code about
script,game,defines,settings,command,log, andglobalare expected because those are Factorio runtime globals.