Jump to content

Strange Script Behaviour


Wandering Soulstar
 Share

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

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

Recommended Posts

Hi All,

Another strange one that perhaps someone has come across or can explain. Let me set the scenario and then what is happening:

I have a set of scripts I use when building, there are a total of three, plus a control script, in each prim while I build. These are controlled via a HUD that I built, at its simplest just telling the prims which script should be active. I have been using this to build for a number of years now, and while not bullet proof for sales on the market place, it does the job and has been very stable.

Came in-world just a bit ago and was back to a large house build I am working on for the first time in a couple week. Went to the last section I was working on and set to work. When I set to have a particular worker script enabled, I got flooded with error messages that the script was missing, yet on inspection could see that the script was there, what is more my code checks to see if the file is there before trying to enable it through an Inventory check. I confirmed this by resetting the control script in one prim, this automatically on start call to set every script in inventory to not running with the following code:


set_scripts(integer active)
{
    //Stop any running scripts
    integer num = llGetInventoryNumber(INVENTORY_SCRIPT);
    string name;
    integer x;
    string myName = llGetScriptName();

    for (x = 0; x < num; x++)
    {
        //If it is not me turn it off
        name = llGetInventoryName(INVENTORY_SCRIPT, x);
        if (name != myName)
        {
            llSetScriptState(name, active);
        }
    }
}

.. and .. yes you guessed it .. debug/errors for each script name (that was read from Inventory) saying that it was not found. I have found some work arounds to fix, but considering the size of my build these are not really helpful, unless there is no other way:

  1. Edit the script, set to running, non-mod the code so that the save button is enabled, save, and will work fine from then on
  2. Take into inventory and re-rez, again works fine from then on

The first is untenable with some 750 prims atm and two scripts per, I'd be at it for the next two weeks. The second difficult as well. The build is not linked, and still in work. Would easily miss prims here or there and would have a mess to get it back in place. So my hope is that this sounds familiar to someone and they have a magical answer for me ... Please?

 

Thanks in advance!

Wanda

Link to comment
Share on other sites

The first thing you tried is called recompiling. (Saving the script compiles it.)

What you can do to do the same to all unlinked objects is select them all (I know, same problem as with taking into inventory), and going to Build > Scripts > Recompile (MONO)

That will do the process for you for all scripts in each selected prim. 

Link to comment
Share on other sites

1 hour ago, Wandering Soulstar said:

Still be nice to know why this suddenly happened.

I'm occasionally left with the same question.  I don't often need to change script state, so I don't run into your particular problem, but I do find that some scripts mysteriously stop responding "correctly"  -- whatever "correctly" is.  They don't respond properly to a collision, or they don't detect someone who is clearly in range, or whatever.  Resetting the errant script almost always fixes it, but that leaves me wondering why it screwed up in the first place.  The convenient answer is that the servers have been having a migraine, but that's like a medieval doctor saying that I have a demon -- it's not a real answer.  I don't like adding a utility script that simply restarts all other scripts once a day, because that's only curing a symptom rather than dealing with the underlying issue.  Still, sometimes that's all I can do.  Fortunately, most scripts behave most of the time.

  • Like 1
Link to comment
Share on other sites

And to make matters worse, there is no way I can code against this happening. The fix provided by Wulfie, re-compiling, cannot be done from within. To be able to reset another script, using llResetOtherScript, the other script needs to be running. In ant case I'd imagine that the same problem would occur, i.e. while the inventory tells me the script is there, the system does not recognise it as a script.

Link to comment
Share on other sites

You are about to reply to a thread that has been inactive for 2040 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...