Skyrim Special Edition
0 of 0

File information

Last updated

Original upload

Created by

wankingSkeever

Uploaded by

wSkeever

Virus scan

Safe to use

Tags for this mod

About this mod

Fixes a rare crash when saving due to wideadbodycleanupscript

Requirements
Permissions and credits
Changelogs
Donations
Description
This fix is somewhat theoretical. The change won't cause any harm, but I make no guarantees about it fixing your game.

WIDeadBodyCleanUpScript is a script that cleans up dead bodies of persistent NPCs. This script will also sometimes move their inventory to a coffin container. For reasons unknown to me, sometimes this will create a corrupt inventory record during the NPC to coffin transfer. This is observed to happen for items equipped on the NPC via script. This will cause the game to crash when saving the game, as the game is unable to save the corrupt inventory record in the coffin.

People have reported this happening with items wet & cold equips on NPCs. I've seen multiple instances of this happening with Ancano.

This mod alters WIDeadBodyCleanUpScript so it unequips all items on the NPC using the unequipall console command before transfering their items:
function cleanUpBody()
; debug.trace("WIDeadBodyCleanupScript" + self + "cleanUpBody() moving to WIDeadBodyCleanupCellMarker in WIDeadBodyCleanupCell and Calling RemoveAllItems() to DeathContainer, and enabling it:" + DeathContainer)

;Disable()
;*** It has been decided it's safer to move them to a holding cell, for quests that might be filling allowing for dead actors but not allowing checking for disabled actors

MoveTo(WI.WIDeadBodyCleanupCellMarker)

DeathContainer.SetActorOwner(GetActorBase())
DeathContainer.Enable()

ConsoleUtil.SetSelectedReference(self)
ConsoleUtil.ExecuteCommand("unequipall")

RemoveAllItems(DeathContainer)

EndFunction
Requirements
  • ConsoleUtilSSE NG. If, in the future, this gets replaced by a more updated version due to Skyrim update and I am not here to update these requirements, use your brain and find the update yourself.
Installation
If an NPC is already dead, their WIDeadBodyCleanUpScript is already running. If you think this will cause a crash, installing this fix won't prevent it, as that script instance is already baked into your save.

If you want to prevent a crash for an already dead NPC:
  • Select them in console either by clicking on them or by using the prid <reference id> command.
  • Unequip their entire inventory using the unequipall command.
FAQ
Q: file conflict with Equippable Underwear for NPCs?
A: I've already included the same fix in Equippable Underwear for NPCs. Make sure your files are up-to-date.

Q: Why do I need ConsoleUtilSSE NG?
A: Only the console version of unequipall is confirmed to work
Credits
  • Unofficial Skyrim Special Edition Patch (script edit based on script for USSEP)
    • Arthmoor
    • Unofficial Skyrim Special Edition Patch team
    • Please see Unofficial Skyrim Special Edition Patch readme in the download. This list is rather extensive and ever changing.