If your AI character is not moving and you get RCON connection errors in the bridge console, follow these steps to fix it:
1. Fix the Python Library:The installation guide has an outdated library. Open PowerShell and reinstall the correct one using these commands: powershell
python -m pip uninstall factorio-rcon -y
python -m pip install factorio-rcon-py
-
Enable RCON inside Factorio:Old Steam launch options do not work in Factorio 2.0+. Launch the game, hold Ctrl + Alt in the main menu, and click "Settings" ➡️ "The rest". Scroll down and enter:
local-rcon-socket ➡️ 127.0.0.1:27015 (Make sure there is NO space at the end!)
local-rcon-password ➡️ 123zxd123zxd
-
Prevent the Script from Resetting Password:The mod automatically overwrites config.json on startup, changing the IP to localhost and wiping the password. To block this, open lm_studio_bridge.py in Notepad:
At the very top under # RCON Configuration, set: RCON_HOST = "localhost" and RCON_PASSWORD = "123zxd123zxd"
Find def load_config(self): and comment out (add # at the start of each line) the entire block under # RCON settings hot-reload, including the if (self.rcon_host != old_host)... check. This prevents the script from forcing an empty password.
-
Correct Game Launch Mode:Always load your save through "Multiplayer" ➡️ "Host game". In standard single-player mode, Factorio physically closes the RCON port! (You can uncheck "Public" to play completely alone).
5.Activate the Bot:Run the bridge (python lm_studio_bridge.py) and make sure Start Server is active in LM Studio. Once on the map, type these commands in the in-game chat:
/spawn-ai-player
/promote AI
(Note: If it says player not found, check the exact bot name using /players command, it could be AI or ai_player depending on your version).
⚠️ Important Notice: The mod works perfectly on Vanilla Factorio. However, it will lag, freeze, or cause RCON exceptions on overhaul mods (Krastorio 2, Warptorio) due to hidden system entities, complex custom crafting recipes, and multi-surface maps.