Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Auto Rez and then link

Chaz Longstaff
Registered User
Join date: 11 Oct 2006
Posts: 685
08-21-2007 17:21
Before I try, just wondering if it is theoretically possible to have one object rez another (I know that part is possible -- so the important part of this query is the second part....) and *then* link it to itself?
Day Oh
Registered User
Join date: 3 Feb 2007
Posts: 1,257
08-21-2007 18:02
Yes. I'd use either the parent's object_rez event or a listen to know when to link.
_____________________
Kaluura Boa
Polygon Project
Join date: 27 Mar 2007
Posts: 194
08-21-2007 18:10
From: Chaz Longstaff
Before I try, just wondering if it is theoretically possible to have one object rez another (I know that part is possible -- so the important part of this query is the second part....) and *then* link it to itself?


The short answer: Yes.

The long answer: Add an object_rez() event in the script of the rezzing object.

default
{
...

object_rez(key id)
{
llCreateLink(id, TRUE);
}
}

"id" is the key of the rezzed object. And the TRUE flag means that the rezzing prim remains the parent of the linkset.

Keep in mind that when you create such a link, the order of the children of the rezzing object change; the created link insert the prims of the linked object after the root prim of the rezzing object. (It's as clear as mud... Just read several times to see if it matters for your script.) ;-)

Second problem, it's painfully slow! llCreateLink() also inserts a 1 sec delay.

And, finally, don't forget to ask for permission PERMISSION_CHANGE_LINKS.

Hope it helps.
Chrysala Desideri
Scarlet Scriptrix
Join date: 4 Mar 2007
Posts: 65
10-02-2007 08:09
is rez_object is raised for the whole prim?

I mean, could one have a seperate linking script(s) with only rez_object event to keep their gadget from choking 1.2 sec [price not inclusive of L.A.G. ;-) ] at every rez/link?
Shadow Subagja
Registered User
Join date: 29 Apr 2007
Posts: 354
10-02-2007 15:42
yeah my HUD relies on this by performing on_rez in an isolated dispatch script to keep clutter out of the main functional scripts. Every script in a prim will see on_rez when any other script calls llRezObject, if I recall.