Jump to content

How to deleted a rezzed object from another one using his UUID ?


chrixbed
 Share

You are about to reply to a thread that has been inactive for 1284 days.

Please take a moment to consider if this thread is worth bumping.

Recommended Posts

I want to rez and "Object B" from a rezzer "Object A" and remove it after. I have the right to copy/delete and rez the "ObjectB" but not to modify it. Basically, I want to be able to rez a purchase objects on my land and be able to remove them from one single rezzer. How can I do this ?

Note: I know that I can use llDie() into the rezzed object but I would like to do it from outside.

Here is the code I try to use in the Object A (the rezzer):

string object = "Object B";//Object in inventory with right to copy/transfert but not to modify
integer start_param = 10;
rotation rot;
key Object_UUID; // key that store the UUID of the Rez object to use to delete it after

DeleteObject(){
// This is the function I try to build which can be similar of llDie(); but outside of the rezzed object.
// I can use the UUID of the Object from Object_UUID
}
default
{
    state_entry()
    {
        rot = llEuler2Rot(< 0, 90, 90> * DEG_TO_RAD);
    }
    touch_start(integer a)
    {
        vector vec = llGetPos() + < 0.0, 0.0, 5.0>; // 5 meter above this
        vector speed = llGetVel();
        if (on=!on) llRezAtRoot(object, vec, speed, rot, start_param);
        else DeleteObject();
    }
    object_rez(key id)
    {
        Object_UUID = id;
    }

}

 

Link to comment
Share on other sites

You'll have to send Object B a message of some kind from Object A, telling it to die.  The llDie() function has to be in Object B.   You can easily grab the UUID of Object B as it rezzes, using an object_rez event, as you have.  Then have Object A send its kill message to Object B with

llRegionSayTo(UUID_of_Object_B, "Die, sucker!");

Link to comment
Share on other sites

9 minutes ago, Rolig Loon said:

You'll have to send Object B a message of some kind from Object A, telling it to die.  The llDie() function has to be in Object B.   You can easily grab the UUID of Object B as it rezzes, using an object_rez event, as you have.  Then have Object A send its kill message to Object B with

llRegionSayTo(UUID_of_Object_B, "Die, sucker!");

If I can't modify the rezzed object i.e. I can't add a listen() with a llDie() script in it.

What are my options; delete it manually only ?

Link to comment
Share on other sites

35 minutes ago, Rolig Loon said:

Yup.  Unless it's on land that you own, in which case I suppose you could return it by using llReturnObjectsByID

Ok I just try llRetunObjectsByID(), I do own the land but is not working, anything I'm missing ?

//Rez an object on touch
string object = "ObjectB";//Object in inventory
integer start_param = 10;
rotation rot;
list objects; // requierd to store UUID of the object to Delete/Return
default
{
    state_entry()
    {
        rot = llEuler2Rot(< 0, 90, 90> * DEG_TO_RAD);

    }
    touch_start(integer a)
    {
        vector vec = llGetPos() + < 0.0, 0.0, 5.0>;
        vector speed = llGetVel();
        llRezAtRoot(object, vec, speed, rot, start_param);
        llSleep(5);
        llOwnerSay("Return Object now");
        llRequestPermissions(llGetOwner(), PERMISSION_RETURN_OBJECTS);
    }
    run_time_permissions(integer perm)
    {
        if(PERMISSION_RETURN_OBJECTS & perm)
        {
            integer testerror;
            testerror = llReturnObjectsByID(objects); // Delete the Object
            objects = [];
            llOwnerSay("error: " + (string) testerror); // return 0, so must be fine.
        }
    }


    object_rez(key id)
    {
      llOwnerSay("Get Object UUID:" + (string) id);
      objects = [id];
    }

}

 

Link to comment
Share on other sites

"As a security measure, parcel owner, estate owner, and estate managers can not have their objects returned by this method, except when the object returns itself. "

I"m thinking that since you own the object being returned you cannot use this method to return it.  So going back to your original question, I'm not sure if there is a good solution.

Edited by Anna Salyx
changed "deleted" to "returned"
  • Like 1
Link to comment
Share on other sites

46 minutes ago, Anna Salyx said:

I"m thinking that since you own the object being returned you cannot use this method to return it.  So going back to your original question, I'm not sure if there is a good solution.

Well I guess the only option is to delete it manually. 

Thanks Anna !

Link to comment
Share on other sites

You are about to reply to a thread that has been inactive for 1284 days.

Please take a moment to consider if this thread is worth bumping.

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
 Share

×
×
  • Create New...