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

14 comments

  1. just4slay3r
    just4slay3r
    • supporter
    • 0 kudos
    I have no idea if you will read this but I'm still getting the CTD in this exact issue.

    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
  2. Kalderus
    Kalderus
    • member
    • 0 kudos
    I've attempted to use the savegame fixer to no avail.  My recent saves for my current campaign all crash before the plugin can correct any stuck objects.

    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."
    1. qwertyasdfgh
      qwertyasdfgh
      • premium
      • 181 kudos
      That message has nothing to do with the crash, ignore it. 

      I'm a little confused when you say, that your saves crash - did you uninstall OBME.dll before using the plugin? 
    2. Kalderus
      Kalderus
      • member
      • 0 kudos
      No, the save is before installing the OBME, just the plugin.  Both OBME.dll itself and the savegame fixer esp (both separate) crash my recent save games.  Presumably the save game fixer is trying to "unstick" these magical effects from objects and failing leading to crashes
    3. qwertyasdfgh
      qwertyasdfgh
      • premium
      • 181 kudos
      Can you upload your save? 
    4. Kalderus
      Kalderus
      • member
      • 0 kudos
      I'm not sure if there's a way I should be uploading directly to Nexus, but I've uploaded here to a file sharing site:

      https://file.io/hvSMDXP6pE7l

      and the .obse file as well:

      https://file.io/hvSMDXP6pE7l
    5. qwertyasdfgh
      qwertyasdfgh
      • premium
      • 181 kudos
      On my setup your save loads with savegame fixer plugin, no crashes. However, it also didn't find any errors, which is probably because the stuck script effect in your save is from one of your other installed mods.
    6. Kalderus
      Kalderus
      • member
      • 0 kudos
      Thanks for trying.  My hunch is something associated with OOO.  A great mod for its time, but I likely won't use it again in future playthroughs and move to just using Maskar's alone.  If I recall correctly, OOO is very script heavy and obviously very outdated.
  3. asteriasennall
    asteriasennall
    • member
    • 54 kudos
    You're brilliant, Qwertyasdfgh!

    Thanks so much for finding the solution and going above and beyond to help people with corrupted save games!
  4. hobo1137
    hobo1137
    • member
    • 13 kudos
    *NVM Finally got though to my brain. Thanks for fixing this!
  5. MercerMeka
    MercerMeka
    • premium
    • 67 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
      • 181 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
      • 67 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
      • 181 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.