Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

What causes a script to reset ??

Henry Grumiaux
Registered User
Join date: 23 Jan 2007
Posts: 142
09-02-2007 18:40
I develop prefabs house...and each more I see my customers feedbacking me that the scripts of my houses restart almost everyday.

I've no idea what causes a restart.

Any tips ?
Jotheph Nemeth
Registered User
Join date: 9 Aug 2007
Posts: 142
09-02-2007 20:30
From: Henry Grumiaux
I develop prefabs house...and each more I see my customers feedbacking me that the scripts of my houses restart almost everyday.

I've no idea what causes a restart.

Any tips ?


llScriptReset() (or is it llResetScript?)

Make you sure you aren't using that at all.

Are you doing any state changes? I know state changes in scripts will break open listens. Might affect other things too.
Jesse Barnett
500,000 scoville units
Join date: 21 May 2006
Posts: 4,160
09-02-2007 20:30
If the owner has mod rights on the script then they can reset it. A Linden can reset a script. A region restart can reset a script. In this case it sounds like region restarts.

Get one of the owners to add you to thier group on a temp basis and set the "Allow Group Scripts" flag on thier property. You can cobble together a simple little script that will IM you in the state_entry. If you leave it on thier property it will send you a message whenever the region has been restarted.
_____________________
I (who is a she not a he) reserve the right to exercise selective comprehension of the OP's question at anytime.
From: someone
I am still around, just no longer here. See you across the aisle. Hope LL burns in hell for archiving this forum
Henry Grumiaux
Registered User
Join date: 23 Jan 2007
Posts: 142
09-02-2007 20:56
Well...Check this...

I made a experience...

2 houses...same models...

side..by side...In the same parcel..I made this test just for ensure that this is not about a region restart or simething like this...

sometimes one script reset itself...NoReason...

the script had a listener...
The listener stops to respond to the listener...

I've this code also...

touch_start(integer total_number)
{
if((llKey2Name(llGetOwner()) != TheOwner) && started ==TRUE)
{
llSay(0,"New Owner Detected.Tower is restarting...";);
llResetScript();
}

when i see the script stop to listen...and touch...the "New Owner Detected" warning fires because the value of TheOwner variable got null because the script sudelly stoped.
Henry Grumiaux
Registered User
Join date: 23 Jan 2007
Posts: 142
09-02-2007 20:58
From: Jotheph Nemeth

Are you doing any state changes? I know state changes in scripts will break open listens. Might affect other things too.



like what ???
Jesse Barnett
500,000 scoville units
Join date: 21 May 2006
Posts: 4,160
09-03-2007 06:15
From: Henry Grumiaux
I've this code also...

touch_start(integer total_number)
{
if((llKey2Name(llGetOwner()) != TheOwner) && started ==TRUE)
{
llSay(0,"New Owner Detected.Tower is restarting...";);
llResetScript();
}

when i see the script stop to listen...and touch...the "New Owner Detected" warning fires because the value of TheOwner variable got null because the script sudelly stoped.


I would replace that whole llKey2Name test with:
CODE

if (llDetectedOwner(0) != llGetOwner())
{
llSay(0,"New Owner Detected.Tower is restarting...");
llResetScript();
}
CODE
_____________________
I (who is a she not a he) reserve the right to exercise selective comprehension of the OP's question at anytime.
From: someone
I am still around, just no longer here. See you across the aisle. Hope LL burns in hell for archiving this forum
Jesse Barnett
500,000 scoville units
Join date: 21 May 2006
Posts: 4,160
09-03-2007 07:06
Why are you using a owner test in a touch event though? Configure the owner test correctly and put it in a rez event. People buy it from you they rez it on thier property and the script will reset and name them the owner. Is there a valid reason for wasting simulator resources by continually testing for something that should really only happen a few times during the life of your product?
_____________________
I (who is a she not a he) reserve the right to exercise selective comprehension of the OP's question at anytime.
From: someone
I am still around, just no longer here. See you across the aisle. Hope LL burns in hell for archiving this forum
RJ Source
Green Sky Labs
Join date: 10 Jan 2007
Posts: 272
09-03-2007 07:12
Yeah based on the code you've posted, as Jesse implied, there is a good chance the problem is here:

From: someone

if((llKey2Name(llGetOwner()) != TheOwner) && started ==TRUE)


From the llKey2Name wiki: "If the object or agent identified by the key 'id is in the same simulator as the object containing the script, this function returns their name."

So if the owner is not on the sim, it will return "", which probably won't match TheOwner.
Checho Masukami
UnRez it or use a hammer
Join date: 6 Oct 2006
Posts: 191
09-03-2007 08:00
From: RJ Source

From the llKey2Name wiki: "If the object or agent identified by the key 'id is in the same simulator as the object containing the script, this function returns their name."

So if the owner is not on the sim, it will return "", which probably won't match TheOwner.


I was juts about pointing the same. The problem IS there. That's also why the owners aparently are not even knowing of the reset. They are not there to read the ,"New Owner Detected.Tower is restarting..." message.
Jotheph Nemeth
Registered User
Join date: 9 Aug 2007
Posts: 142
09-03-2007 08:15
From: Henry Grumiaux
like what ???


Like global variables possibly.

How sure are you that the scripts are being reset? How do you know? Is it that the stored data is being cleared?
Kelley Arai
Registered User
Join date: 26 Aug 2007
Posts: 6
09-03-2007 13:43
He's having the script check if the toucher is the owner or not because he has a building with tenants, my friend and I are two of them. What's happening is that each apartments "Control Panel" (The small panel you click that's right of the door that brings up options for your apartment such as window tinting and door locking) will work for awhile, but eventually when you click it it will say "New owner detected, tower is resetting..." and the features of the apartment will cease to work because it seems it's thrown its knowledge of my and my friend's "ownership" of it out the window, and Henry has to do whatever he does to fix it.
Qie Niangao
Coin-operated
Join date: 24 May 2006
Posts: 7,138
09-03-2007 22:07
From: Jesse Barnett
A region restart can reset a script.
Gee... I don't think so. If that were the case, scripts would lose all state whenever the sim restarted, and I don't think that's ever happened to me.

Anyway, I agree that what is happening here is that the touch_start handler resets the script every time the thing is touched by anybody when the owner is not in the sim (or not in-world at all). Unless there are plans to resell this thing, that whole if clause can just go away; otherwise it could be replaced by a llResetScript() call in response to a CHANGED_OWNER event (assuming it's not doing anything too exotic with that "started" variable).

Now, there may be another problem, too, involving "The listener stops to respond to the listener...", whatever is going on there. Without seeing more code, it's pretty hopeless to guess how that's happening (and I'm not even clear on exactly *what* is happening), but my guess would be that it's nothing to do with any script resetting.