Skip to content

Vehicle XML load failure for third-party mod storeItems causes Vehicle.lua crash (attempt to index nil with 'power') #57

@TheCodingDad-TisonK

Description

@TheCodingDad-TisonK

Description

When opening the UsedPlus finance dialog and clicking to pay off or close a loan, FS25 throws repeated errors attempting to load vehicle XML files from third-party mods. The crash cascades into a base-game Vehicle.lua error.

Log Output

Error: Failed to open xml file 'C:/Users/.../mods/FS25_SoilFertilizer/objects/liquidTank/uan32/liquidTank_uan32.xml'.
Error: Running LUA method 'update'.
dataS/scripts/vehicles/Vehicle.lua:2531: attempt to index nil with 'power'

Error: Failed to open xml file 'C:/Users/.../mods/FS25_SoilFertilizer/objects/liquidTank/uan32/liquidTank_uan32.xml'.
Error: Running LUA method 'mouseEvent'.
dataS/scripts/vehicles/Vehicle.lua:2531: attempt to index nil with 'power'

The errors trigger on both update (every frame) and mouseEvent (user clicks) — repeating dozens of times while the dialog is open.

Root Cause Analysis

  • The referenced file (liquidTank_uan32.xml) is present in the mod's deployed zip — the file is not missing on our end.
  • The mod (FS25_SoilFertilizer) is installed as a zip (FS25_SoilFertilizer.zip), not an extracted folder.
  • The vehicle XML is registered as a <storeItem> in modDesc.xml, which UsedPlus appears to pick up and reference.
  • When UsedPlus triggers a vehicle load (via the finance dialog interaction), FS25 fails to open the XML — likely because the path is being resolved as a raw filesystem path rather than through FS25's virtual filesystem (there is no physical FS25_SoilFertilizer/ folder, only the .zip).
  • UsedPlus has no guard or pcall around the vehicle load failure, so the crash propagates to Vehicle.lua:2531.

Expected Behavior

If a vehicle XML fails to load (for any reason — missing mod, path resolution issue, corrupted entry), UsedPlus should handle the failure gracefully without crashing into Vehicle.lua. The item could be skipped or marked as unavailable.

Steps to Reproduce

  1. Have FS25_SoilFertilizer installed (zip format) with a storeItem that uses a custom fill type
  2. Open UsedPlus finance dialog
  3. Click to pay off or close a loan — errors fire immediately and repeat

Environment

  • FS25 version: current
  • UsedPlus version: current
  • FS25_SoilFertilizer v2.1.5.1 installed as zip
  • Windows 11

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions