Jump to content

How do scripts just suddenly stop running?


You are about to reply to a thread that has been inactive for 1511 days.

Please take a moment to consider if this thread is worth bumping.

Recommended Posts

That usually means you got a script error, but were out of talk range when it happened. If you'd been close, you'd have seen a dialog pop up with the error.

For my own use, I have a script in another prim which listens on DEBUG_CHANNEL. If the object gets a script error, the listener in another prim receives it, and sends me an IM. So I can tell when my objects have problems, even when I'm not nearby. That is how I get my NPCs debugged; they phone home if there's a problem. This script has to be in a different prim than the one causing the problem, because prims can't listen to their own "say" messages.

Sort of like this:
 

default
{
    listen(integer channel, string name, key id, string message)
    {	if (channel != DEBUG_CHANNEL) { return; } // this is not a DEBUG_CHAN message
        if (llList2Key(llGetObjectDetails(id,[OBJECT_ROOT]),0)) !=
            llList2Key(llGetObjectDetails((llGetKey()),[OBJECT_ROOT]),0))
        { return; } // this message is not from our linkset.
        llInstantMessage(llGetOwner(), message);                    // send IM to owner
    }
}

 

Edited by animats
  • Like 1
  • Thanks 1
Link to comment
Share on other sites

1 hour ago, animats said:

That usually means you got a script error, but were out of talk range when it happened. If you'd been close, you'd have seen a dialog pop up with the error.

For my own use, I have a script in another prim which listens on DEBUG_CHANNEL. If the object gets a script error, the listener in another prim receives it, and sends me an IM. So I can tell when my objects have problems, even when I'm not nearby. That is how I get my NPCs debugged; they phone home if there's a problem. This script has to be in a different prim than the one causing the problem, because prims can't listen to their own "say" messages.

Sort of like this:
 


default
{
    listen(integer channel, string name, key id, string message)
    {	if (channel != DEBUG_CHANNEL) { return; } // this is not a DEBUG_CHAN message
        if (llList2Key(llGetObjectDetails(id,[OBJECT_ROOT]),0)) !=
            llList2Key(llGetObjectDetails((llGetKey()),[OBJECT_ROOT]),0))
        { return; } // this message is not from our linkset.
        llInstantMessage(llGetOwner(), message);                    // send IM to owner
    }
}

 

Thanks, So scripts can somehow just give themselves a script error?

Link to comment
Share on other sites

I doubt this is what's going on, but it's certainly possible for the sim to erroneously stop a script. Indeed, the current server release is supposed to fix at least one such bug:

Quote

Release Notes

  • A build of 2019-11-15T21:13:13.532828 using new build technology.
  • Addresses some cases of scripts erroneously stopping.
  • Fixes a crash.

Resolved Issues

  • BUG-227671 Scripts stop working for physical objects in certain conditions

I don't know for sure that the first line I highlighted is the same bug as the latter one, limited to physical objects, but I suspect so, in which case it's probably not what you're seeing.

In recent months there have been some weird, very rare problems with the way sims handle running scripts. A couple of us attending the Server User Group have noted incidents where a running script has mysteriously reset, perhaps coincident with a server restart. (In my case, it was an ancient, trivial script with nothing but a simple state_entry() handler that should only run once, but unexpectedly ran a second time.)

(Of course it's also perfectly normal for scripts to stop other scripts using llSetScriptState(), a function that must be called by a script in the same prim as the script(s) it affects.)

  • Thanks 1
Link to comment
Share on other sites

You are about to reply to a thread that has been inactive for 1511 days.

Please take a moment to consider if this thread is worth bumping.

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
 Share

×
×
  • Create New...