dafydd99 Posted November 9, 2020 Share Posted November 9, 2020 Simple one, this! Is there a way to clear out registered updates on an object in a save file that has been lost (presumably from a mod being enabled/disabled)? If a script calls 'RegisterForUpdate' it will get a regular update until it unregisters. But once the object is lost it seems impossible to unregister. My papyrus logs often gets full of these... [11/09/2020 - 08:20:50PM] error: Unable to call UnregisterForUpdateGameTime - no native object bound to the script object, or object is of incorrect type stack: [None].TheSidratAlvardsTroveChestScript.UnregisterForUpdateGameTime() - "<native>" Line ? [None].TheSidratAlvardsTroveChestScript.OnUpdateGameTime() - "TheSidratAlvardsTroveChestScript.psc" Line 28 Thanks in advance for any help. Cheers - dafydd99 Link to comment Share on other sites More sharing options...
maxarturo Posted November 10, 2020 Share Posted November 10, 2020 Try using a 'Clean Save' tool, but in this particular circumstance is not 100% bulletproof, only by doing a manual removal of that orphan script you can be sure, don't ask me how to do it cause i cannot explain it in a written post. My suggestion is to delete all your save files and start a new game. Link to comment Share on other sites More sharing options...
dafydd99 Posted November 10, 2020 Author Share Posted November 10, 2020 Thanks for help, Maxarturo. Yeah this is more from a mod author's point of view, rather than a single save. I'd like to be able to remove any of these that might exist for any players programmatically - but it seems unlikely that's possible. I doubt bethesda thought 'orphaned' scripts were a priority to fix when they made papyrus. Irritating! In future I'll write things to be a 'registerForSingleUpdate' and renew if all is well rather than a 'registerForUpdate' which could fall into a failed loop. Link to comment Share on other sites More sharing options...
dylbill Posted November 10, 2020 Share Posted November 10, 2020 Yes, using a single update loop as you described is the way to go. You can also do a check. If Self.IsDeleted() then don't register for another update. Link to comment Share on other sites More sharing options...
maxarturo Posted November 10, 2020 Share Posted November 10, 2020 @ dylbill All 'Register' functions and their 'Unregister' must be called by the same object that called it, or by a script that shares / uses the same 'Function' on the script that called the 'Register'. Link to comment Share on other sites More sharing options...
Recommended Posts