This article is the summary of my findings on savegame CTD when using OBME, why it happens and how to prevent it. Thanks to asteriasennall for reporting the specific spell that caused the issue, which started my investigation.
There seems to be an underlying bug in the game (not in OBME itself), which triggers at the following conditions:
- A spell is cast on non-actor interactable target (this includes activators, doors, containers, furniture);
- This spell contains a scripted magic effect (SEFF), with the duration greater than 1 second. The contents of actual magic effect script are irrelevant, it could even be empty (unless it contains a specific check to prevent it, more on that later).
The easy way to reproduce this is to take vanilla item Skull of Corruption (has scripted effect with 30 seconds duration) and cast it on a container/door/activator. Bam, any save made after that point won't load with OBME (regardless of whether or not OBME was present initially).
Av Latta Magicka
There were 2 potential ways I could've fixed this:
1. Prevent such problematic script effects from being applied at all. This would fix the bug 100%, but also adds the risk of silently breaking scripted spells from other mods.
2. Remove such stuck effects after they're already applied. This would still work probably in 99% cases, and is more compatible.
I have opted for option 2, so Av Latta Magicka version 1.14+ now has built-in prevention for this issue. It will detect problematic script effects and remove them about 2 seconds afterwards. Now, it is still possible to make a bugged save during this brief period of time, but the risk is much much lower.
I also want to point out, that this update won't fix savegames that are already affected, it will simply prevent the bug from happening.
OBME Savegame Fixer
Available from Miscellaneous download section, this is utility plugin I created to fix savegames already affected by aforementioned bug. It automatically scans the objects which can have stuck effect and removes it.
The way to use it is to just load your bugged save (without OBME, as it will crash otherwise) and wait for the plugin to do it's thing - there will be console print if it finds any bugged objects.
Version 2.0 of Savegame Fixer will scan all loaded references and teleport the player if any have stuck magic effect. Once it's finished, make a new save and disable the plugin. Do not keep it active constantly.
You don't need this if your save is already working.
For Modders: How to make your scripted effect safe
If you use any scripted spells in your mod(s), I highly recommend adding the following safeguard to prevent your spell from accidentally triggering this bug:
short index
begin ScriptEffectStart
set index to GetScriptActiveEffectIndex
if IsActor == 0
DispelNthActiveEffect index
return
endif
end
(keep in mind that this code requires OBSE)
14 comments
Every time I have loaded up the game and saved (with OBME), CTD
Every time I have loaded up the game and saved (without OBME), no CTD
I tried your fix, it crashed to desktop when I tried to even load the game and save.
I'm going insane here and I would like to use your mod but I'm genuinely struggling here.
Here's my modlist btw:
https://pastebin.com/DZPsMgBK
atm your mod is disabled, since I'm testing the CTDs and how to solve it.
But I could REALLY use your help here mate
Message logger output this error message right before crashing:
"[0050A2C4] [WARNING] Disable is being called on reference 0302F30B BANICDMarker in script 03081AA7 BANGameLoadedScript even though it has an enable state parent. This is not valid behavior and will be ignored."
I'm a little confused when you say, that your saves crash - did you uninstall OBME.dll before using the plugin?
https://file.io/hvSMDXP6pE7l
and the .obse file as well:
https://file.io/hvSMDXP6pE7l
Thanks so much for finding the solution and going above and beyond to help people with corrupted save games!
Another OBME bug that ruined a character is this one:
If you edit any mod with OBME installed, which has any entries with magic effects (spells, potions, ingredients), then extra data is saved into the savegame which brakes the bashed patch. (Some items from LL won't get bashed into other LLs)
Wrye Bash 307+ fully supports OBME file structure.
I tried saving without OBME back then but it didn't work. I couldn't even delete it with Tes4edit. I had to re-create the mods which had the extra data added.