Oblivion

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.

The Cause


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).
When the above happens, this scripted effect will never "end" and becomes stuck on non-actor object. The script itself executes for 2 frames only and then halts. Vanilla game seems to just ignore this, but when OBME.dll is present, any save with such stuck effects on objects will CTD on load.
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).


The Solution

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)

Article information

Added on

Edited on

Written by

qwertyasdfgh

6 comments

  1. asteriasennall
    asteriasennall
    • member
    • 51 kudos
    You're brilliant, Qwertyasdfgh!

    Thanks so much for finding the solution and going above and beyond to help people with corrupted save games!
  2. hobo1137
    hobo1137
    • member
    • 13 kudos
    *NVM Finally got though to my brain. Thanks for fixing this!
  3. MercerMeka
    MercerMeka
    • premium
    • 61 kudos
    Thanks for researching this. I had lost a character due to an unknown OBME bug and I wonder if this was the cause.

    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)
    1. qwertyasdfgh
      qwertyasdfgh
      • premium
      • 154 kudos
      This extra data is not added to savegame, but to esp/esm file. You can revert this by saving the plugin without OBME_CS.dll (assuming you don't need any OBME-specific features).

      Wrye Bash 307+ fully supports OBME file structure.
    2. MercerMeka
      MercerMeka
      • premium
      • 61 kudos
      Oh maybe I remember incorrectly then. It's a while back now. I thought the extra data was saved to the extra save files created when using OBME.
      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.
    3. qwertyasdfgh
      qwertyasdfgh
      • premium
      • 154 kudos
      TES4Edit is not the way to go when working with OBME plugins, use CSE instead. It will re-save your plugin properly, I've done this many times.