Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Method to passkey to llRezObject

Moniker Beck
Registered User
Join date: 12 Jul 2007
Posts: 88
03-08-2009 10:50
I am looking for a method short of using a listener, to pass a key to a object that was rezze via llRezObject. I was hoping to use the start_param, but being an integer it does not look like there is a way to utilize that. The key will be used to pass the "parent" key to the rezed object then to then call llCreateLink to link it.

Any ideas will be appreciated.

Thanks in advance.
Cypher Ragu
[Mad Scientist]
Join date: 6 Jul 2008
Posts: 174
03-08-2009 11:21
As far as I know, listens are the only way to have two prims communicate with each other (unless you're willing to use Email or HTTP).

However, you could have the "Parent" prim call llCreateLink in the "object_rez" event.


For example:


default
{
object_rez(key rezzed)
{
llCreateLink(rezzed, TRUE) //Links the rezzed object to this object
}
}

Note that this snippet of code won't work by itself, because llCreateLink requires the owner to have granted PERMISSION_CHANGE_LINKS to the script.
_____________________
Life is a highway... And I just missed my exit.
Moniker Beck
Registered User
Join date: 12 Jul 2007
Posts: 88
03-08-2009 11:46
Thanks Cypher, that should work just fine. I should have re-read the llCreateLink function again, as the second parameter is exactly what I was trying to accomplish.

llCreateLink(key target, integer parent)

Attempts to link the object containing the script and target (requires that permission PERMISSION_CHANGE_LINKS be set). If parent == TRUE, the object calling this function will be the parent prim of the new link set, and the target prim will become that parent's first child (inserted before any children the parent might have already had).