llDetectedLinkNumber ...??
|
|
Katryna Jie
Registered User
Join date: 24 Jun 2007
Posts: 187
|
09-14-2007 01:36
Hi all, I read that I should use this function (llDetectedLinkNumber) in the parent prim when I have a whole bunch of child prims that will be touched. To make the script more efficient and use less memory etc.
But, I don't quite get it.
a) Do I need a touch script or not in the child prims? b) How do I know / does it know, which prim is which number? Is there a way to tell it which prim is which number?
Also, is there an opposite of this command? Where instead of receiving touches to child prims, sending a command to child prim #x without putting scripts in the child prim?
My script I'm planning will require A LOT of child prims.
I basically need it to pass alpha and colour settings to the child prims. I already understand how those two commands work, but was originally going to put alpha, colour and listening in each prim...
|
|
Squirrel Wood
Nuteater. Beware!
Join date: 14 Jun 2006
Posts: 471
|
09-14-2007 02:26
You have one touch event in the root prim in which you use llDetectedLinkNumber to find out which child prim was touched and then use llSetLinkPrimitiveParams or SetLinkAlpha or SetLinkColor to change that child prims properties.
As for determining which prim has which link number....
Select them all in the reverse order you want with the root-prim to be last and link them to put them in the desired order you want.
|
|
Lyn Mimistrobell
(waiting)
Join date: 11 Jan 2007
Posts: 179
|
09-14-2007 08:13
I normally name my childprims to indicate their purpose. For example, a "next" button a vendor will be "BTN:NEXT". In my code I will check for llGetLinkname(llDetectedLinkNumber(0)) ...
|
|
Katryna Jie
Registered User
Join date: 24 Jun 2007
Posts: 187
|
09-14-2007 20:03
Thanks guys.. that's helpful, though it brings me to another question...
What's the maximum number of prims I can link together??? My build is going to need... A LOT of prims... at least half of which will be minis.
|
|
Osgeld Barmy
Registered User
Join date: 22 Mar 2005
Posts: 3,336
|
09-14-2007 22:13
255
|
|
Katryna Jie
Registered User
Join date: 24 Jun 2007
Posts: 187
|
09-15-2007 04:26
255? That's it?  Hmmm... guess that means I'm going to have less work than I thought, but also not as nice of a finished product..
|
|
Jesse Barnett
500,000 scoville units
Join date: 21 May 2006
Posts: 4,160
|
09-15-2007 06:46
From: Katryna Jie Thanks guys.. that's helpful, though it brings me to another question...
What's the maximum number of prims I can link together??? My build is going to need... A LOT of prims... at least half of which will be minis. Before you spend anytime on the script, I would create your build and try to link it together first. I think you will probably run into a problem or too even linking it. LL uses a formula for how far apart prims can be to link, part of it is determined by the size of the prims. You have to really play with it to get the right prim to use as the root prim and the order which you link them together. You might have to go with having more then one linkset and using says & listens between them and then use link messages in each set. Sounds like this project is going to be a good learning expirience on more then one level 
_____________________
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
|
|
Lyn Mimistrobell
(waiting)
Join date: 11 Jan 2007
Posts: 179
|
09-15-2007 08:11
Also, sometimes a set of prims that is linked, will fall apart after rezzing. And sometime you unlink a set, and cannot link it again (especially if it's rotated at any angle but 0, 90, 180 or 270). This may happen if the build is very close to the link limit.
And if you want ppl sitting on your build - sitting avatars are also considered links (you can even manipulate them using the link functions). I think you have to substract the number of avatars being able to sit from the max. link size.
|
|
Katryna Jie
Registered User
Join date: 24 Jun 2007
Posts: 187
|
09-15-2007 18:45
thanks guys for the tips... distance won't be an issue.. it's a lot of prims, yes - but it's not a huge build... no sitting either, though that tip will be handy for later.
Jesse, I considered that, which I will have to do when I want to make a bigger version..but for now, just a single set will do.. I'm not advanced enough of a programmer yet to figure out all of it.
Another issue I'm having now is with the llRez command... I can get it to rez the object, but no matter which way I rotate the object - it rezzes to the north. The example I studied said that it rezzed IN FRONT of the object, but that seems to not matter which way I rotate - in front is always north?
I will need to rez in front of the avatar that the rezzer is attatched to...
|