Jump to content

Recommended Posts

Posted

I know there is no way to avoid having to deal with scripts bound to ActiveMagicEffects getting orphaned while still running. But is there a way to catch this situation from within the orphaned script itself? I tried testing for Self == None, but that doesn't seem do it.

 

The scripts getting orphaned in itself is not a problem. I'm basically simply looking for a way to prevent the error message from getting thrown into the log file and confusing the casual modders.

 

Anyone know how?

Posted
  On 4/25/2019 at 7:14 PM, Reneer said:

No, I don't think there is any way to prevent the errors from showing up in the Papyrus log.

Thanks, Reneer. I assumed as much, looking at all the otherwise well-made mods that generate lots of these messages.

  • 2 years later...
Posted (edited)

There seems to be a way after all. While you can't test Self == None, you can cast Self to a string and look for a sub-string '<None>', like so:

If StringUtil.Find(Self As String, "<None>") < 0 Then
; Code that would throw 'No object bound' error, if script is no longer attached
EndIf

At least this is how I currently deal with this issue.

Edited by onspey
  • Like 1
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...