Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

I am looking for a rezzer script

Nisa Maverick
Registered User
Join date: 3 Jun 2007
Posts: 224
01-15-2009 11:22
i 've been searching for a rezzer script that will do.

Rez an object when an av is within 1 meter, and then de rez the object after 1 min has passed. I've tried temp rezzers the free ones but that doesnt work well.

Any Ideas
Rolig Loon
Not as dumb as I look
Join date: 22 Mar 2007
Posts: 2,482
01-15-2009 11:45
You'll need to write two very simple scripts. The first one is to be placed in the object that senses visitors and rezzes the temporary object. Basically, all you need there is a detecting event (a sensor or a collision event) in which you put a llRezObject command. The other script is one that you put into the object to be rezzed. All it really needs is a timer event in which you put a llDie command. Put the second script in the object to be rezzed, and that put that object in the contents of the first object. Bingo.
Nisa Maverick
Registered User
Join date: 3 Jun 2007
Posts: 224
01-15-2009 12:01
oh lord thanks rolig but I will have to find these scripts as I am not at all very good in compiling them
Nisa Maverick
Registered User
Join date: 3 Jun 2007
Posts: 224
01-15-2009 12:24
Ok I have managed to do the rez object script and that works

default
{

collision_start(integer total_number) {

// This line will pick the first object out of the container and rez it
llRezObject(llGetInventoryName(INVENTORY_OBJECT,0), llGetPos()+<0,0,2.0>,ZERO_VECTOR,ZERO_ROTATION,0);

}

}

.....................................................................................................................................

But I have never done a die command for the second script,


default
{
state_entry()
{
}
}
llDie
Rolig Loon
Not as dumb as I look
Join date: 22 Mar 2007
Posts: 2,482
01-15-2009 12:43
Try something like this .....

CODE

default
{
state_entry()
{
llSetTimerEvent(60.0);
}
timer()
{
llDie();
}
}
Nisa Maverick
Registered User
Join date: 3 Jun 2007
Posts: 224
01-15-2009 12:46
thank you rolig I will give that a go
ArchTx Edo
Mystic/Artist/Architect
Join date: 13 Feb 2005
Posts: 1,993
01-15-2009 14:12
I think you will find everything you need here:

/54/a0/221457/1.html
_____________________

VRchitecture Model Homes at http://slurl.com/secondlife/Shona/60/220/30
http://www.slexchange.com/modules.php?name=Marketplace&MerchantID=2240
http://shop.onrez.com/Archtx_Edo
Jesse Barnett
500,000 scoville units
Join date: 21 May 2006
Posts: 4,160
01-15-2009 15:09
Actually you don't even need to use a timer. Just make the object temporary. The lifespan of a temp object is right around 50 or so seconds.
_____________________
I (who is a she not a he) reserve the right to exercise selective comprehension of the OP's question at anytime.
From: someone
I am still around, just no longer here. See you across the aisle. Hope LL burns in hell for archiving this forum
Nisa Maverick
Registered User
Join date: 3 Jun 2007
Posts: 224
01-16-2009 02:56
I have got this object rezzing and derezzing brilliantly thank to all your help. BUT the object is rezzing the wrong way round, I rotate the rezzing prim 90 or 180 degrees but it still comes the wrong way.

What command do I need to rez it so I can turn it please
Yingzi Xue
Registered User
Join date: 11 Jun 2008
Posts: 144
01-16-2009 03:21
Another thing I would do, if you want the object to stay until the avatar leaves, is to use the sensor/collision event to reset a llSetTimerEvent(60); in the rezzer script and when the time expires after no avatar detection (in the timer() event) send a message to the rezzed object to die. This way your object stays as long as the avatar is there.

From: someone

// rezzer script

default
{
collision_start(integer total_number) {
// This line will pick the first object out of the container and rez it
llRezObject(llGetInventoryName(INVENTORY_OBJECT,0) , llGetPos()+<0,0,2.0>,ZERO_VECTOR,ZERO_ROTATION,0);
llSetTimerEvent(60);
}

collision(integer total_number)
{
llSetTimerEvent(60);
}

timer()
{
llWhisper(-800,"die_object";);
}
}


// rezzed object die script

default
{
state_entry()
{
llListen(-800,"",NULL_KEY,"";);
}

listen(integer ch, string name, key id, string message)
{
if (message == "die_object";)
{
llDie();
}
}
}


As for adjusting the position of the rezzed object, the <0,0,2.0> in the llRezObject statement is the offset from the rezzer that the object will be rezzed. Right now it's set for 2 meters up on the z axis. <x,y,z> ... so look at the direction you want to go where you have the rezzer and add in a number accordingly. If you look at your rezzer's position and see what directions x and y point, you should be able to add in a value in x or y and get your desired position.
Nisa Maverick
Registered User
Join date: 3 Jun 2007
Posts: 224
01-16-2009 03:26
I'm happy with the way this works as is but it is facing the wrong way

default
{

collision_start(integer total_number) {

// This line will pick the first object out of the container and rez it
llRezObject(llGetInventoryName(INVENTORY_OBJECT,0) , llGetPos()+<0,0,2.0>,ZERO_VECTOR,ZERO_ROTATION,0);

}

}
I am totally at a loss here where to put a command in to alter the rotation of the rezzed object.
Yingzi Xue
Registered User
Join date: 11 Jun 2008
Posts: 144
01-16-2009 03:32
Sorry, I misread. Probably the easiest way is to make a temporary script that tells you the rotation of the object as you want it, then you place that in your llRezObject statement.

Go rez your temp object... then rotate it the way you want it and drop this script in it...

default
{
state_entry()
{
llOwnerSay("My rotation is: "+(string)llGetRot());
llRemoveInventory(llGetScriptName());
}
}

It will give you the rotation of the object the way you want it. Then simply copy and paste that rotation into the llRezObject statement where ZERO_ROTATION currently is. By the way, this script will remove itself from the prim as soon as it gives you the rotation.