Cypher Ragu
[Mad Scientist]
Join date: 6 Jul 2008
Posts: 174
|
08-22-2009 22:45
Some of my products contain scripts that check to make sure that the main script is running when the object is rezzed.
I've occasionally seen errors saying that the main script couldn't be found...
I suspect this is simply because of lag, right? Or is there some weird bug that I'm not aware of?
_____________________
Life is a highway... And I just missed my exit.
|
Domchi Underwood
Registered User
Join date: 4 Aug 2007
Posts: 44
|
08-23-2009 06:48
There is no guarantee that all of your object's inventory will be loaded at the same time after rezz. Especially if there are many items in object's inventory, it gets loaded in batches, which you can seee in changed event when it fires repeatedly. Give it some time before checking it.
|
Talarus Luan
Ancient Archaean Dragon
Join date: 18 Mar 2006
Posts: 4,831
|
08-23-2009 11:12
I think that particular problem has more to do with the viewer than with the server, though. As far as the server goes, when it loads an object from the asset server, it should have loaded it all before scripts start/resume executing.
As for the OP's problem, it sounds like it is intermittently failing to see another running script in an already rezzed object.
What mechanism are you using to detect the main script?
|
Cypher Ragu
[Mad Scientist]
Join date: 6 Jul 2008
Posts: 174
|
08-23-2009 11:16
I use llGetScriptState and llSetScriptState.
I already have a small delay coded in (about half a second), but I suppose I could increase it.
_____________________
Life is a highway... And I just missed my exit.
|
Void Singer
Int vSelf = Sing(void);
Join date: 24 Sep 2005
Posts: 6,973
|
08-23-2009 14:47
Im going to throw out a scenario, that may be off the mark, but is very likely
main scrip has multiple states,and one of those states does NOT have a message handler, sub script sends a message to the main script in the on_rez event, but gets no response (because the main hasn't yet entered a state where it can recieve the message...
am I getting warm?
_____________________
| | . "Cat-Like Typing Detected" | . This post may contain errors in logic, spelling, and | . grammar known to the SL populace to cause confusion | | - Please Use PHP tags when posting scripts/code, Thanks. | - Can't See PHP or URL Tags Correctly? Check Out This Link... | - 
|
Cypher Ragu
[Mad Scientist]
Join date: 6 Jul 2008
Posts: 174
|
08-23-2009 20:55
Nope, the main script only has one state.
_____________________
Life is a highway... And I just missed my exit.
|
Darien Caldwell
Registered User
Join date: 12 Oct 2006
Posts: 3,127
|
08-24-2009 08:45
Sometimes it takes time for the contents of an object to load, especially right after rez. I would wait a second or two before doing that check.
|