Jump to content

Deleted object sends it deletion to other objects thus they too delete, how? Any ideals will help.


Alpha Steamer
 Share

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

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

Recommended Posts

I  think I have all the parts to make this, just not sure if my head can handle the delays to make it work, so what's needed is the deleted object (Rezzer) has to be saying and communicating its key to the additional object it rezzed, so llSay(channel,llGetKey()) being on a timer?  This in the rezzer and in its rezzed prim a listener set to the channel of the rezzer and also on a timer checking to see the uuid is still current in message.  Like seeing ideals, I know I will sooner or later just thought since I've learn so much from this Post Messaging that I might just try and see if I can't try posting one.  Well was told "ping" may be good, just thinking need to really just learn to start building on how to begin making it, I think its should be simple....oh'no I'm getting lost in web searching again....lol

 

Link to comment
Share on other sites

You should take a little more time to say or ask what ypu want to say in a way that informs other people and not just confuses them
;)
.  Honestly, I don't understand what you want and where your problem is.

if, what I don't really belive it is, the following is your problem: 
"what's needed is the deleted object (Rezzer) has to be saying and communicating its key to the additional object", the simple answer is: an object, once it's deleted, can't communicate anything.
;)

 

Link to comment
Share on other sites

I'm with Darkie.  The question is more than a little confusing.  However, I get the idea that you want objects to disappear if the rezzer that created them also disappears.  Right?  You can do that either of two ways:

(1) The Rezzer knows that it is going to disappear, so it sends a pre-emptive message to everything that it has created, saying, "I am about to die, and you're going down with me."  The rezzed objects hear the message and commit suicide.

(2) The Rezzer dies unexpectedly, leaving orphaned objects that it rezzed.  It has left each of them with a message that says, "If you hear that I am dead, kill yourself."

Case #1 is easy.  The script in each rezzed object has a listener that is waiting for a message on a special channel. When the Rezzer sends the message, the receiving script executes llDie and poofs.

Case #2 is only a little harder.  You can use a "heartbeat" approach in which the rezzer sends a secret message every ten minutes or so. If the rezzed objects hear the message, everything is OK.  Otherwise, they poof.  Or you can use a "ping" method, in which the rezzed objects call the Rezzer and wait for a response (or just use a sensor). If they don't get a response, they poof.

Link to comment
Share on other sites

To avoid all unnecessary lag, the best solution is to use llGetObjectDetails() on a slow timer. No chat, no listener, no sensor, just one slow timer. llGetObjectDetails() will return ZERO_VECTOR as position for the rezzer once it has gone MIA.

The only problem is that a rezzed object has no direct way to get the key of its rezzer. So let's just make the rezzer give its key to the objects it rezzes by inserting the following blocks:

// This block goes at the very beginning of the script
integer VERY_NEGATIVE_CHANNEL = -123456789;
string PASSWORD = "Password";
//

            // Make sure the rezzer transmits a non-zero rez param!            // For example: llRezObject( blahblah... , 42);

// This block goes into the body of the script
object_rez(key id) { llSleep(1.0); // To make sure the rezzed object is ready. llRegionSayTo(id, VERY_NEGATIVE_CHANNEL, PASSWORD);
// The use of a "password" allows to use a filter on the listener.
}

And in the rezzed object:

// This block goes at the very beginning of the scriptinteger VERY_NEGATIVE_CHANNEL = -123456789;string PASSWORD = "Password";//integer Handle;key MasterKey;default{    on_rez(integer param)    {        if (param)        {            // Make sure the rezzer transmits a non-zero rez param!            // For example: llRezObject( blahblah... , 42);            Handle = llListen(VERY_NEGATIVE_CHANNEL, "", NULL_KEY, PASSWORD);        }        else        {            llResetScript(); // Object was dropped from inventory        }    }        listen(integer channel, string name, key id, string msg)    {        // Just for safety, check that the rezzer         // and the rezzee have the same owner.        if (llGetOwnerKey(id) == llGetOwner())        {            llListenRemove(Handle); // Close the now useless listener.            MasterKey = id;            llSetTimerEvent(60.0);         }    }        timer()    {        if (MasterKey) // is valid and != NULL_KEY        {            vector pos = llList2Vector(llGetObjectDetails(MasterKey, [OBJECT_POS]), 0);            if (pos == ZERO_VECTOR)            {                llOwnerSay("I must die now..."); // DEBUG                //llDie();            }        }    }    
// Blahblah...}

 Important: Create the script of the rezzed object in-world so that its state_entry() --even if missing-- runs at least once or else the on_rez() event will not fire.

That's all!

 

Link to comment
Share on other sites

Thank you Kaluura Boa, Rolig Loon, I'm going to think alittle on need for this, its not one I found by searching since its not possible to script using the Lindens delete from pie, other than as has been discussed, problem is having a listener or sensor active when most avoid this by just having the recipient do a in world pie deletion. I just needed to understand a way to do it, thinking now maybe to hold off on using on current project but know it can be used in that yet to come one. Thank you very much and too Kaluura for showing it in a way I can see.

Link to comment
Share on other sites

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

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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...