Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Can a script resize attached prims?

Starchaser Webb
Artist / Builder
Join date: 23 Feb 2006
Posts: 30
03-16-2006 12:44
Can a script in an attachment resize prims in that same attachment, while someone is wearing it? I can get messages from the control script in the root prim to the child prims that I want to resize, but I am at a loss for what commands to use in the child prim scripts, to resize the child prims.

I'm working on a set of 3-position wings, and I had an idea for something elegant, but I don't know if it's possible. The wings offer three positions by making two sets invisible and one set visible at a given time. So they can show a closed pair, a mantled pair, or a widely spead pair. I have the script worked out that far, using a control script in the root prim and listeners in the child prims to make various pairs visible or invisible as needed. It looks like this does the job as well as any other multi-position wings that I have seen.

Now for the problem, and the hopefully elegant idea. A large, invisible pair of wings can be annoying, because someone clicking near the wearer for any reason might accidentally select the invisible wing. For example, someone trying give inventory to someone else may inadvertantly drop it on the wearer of the wings, rather than the intended recipient! Invisible wings can also cause camera navigation issues, etc. ... So what I would like to do is both to toggle the alpha state of the unused wing prims, and resize them on the non-thickness axis pair, so the invisible wings don't stick out so far.

I don't know where to go from there. It seems that llSetScale will work on attachments, but if the wings are already at the minimum allowed thickness, it seems it wouldn't be able to scale them smaller. And I don't want the alpha-mapped wings to be very much thicker. Can you specify to only scale X and Y, while leaving Z as-is?

I also looked at llSetPrimitiveParams, but there's a note in the WIKI that says llSetPrimitiveParams does not work with attached objects.

Any ideas? So far, the best I have come up with is to make the wings 2 to 5 times thicker than the minimum, allowing some scaling down to happen.
Osgeld Barmy
Registered User
Join date: 22 Mar 2005
Posts: 3,336
03-16-2006 12:49
From: Starchaser Webb

I don't know where to go from there. It seems that llSetScale will work on attachments, but if the wings are already at the minimum allowed thickness, it seems it wouldn't be able to scale them smaller. And I don't want the alpha-mapped wings to be very much thicker. Can you specify to only scale X and Y, while leaving Z as-is?


yes you can do something like <x,y,z> -= <0.1,0.1.0> and only the x and y will change

or you can define each like

vector.x += 0.05
vector.y -= 0.05
Kayla Stonecutter
Scripting Oncalupen
Join date: 9 Sep 2005
Posts: 224
03-16-2006 20:26
From: Starchaser Webb
A large, invisible pair of wings can be annoying, because someone clicking near the wearer for any reason might accidentally select the invisible wing. For example, someone trying give inventory to someone else may inadvertantly drop it on the wearer of the wings, rather than the intended recipient!
One thing I found is that if you apply a fully clear texture (such as f54a0c32-3cd1-d49a-5b4f-7b792bebc204) to a prim, item drops and right clicks go right through it, unless your in edit mode. It does mean you have to switch textures instead of the simpler alpha toggle, but greatly reduces problems like you mentioned.

As for the scaling problem, along with what Osgeld said, you can get the current scale with llGetScale(), perhaps store it as a variable, then use something like llSetScale(<0.1, 0.1, OpenSize.z>;) to shrink it down, then llSetScale(OpenSize) to put it back, or just hardcode the sizes into the script. Note though, that changing the size of a prim does not move it, so the center will still be at the same point.
_____________________
Starchaser Webb
Artist / Builder
Join date: 23 Feb 2006
Posts: 30
03-18-2006 16:57
Thank you Kayla! That was just what I needed. I have finished making my wings, and am pleased to say that with your method, the hidden sets of wings are non-clickable.