I have all the required mods downloaded. i'll test the railroad mods on a new save. Accordin to Google Gemini:
This is a Lua script crash in Farming Simulator 25 caused by a specific vehicle or implement (likely a mod) with broken "Connection Hose" definitions.
Here is the specific and detailed breakdown of what is happening and how to fix it.
The Diagnosis
The game engine is crashing the ConnectionHoses.lua script. This script handles the visual connecting lines (hydraulic hoses, air lines, electric cables) that appear when you attach a trailer or implement to a tractor.
Technical Breakdown
The error log reveals a cascading failure sequence:
- The Root Cause:
Script error: Divide by zero error ... ConnectionHoses.lua:666 getCenterPointAngleRegulation- What this means: The game is trying to calculate the curve/bend of a hose. To do this, it usually divides by the distance between the start point and the end point.
- Why it fails: The distance is coming back as 0. This usually happens if the "Target Node" (on the implement) and the "Start Node" (on the tractor) are in the exact same physical coordinates, or if the modder defined a hose length of 0 in the XML.
- The Consequence (NaN):
Script error in worldToLocal: Argument 2 is a NaN- What this means: Because the previous calculation divided by zero, the result was
NaN(Not a Number). The game then tried to use this invalid result to determine the hose's position in the 3D world (worldToLocal), causing the second error.
- What this means: Because the previous calculation divided by zero, the result was
- The Crash (Nil):
attempt to perform arithmetic (sub) on number and nil- What this means: The calculation failed so badly that the variable became
nil(empty/non-existent). When the game tried to do basic subtraction (sub) on the next frame, it crashed because you cannot subtract from "nothing."
- What this means: The calculation failed so badly that the variable became
How to Fix It
This error is almost certainly caused by one specific mod (a tractor, trailer, or implement) that you are currently using or is loaded near the player.
1. Identify the Broken Mod
- Context: Did this happen immediately after buying a specific tractor or attaching a specific tool? That item is the culprit.
- Test: If you are unsure, load your save. Walk away from your vehicles. If the console stops spamming the error, walk toward your vehicles one by one. When the error starts spamming again, the vehicle closest to you is the broken one.
2. If You Are a Player (Non-Modder)
- Sell the vehicle: If you can get close enough without the game freezing, sell the vehicle causing the issue.
- Remove the Mod: Uninstall the mod responsible for that vehicle. It requires an update from the author to fix the XML definition.
3. If You Are the Modder (How to Fix the XML)
If you are creating this mod, check your vehicle.xml under the <connectionHoses> section:
- Check Nodes: Ensure the
node(start) andtargetNode(end) are not identical or located at the exact same0,0,0coordinates relative to each other when connected. - Check Length: Look for
lengthattributes. Ensure no hose has a length of0. - Check Diameter: Sometimes a defined
diameterof0can also cause calculation errors in the physics engine.
Next Step:
Do you know which vehicle you bought or used right before these errors started appearing? If you can identify the mod, I can help you locate the specific XML lines to check.