|
Moon Corrigible
Registered User
Join date: 19 Jan 2007
Posts: 75
|
05-17-2009 12:29
I'm being a melon-head.
When you want a script to do something (in my case say "I'm outta here." on a predetermined channel) if it gets deleted or taken back into inventory where the heck do you put that command line? State_exit doesnt work I know because you aren't changing states. I just can not for the life of me remember where to put this command!
Thanks in advance!!!
|
|
Hewee Zetkin
Registered User
Join date: 20 Jul 2006
Posts: 2,702
|
05-17-2009 12:35
You can't. Scripts are not notified in any way when the object is about to be deleted or taken. You can put a limited amount of non-essential logic in an attachment for when it is detached, but you have no immediate way of knowing whether it is being detached back to inventory or dropped in-world by use of the pie menu (you can take steps to try to analyze which happened after the fact, but nothing distinguishes the two scenarios at the time).
The best you can do is have the script itself do something and then detach/die. It knows it is about to go away because it is the script itself that is going to take action.
|
|
Moon Corrigible
Registered User
Join date: 19 Jan 2007
Posts: 75
|
05-17-2009 12:39
Thanks Hewee! I thought I was going insane there! Its actually not attached just rezzed from the main chair and I was hoping to be able to have the chair keep track of whether or not the owner had killed the pillow manually instead of going through the menu - but its all good. Thank you!!!
|
|
Hewee Zetkin
Registered User
Join date: 20 Jul 2006
Posts: 2,702
|
05-17-2009 12:56
From: Moon Corrigible Thanks Hewee! I thought I was going insane there! Its actually not attached just rezzed from the main chair and I was hoping to be able to have the chair keep track of whether or not the owner had killed the pillow manually instead of going through the menu - but its all good. Thank you!!! Hmm. Well, there are probably ways of dealing with that. Have the chair check on the pillow with llGetObjectDetails() in a timer. If the pillow is killed through the menu it can inform the chair that it is going away. If it is killed manually the chair won't get the pillow's message but simply won't find the pillow (llGetObjectDetails() on its key will return an empty list). There's no way for the pillow itself to know it is being deleted manually, but that doesn't mean you can't deal with the situation in other ways. 
|