Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

temporary rezzer won't stop rezzing

OnThePath2Madness Shostakovich
Registered User
Join date: 24 May 2008
Posts: 5
02-04-2010 20:05
nevermind
Rolig Loon
Not as dumb as I look
Join date: 22 Mar 2007
Posts: 2,482
02-04-2010 22:15
One easy way to beat that is to forget about using a sensor. It can be laggy anyway. Make an 8m diameter transparent cylinder to put your rezzer script in, and then write something that looks like this

CODE

default
{
state_entry()
{
llVolumeDetect (TRUE);
}

collision_start(integer num)
{
llRezAtRoot(llGetInventoryName(INVENTORY_OBJECT,0) , llGetPos(),ZERO_VECTOR,ZERO_ROTATION,0);
}
}


ETA: Pffft! The OP took his question away. :rolleyes: FOR THE RECORD, though, he wanted to know how to make a rezzer create one object whenever an av comes within range.
_____________________
It's hard to tell gender from names around here but if you care, Rolig = she. And I exist only in SL, so don't ask.... ;)

Look for my work in XStreetSL at
Kaluura Boa
Polygon Project
Join date: 27 Mar 2007
Posts: 194
02-04-2010 22:27
Hmmm... A sensor is supposed to create lag, so here comes a low lag solution without listener to rez an object if an AV comes within range.

The script for the rezzer:
-------------------------------------------------------------------------
integer isREZZED = FALSE;
key ObjectKey = "";

default
{
state_entry()
{
llSensorRepeat("", NULL_KEY, AGENT, 4.0, PI, 5);
}

sensor(integer total_number)
{
if (!isREZZED)
{
llRezObject(llGetInventoryName(INVENTORY_OBJECT, 0), llGetPos(),ZERO_VECTOR,ZERO_ROTATION,0);
isREZZED = TRUE;
}
}

no_sensor()
{
if (ObjectKey != "";)
{
llGiveInventoy(ObjectKey, llGetInventoryName(INVENTORY_OBJECT, 0));
ObjectKey = "";
}
isREZZED = FALSE;
}

object_rez(key id)
{
ObjectKey = id;
isREZZED = TRUE;
}
}
-------------------------------------------------------------------------

And in the rezzed object:
-------------------------------------------------------------------------
default
{
changed(integer change)
{
if (change & CHANGED_INVENTORY)
{
if (llGetInventoryType(llGetObjectName()) == INVENTORY_OBJECT)
{
llDie();
}
}
}
}
-------------------------------------------------------------------------

In words: The rezzer script must know if the object is already rezzed. It also stores the key of the rezzed object so, when it's time to clear the place, it gives a copy of the object to the rezzed object. And when the rezzed object realizes what it has in its belly, it explodes... sort of... ;)

ETA: The OP deleted his question... So I delete every mention to him.
_____________________
It's hard to tell gender from names around here but if you care, Kaluura = he. And I exist elsewhere than in SL but who cares? ;)
Void Singer
Int vSelf = Sing(void);
Join date: 24 Sep 2005
Posts: 6,973
02-04-2010 22:53
also remember that every few cycles llSensorRepeat can grab avatars outside it's range IF that range is near a sim border... llSensor called from a timer does NOT exhibit this weird behavior.
_____________________
|
| . "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...
| -
Pete Olihenge
Registered User
Join date: 9 Nov 2009
Posts: 315
02-05-2010 02:29
From: Void Singer
also remember that every few cycles llSensorRepeat can grab avatars outside it's range IF that range is near a sim border... llSensor called from a timer does NOT exhibit this weird behavior.
Bingo! Stumbling across that snippet of information has made my day :)
Void Singer
Int vSelf = Sing(void);
Join date: 24 Sep 2005
Posts: 6,973
02-05-2010 03:02
guess I should note that on the wiki... some thing you just find out the hard way (I ran face first into this bug on my av sensor)

ETA:
wiki annotated, and it's back up
_____________________
|
| . "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...
| -