Chat Debug

by zippyit

Logs chat messages and chat-like console output to factorio-current.log for debugging.

Utilities
an hour ago
2.0
0
Owner:
zippyit
Source:
https://github.com/zippyit/chat-debug
Homepage:
N/A
License:
MIT
Created:
2 hours ago
Latest Version:
0.1.5 (an hour ago)
Factorio version:
2.0
Downloaded by:
0 users

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

  1. Build a Mod Portal-safe zip from this folder:
  2. PowerShell:
    • ./build-mod.ps1
  3. Output:
    - ../chat-debug_0.1.5.zip
  4. Put the zip in your Factorio mods directory (example):
  5. %APPDATA%\Factorio\mods
  6. Start Factorio and enable Chat Debug in the Mods menu.
  7. Load/start a save.

Packaging Notes (Important)

  • Do not use Windows Explorer "Send to compressed (zipped) folder" or Compress-Archive for Mod Portal uploads.
  • Use build-mod.ps1 (uses tar) 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

  1. Keep /chatdebug on
  2. Reproduce an issue while chatting/using debug UI
  3. Run /chatdebug-export 50
  4. Open factorio-current.log
  5. Search for [CHAT DEBUG EXPORT] and copy one line for analysis

Notes

  • If no chat happened yet, /chatdebug-export reports no captured lines.
  • Editor warnings in VS Code about script, game, defines, settings, command, log, and global are expected because those are Factorio runtime globals.