Hamaar Tyne
Registered User
Join date: 17 Jun 2005
Posts: 23
|
06-24-2005 09:29
I guess the title says it all. If I create a script that opens a listen in state_entry() and calls reset script on rez, will that clean up everything, or will it leave listens sitting around? Idealy I want it to say attach something and have it reset each time listening on the channel to start. I guess really its more for a clarification on what happens on reset, does everything get cleaned up that it started. If I had a script that over a period of time opened 25 sensors during its run time in an object that sat on land somewhere, and called a reset on it, would it go back to its original state, and clean up everything that it had opened? I guess really, do you have to do any garbage collection on reset is my question  Hamaar
|
Barbarra Blair
Short Person
Join date: 18 Apr 2004
Posts: 588
|
06-24-2005 09:37
In theory resetting the script removes the Listen, but why would you want to do it that way? Just script in the ListenRemove where it belongs, and avoid the danger of "too many Listens".
_____________________
--Obvious Lady
|
Lex Neva
wears dorky glasses
Join date: 27 Nov 2004
Posts: 1,361
|
06-24-2005 09:39
On resetting a script, you start fresh with a clean slate. All listeners, sensor-repeats, timers, global variables, the state you're in, everything is reset. Just a note, running llSensor() is a one-time thing and doesn't need to be cleaned up. Running llSensorRepeat() does, however. Everything is cleaned when you switch states, as well, although I understand there might be a bug and llSetTimerEvent() callbacks might not actually be removed between state changes.
|
Hamaar Tyne
Registered User
Join date: 17 Jun 2005
Posts: 23
|
06-24-2005 10:43
Thanks for answering, that is what I wanted. In terms of techinque I wasn't doing anything I was just "theorizing" so to speak. I like the idea of a script resetting on res so it starts out the same time everytime and not sitting in another state or something. Its just the way I think and I'm sure eventually I'll have to bend my programing mentality around the way second life works  But again thank you both for answering my question.
|