Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Delete all objects rezzed from an object.

Shammy Smashcan
Registered User
Join date: 14 Oct 2006
Posts: 6
09-11-2007 15:38
Hi,

I wanted to know if there is a quick way to delete all primitives that are rezzed from the inventory of a primitive. I am concerned with keeping the execution time of scripts to a minimum to reduce lag for my build. I thought about setting temp_on_rez for the rezzed objects but I want the objects to last for > 60 seconds before they are deleted. Currently I use a timer in each object, but this is not a good solution and I imagine it is computationally intensive. Ideally I would like the rezzed objects to contain nothing but a particle emitter function. Anyways, my question is, is there an elegant method that can be used from the object the rezzes the "child" objects to delete every prim that was rezzed?

A also wanted to know if there is a place that describes how many cycles each method uses, so that I can determine the best code to use when I am optimizing my scripts.
Altern8 McMillan
Registered User
Join date: 27 Mar 2007
Posts: 36
09-11-2007 18:28
what's about a listener? call the rezzed prims and they can perform an llDie

greetz

a8
Shammy Smashcan
Registered User
Join date: 14 Oct 2006
Posts: 6
09-11-2007 19:20
From: Altern8 McMillan
what's about a listener? call the rezzed prims and they can perform an llDie

greetz

a8


It's a good idea, but there are hundreds of these rezed prims. If each one has a listener, it will cause a ton of lag :). At the moment I just use a timer and llDie() but it would be better to just be able to delete them from a parent script.
Auron Reardon
Registered User
Join date: 30 Jun 2006
Posts: 41
09-11-2007 20:56
Aside from temp on rez, the object either needs to decide for itself when to die using a timer like you are doing now or it needs to be told when to die via a chat listen.

Within reason, the only other communication option you have for non-linked objects is email but that would compound the issue in that you would be using a timer to poll for messages.

Given what you are doing the choice between timer and chat is whether or not you want the ability to kill them on demand. If you want to click something and have them all die, they are all going to have to have listens. If you want to avoid the listeners, use the timer.
Auron Reardon
Registered User
Join date: 30 Jun 2006
Posts: 41
09-11-2007 20:58
More to the point of your question, there is no event for "message from the object that created me". Nor is there a function "message to the object I created".
Shammy Smashcan
Registered User
Join date: 14 Oct 2006
Posts: 6
09-11-2007 22:35
From: Auron Reardon
More to the point of your question, there is no event for "message from the object that created me". Nor is there a function "message to the object I created".


Thanks Auron.
Jezbella Maidstone
Registered User
Join date: 9 Nov 2006
Posts: 54
09-12-2007 18:47
If the objects you rez are linked, you could put a single listener in the root prim that was rezzed, and when it received the DIE command from the intital rezzing object, the primary linked prim could broadcast a linkmsg to all the child prims telling them to die.

Jez
Jotheph Nemeth
Registered User
Join date: 9 Aug 2007
Posts: 142
09-12-2007 22:45
From: Jezbella Maidstone
If the objects you rez are linked, you could put a single listener in the root prim that was rezzed, and when it received the DIE command from the intital rezzing object, the primary linked prim could broadcast a linkmsg to all the child prims telling them to die.

Jez


a child prim can't die on it's own like that. It would have to delink itself first.

At least, as far as I know the llDie() function only works on the entire object.
Auron Reardon
Registered User
Join date: 30 Jun 2006
Posts: 41
09-13-2007 06:39
>>At least, as far as I know the llDie() function only works on the entire object.>>

Correct.

Jezbella's suggestion is right in that if all the objects needed to die are linked, then you would only need one listener (the one listener being in one of the objects to die). However, there is no need for the one object to send a linked message to the other objects. All it needs to do is die and all the other linked objects will die with it.
Lee Ponzu
What Would Steve Do?
Join date: 28 Jun 2006
Posts: 1,770
09-13-2007 08:08
From: Shammy Smashcan
It's a good idea, but there are hundreds of these rezed prims. If each one has a listener, it will cause a ton of lag :). At the moment I just use a timer and llDie() but it would be better to just be able to delete them from a parent script.

No, they would listen on a moer or less unique channel, and never get any events. Lag would not be a problem, most likely.

Remember, it is easier to make a working system powerful than it is to make a powerful system work.