Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Deleting an object by a script in another object

Stone Juran
Registered User
Join date: 21 Mar 2007
Posts: 28
05-01-2007 13:55
Hello,

I have an object which rezzes another object. It works, but now I would like to delete it from the "rezzer" object.

I found the llDie function but i don't know how to use it the way i want.

Can you help me?

Thank you

Stone
Jacques Groshomme
Registered User
Join date: 16 Mar 2005
Posts: 355
05-01-2007 14:12
Couldn't you just make the rezzed object No Copy?
Talarus Luan
Ancient Archaean Dragon
Join date: 18 Mar 2006
Posts: 4,831
05-01-2007 14:13
You are looking for llRemoveInventory.
Jacques Groshomme
Registered User
Join date: 16 Mar 2005
Posts: 355
05-01-2007 14:13
Or you could have the rezzed object "phone home" to the rezzer and have a script there call llRemoveInventory().
Sys Slade
Registered User
Join date: 15 Feb 2007
Posts: 626
05-01-2007 16:37
If you mean that you would like to have the rezzer able to delete the rezzed object, it could be as simple as having the rezzer say something on a specific channel, and calling llDie in the rezzed object when that command is given.

CODE

integer channel=8910; //channel to listen on

default{
state_entry(){
llListen(channel, "", NULL_KEY, "");
}

listen(integer chan, string name, key id, string msg){
if(chan==channel && msg=="die")
llDie();
}
}

in the rezzed object, and the following in the rezzer:
CODE

llSay(8910,"die");

where 8910 is your channel number.
Ina Centaur
IC
Join date: 31 Oct 2006
Posts: 202
05-01-2007 19:04
that could potentially be dangerous.

you should always set up some sort of authentication scheme if deleting on channels.
Stone Juran
Registered User
Join date: 21 Mar 2007
Posts: 28
05-01-2007 22:11
I like your idea Sys Slade


is it possible in the rezzed object to get the key of the rezzer object when rezzing so that it can only allow the rezzer object to delete it?


CODE

integer channel=8910; //channel to listen on
key rezzer_object_id;

default{
state_entry(){
llListen(channel, "", NULL_KEY, "");
}

listen(integer chan, string name, key id, string msg){
if(chan==channel && msg=="die" && id==rezzer_object_id)
llDie();
}
}
Newgate Ludd
Out of Chesse Error
Join date: 8 Apr 2005
Posts: 2,103
05-01-2007 23:45
From: Stone Juran
I like your idea Sys Slade


is it possible in the rezzed object to get the key of the rezzer object when rezzing so that it can only allow the rezzer object to delete it?


CODE

integer channel=8910; //channel to listen on
key rezzer_object_id;

default{
state_entry(){
llListen(channel, "", NULL_KEY, "");
}

listen(integer chan, string name, key id, string msg){
if(chan==channel && msg=="die" && id==rezzer_object_id)
llDie();
}
}


You set it up to listen only to the rezzer, i.e.
Rez the with a (preferably random) channel number and then in the rezzee immediately start a listen.
The rezzer then 'talks' on that channel sending the key of the object that was rezzed as authentication.
The rezzee then clears its current listen and starts a new one just for the key of the rezzer which it obtained when the rezzer first authenticated itself.