Drop Vehicle Parts After Uninstall [B42]
Drop Vehicle Parts After Uninstall [B42]
Hi, This is my first mod. I made this mod because I couldn't find any that works without bug or ruining your game save.
What this mod does:
- Drops heavy vehicle parts on the ground after uninstalling them instead of forcing them into your main inventory.
- This keeps the uninstall action working smoothly with heavy parts.
- Parts under 1.0 weight are not forced to drop. Lightweight parts such as light bulbs stay unchanged.
- Compatible with Better Auto Mechanics.
- Works with modded vehicles.
- You can add or remove this mod from an existing save at any time.
- Works in both singleplayer and multiplayer.
Technical details:
- The mod hooks ISUninstallVehiclePart.complete().
- If the removed part is heavy, the mod sets player main inventory capacity to "1" so the game drops the part on the ground instead of forcing it into the inventory.
- Right after the uninstall function finishes, the mod restores the inventory capacity.
- A small client-side guard also keeps watching the player inventory capacity.
- If another mod conflict or script error leaves the main inventory capacity stuck at "1", this mod automatically restores it to a safe value.
- The automatic recovery value is "50" (Don't confuse this with characters load capacity this number is constant.)
Manual fix:
- Open the Lua Console and run this one-line then check if its "1":
print("InventoryCapacity = " .. tostring(getPlayer():getInventory():getCapacity()))
- If the automatic recovery does not trigger for any reason (After many test couldnt produce this bug), open the Lua Console and run this one-line fix:
getPlayer():getInventory():setCapacity(50)
Workshop ID: 3709948454
Mod ID: VehiclePartsAfterUninstallB42