|
Debby Amsterdam
Registered User
Join date: 23 Nov 2006
Posts: 10
|
01-08-2008 12:13
Hello everyone!
In my script I must know when the object is rezzed, no problem with that, I will use the on_rez event, but I need to know also when the object is taken to inventory or deleted. Is there an event like "unrezzed"? How my script can detect when the object is taken out?
Thanks for any help!!!
|
|
Wildefire Walcott
Heartbreaking
Join date: 8 Nov 2005
Posts: 2,156
|
01-08-2008 12:57
Unlike attachments, which fire the attach event when either attached or detached, objects rezzed in-world do not indicate when they're being taken/deleted.
If you need to keep track of this, the object that rezzes other objects should use some kind of polling or sensing and maintin its own list of active objects.
|
|
Hewee Zetkin
Registered User
Join date: 20 Jul 2006
Posts: 2,702
|
01-08-2008 13:01
No. You cannot be notified of these events. If the object is attached, you can be notified when it is detached via the 'attach' event handler. You could also have the object decide to delete itself with llDie(). If that is acceptable for the application then you can perform some actions before it does this. If you have to know when the object is taken into inventory or deleted manually by a resident, though, you are out of luck. The best you might be able to come up with is another object that regularly scans for or communicates with the given object. When the ping fails, assume the object in question has been taken/deleted. EDIT: Oops. IOW what Wildefire said, but with slower typing. 
|
|
Void Singer
Int vSelf = Sing(void);
Join date: 24 Sep 2005
Posts: 6,973
|
01-08-2008 17:14
the closest you'll get is to have a timer that repeatedly saves the time to a variable, in the onrez event you can check the current time vs the last time saved, if they are greater than say 2 to 3 times your timer interval, then it was probably derezzed (or the sim went down, or had supper long lasting lag)... that'd mean processing all your derezz stuff in the onrez event... before moving onto the normal on rez stuff.... and the timer could be laggy
_____________________
| | . "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... | - 
|