Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Please Help

Jezania Zeid
Registered User
Join date: 11 Apr 2008
Posts: 6
06-28-2008 11:26
OKay I'll explain what I am trying to do and what is not working. I am a very newbie LSL scripter so what I have is a bit messy, forgive me, any suggestions are welcome.

I have an object that rezzes another object, on rezzing the object it sends a message stating to kill the first object, (which is listening) and replace it with another from its inventory (which is cpyable). That part is simple and is working fine.

The problem is when i have multiple rezzers and I click any of them it KILLS all of the objects listening when what I want it do to is kill only its own object.

here is the code I have now

IN THE REZZER::


default
{



touch_start(integer total_number) { if (llDetectedKey( 0 ) == llGetOwner()) state open; }}state open { state_entry()
{

llSay(-50000,llGetKey());




llRezObject(llGetInventoryName(INVENTORY_OBJECT,0), llGetPos()+<0,-.112,1.142>,ZERO_VECTOR,llGetRot()+<-25,0,0,1.0>,0);



state default;
}
}

IN THE OBJECT::

integer rezzer_key;
integer listen_handle;

default
{
state_entry()
{ rezzer_key = llListen(-50000, "", "", "";);

listen_handle = llListen(-8675309, "", "rezzer_key", "";);
}
listen( integer channel, string name, key id, string message )
{


llListenRemove(listen_handle);
llDie();
}

}

I was trying to play with it but multiple copies of the rezzer still do not work. I want to be able to rez from inventory several rezzers and have them only take to the objects in there own inventory.

Thanks for any suggestions
SuezanneC Baskerville
Forums Rock!
Join date: 22 Dec 2003
Posts: 14,229
06-28-2008 12:06
The event object_rez is triggered in the rezzor when it rezzes an object. This event receives as a parameter the key of the object it is rezzing.

You can use that key to limit the listen to only get messages from the rezzed object.
_____________________
-

So long to these forums, the vBulletin forums that used to be at forums.secondlife.com. I will miss them.

I can be found on the web by searching for "SuezanneC Baskerville", or go to

http://www.google.com/profiles/suezanne

-

http://lindenlab.tribe.net/ created on 11/19/03.

Members: Ben, Catherine, Colin, Cory, Dan, Doug, Jim, Philip, Phoenix, Richard,
Robin, and Ryan

-
Jezania Zeid
Registered User
Join date: 11 Apr 2008
Posts: 6
06-28-2008 12:27
From: SuezanneC Baskerville
The event object_rez is triggered in the rezzor when it rezzes an object. This event receives as a parameter the key of the object it is rezzing.

You can use that key to limit the listen to only get messages from the rezzed object.


okay I know where the parameter is set, but wouldn't that parameter be the same in ever rezzer then ? so rezzing multiple rezzer has the same result

I need it tied to the rezzers UUID somehow so its always unique
Dora Gustafson
Registered User
Join date: 13 Mar 2007
Posts: 779
06-28-2008 13:32
1. Any object rezzed gets an unique UUID
2. The easy way to assure your objects will only listen to it's rezzer is to use a random communications channel
In llRezObject last parameter you can tell rezzed objects what channel number it is and the rezzed object can find the number as the parameter in the on_rez() event.
A random channel generator could be:
integer rchan = -(integer)llFrand( 8388608.0 ) - 1000;
The method is not 100% safe but pretty good.
_____________________
From Studio Dora
Jezania Zeid
Registered User
Join date: 11 Apr 2008
Posts: 6
06-28-2008 14:35
From: Dora Gustafson
1. Any object rezzed gets an unique UUID
2. The easy way to assure your objects will only listen to it's rezzer is to use a random communications channel
In llRezObject last parameter you can tell rezzed objects what channel number it is and the rezzed object can find the number as the parameter in the on_rez() event.
A random channel generator could be:
integer rchan = -(integer)llFrand( 8388608.0 ) - 1000;
The method is not 100% safe but pretty good.


could you give me an example of this ?

I thought the last parameter gave it a key but thats different from a channel so I am a bit confused
Dora Gustafson
Registered User
Join date: 13 Mar 2007
Posts: 779
06-28-2008 15:30
From: Jezania Zeid
could you give me an example of this ?

I thought the last parameter gave it a key but thats different from a channel so I am a bit confused

CODE

integer rchan;
default // rezzing object
{
rchan = -(integer)llFrand( 8388608.0 ) - 1000;
...
llRezAtRoot( objName, newObjPos, ZERO_VECTOR, objRot, rchan );
...
}

CODE

integer rChanel;
default // rezzed object
...
on_rez( integer parm )
{
rChanel = parm;
}
...
}
_____________________
From Studio Dora
Jezania Zeid
Registered User
Join date: 11 Apr 2008
Posts: 6
06-28-2008 16:00
From: Dora Gustafson
CODE

integer rchan;
default // rezzing object
{
rchan = -(integer)llFrand( 8388608.0 ) - 1000;
...
llRezAtRoot( objName, newObjPos, ZERO_VECTOR, objRot, rchan );
...
}

CODE

integer rChanel;
default // rezzed object
...
on_rez( integer parm )
{
rChanel = parm;
}
...
}


OMG ! THANK YOU !!!
SuezanneC Baskerville
Forums Rock!
Join date: 22 Dec 2003
Posts: 14,229
06-28-2008 18:40
Sorry if I made a bad suggestion. When I first read your post I thought I understood what you were trying to accomplish. I didn't read the script code because of the terrible formatting we get in the forums here.

After re-reading your post I find it very confusing, what with both objects being referred to as "object" and using the pronoun "it". I think my first take on it was roughly 180 degrees out of phase with what it should have been.

Good you got what you are looking for.
_____________________
-

So long to these forums, the vBulletin forums that used to be at forums.secondlife.com. I will miss them.

I can be found on the web by searching for "SuezanneC Baskerville", or go to

http://www.google.com/profiles/suezanne

-

http://lindenlab.tribe.net/ created on 11/19/03.

Members: Ben, Catherine, Colin, Cory, Dan, Doug, Jim, Philip, Phoenix, Richard,
Robin, and Ryan

-