Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Object Die help...

AppleBottom Sugarplum
Registered User
Join date: 14 Dec 2008
Posts: 2
04-06-2009 17:47
I currently have a rezzer....works perfect as it is. I click on the rezzer and it then displays a menu for me to choose which object I would like rezzed. When I want to clear away the object I click the rezzer again...it then gives me the clear option.
Now what I would like is also when there are no avis within say 20m for the object to die.
I have a script but something must be wrong with it because it does not work lol...
anyone have any ideas?

(This is not a zero prim rezzer)

default
{
listen(integer channel, string name, key id, string message)
{
if (llGetOwner() == llGetOwnerKey(id) &&
message == "die";)
{
llDie();
}
}

on_rez(integer startParam)
{
llSensorRepeat("",NULL_KEY,AGENT,20,PI,0.1);
llListen(startParam, "", NULL_KEY, "die";);
}
no_sensor()
{
llDie();
}
}
Rolig Loon
Not as dumb as I look
Join date: 22 Mar 2007
Posts: 2,482
04-06-2009 19:34
Check to see what value is being passed to the rezzed object in the startParam variable. The way this is written, it's supposed to be the number of the channel that it's meant to listen for the "Die" command on. You may be overwriting it somewhere.

While you're looking for things to change, BTW, consider changing the rate in your llSensorRepeat statement. It's repeating every 0.1 second now. That's a LOT of lag. You could probably increase it to 15 or 20 seconds and still serve your purpose well enough.

Also, now that I look again, you don't have to test in the listen event to see if message == "die". Your llListen filter already takes care of that.
Johan Laurasia
Fully Rezzed
Join date: 31 Oct 2006
Posts: 1,394
04-06-2009 20:27
Another more easier method might be to just make the rezzer objects temporary, and let them die off after about 1 minute. Just a suggestion.
_____________________
My tutes
http://www.youtube.com/johanlaurasia
Void Singer
Int vSelf = Sing(void);
Join date: 24 Sep 2005
Posts: 6,973
04-06-2009 21:39
I belive you'll need a sensor event even though you aren't using it. you also might want to consider using just llSensor in a timer event as sensor repeat will catch odd stuff near the sim boarder every few cycles even if those objects aren't in range... the regular version won't.

as has been noted .1 is really fast, so you probably want to slow that down some... also if the rezzor os putting out multiple items it'd probably be better to put your sensor in the rezzor object and trigger a die command via chat, rather than have a whole bunch of sensors.

a trick to double check to make sure no one is around would be to use a global variable and in your sensor event put
gBooAvsHere = TRUE;

and in your no sensor
if (gBooAvsHere){
gBooAvsHere = False;
}else{
//-- trigger die command to the rezzed objects
//-- probably stop checking the sensor too
}
_____________________
|
| . "Cat-Like Typing Detected"
| . This post may contain errors in logic, spelling, and
| . grammar known to the SL populace to cause confusion
|
| - Please Use PHP tags when posting scripts/code, Thanks.
| - Can't See PHP or URL Tags Correctly? Check Out This Link...
| -
AppleBottom Sugarplum
Registered User
Join date: 14 Dec 2008
Posts: 2
04-07-2009 11:50
Is there anyone here who is willing to let me send them a copy of the rezzer full perm so you can have a look and see what is wrong?
I really need the items to die when no avis are present because it is being used in a house, so putting a timer on it is not an option. I also want to keep all the other functions that it already does.
Please IM me in world if so and I will send it.
Void Singer
Int vSelf = Sing(void);
Join date: 24 Sep 2005
Posts: 6,973
04-07-2009 22:41
I'd offer, but my isp is having "issues" so I can't consistently get or stay inworld =/
_____________________
|
| . "Cat-Like Typing Detected"
| . This post may contain errors in logic, spelling, and
| . grammar known to the SL populace to cause confusion
|
| - Please Use PHP tags when posting scripts/code, Thanks.
| - Can't See PHP or URL Tags Correctly? Check Out This Link...
| -
Ron Khondji
Entirely unlike.
Join date: 6 Jan 2007
Posts: 224
04-08-2009 09:34
Send me one.

Allthough I'm not making any promisses except that I'll do my best.