Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

How do I get parameters for linked prims?

Xaq Zeno
Registered User
Join date: 30 May 2006
Posts: 9
04-22-2007 10:07
I might be missing something here, but...

I'm trying to write a script to demonstrate some genetic mutation priniples.
A few years ago I demonstrated a similar principle using an old papertape reader / puncher I found.
I had the participants create patterns with a hole punch in some paper tape and then ran in through the

reader using a program with the random mutation processing and punch the resulting next generation.
My final version read in 2 tapes, one for each parent, and then randomly combined them, also

introducing mutations along the way.
The mutation rate was adjustable.
The tangible results demonstrated my point very well.

Now, rather than using paper tape, I'd like to do it with objects in SL, more of a 21st century thing.
I'll get some of the students to make me some objects with multiple prims linked together.
Initially, I'll likely just drop a script into their objects and create the next generation with the

random adjustment of the paramters, cylinder might become cube, size or rot might change, maybe a

different color, etc.
Eventually I'll likely just give thm a no-mod script to drop in their objects and I'll use message to

read the prims from my controller, which will allow me to do the "mating" trick I did with the paper

tape, blending two objects.

Now the problem:
Looking through the WIKI, I've found that I can easily get the number of linked prims with

llGetNumberOfPrims and I can get the key and name of a linked prim with llGetLinkKey and llGetLinkName.

I can also set the parameters for a linked prim with: llSetLinkPrimitiveParams.

How can I get the primitive types and parameters for the linked prims.
All my attempts only show those of the root prim.

Am I missing something ???
Ralph Doctorow
Registered User
Join date: 16 Oct 2005
Posts: 560
04-22-2007 11:04
The only way to get most parameters would be to have a script in each prim and have it send them back to the root prim via link messages. You can't read prim parameters in linked prims.
RJ Source
Green Sky Labs
Join date: 10 Jan 2007
Posts: 272
04-22-2007 12:33
Might be easier to change your genetic algorithm control structure approach to be more "object oriented" - letting each object mutate on its own under given constraints, rather than controlling it from a central point.