Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Strange llSetPos behavior

Xen Parx
Registered User
Join date: 14 Jun 2008
Posts: 2
09-21-2008 12:21
Hello. First, let me state up front that I'm a newbie and this is my first non-trivial script. However, I have tried to do a thorough research on the problem I'm having, but to no avail. The script that I'm writing is supposed to take an object composed of linked prims and shrink it. For the most part, I have gotten it to work reasonably well, but I have a complex object (109 prims) that for some reason, two of the prims won't move. Here is a snippet of code that gets executed in each of the child prims:

originalPos = llGetLocalPos();
pos = multiplyVec(originalPos, scale);
llSetPos(pos);
temp = llGetLocalPos();
if (temp != pos) {
llOwnerSay("\nWarning: asked for pos " + (string) pos +
" but got pos " + (string) temp);
llOwnerSay("original pos = " + (string) originalPos);
distance = llVecDist(originalPos, pos);
llOwnerSay("Distance = " + (string) distance);
llSetColor(<1.0, 0.0, 0.0>, ALL_SIDES);
}

For a badly behaving prim I get output from this that looks like:

[8:43] Object:
Warning: asked for pos <-0.09627, 0.12480, 0.08371> but got pos <-0.96270, 1.24800, 0.83710>
[8:43] Object: original pos = <-0.96270, 1.24800, 0.83710>
[8:43] Object: Distance = 1.606199

From this we see that the position asked for was the original position scaled down by a factor of 10, which is what is desired. But we also see that the llSetPos had no effect, the original position and the resultant position are the same. The requested move distance is small, so the 10m link distance shouldn't be a problem. Since the object is shrinking I can't be moving it below ground level (and the movement of the other parts confirms this). I've gone through each of the linkset rules and can't see that this move violates any. Plus, there are the other 107 prims which seem to position themselves correctly. Can anyone offer any suggestions? I've run out of ideas.
Lightwave Valkyrie
Registered User
Join date: 30 Jan 2004
Posts: 666
09-21-2008 14:43
as your prims shrink so does your link distance
two .01 size prims wil not link at 3 meters
there is ways around it but not with setpos i dont think
_____________________
L$ is the root of all evil
videos work! thanks SL :)
Xen Parx
Registered User
Join date: 14 Jun 2008
Posts: 2
09-21-2008 15:25
That's why I perform the move before resizing. If they are currently linked then moving them closer (which always happens on a shrink) should still make them within linking distance. Or am I missing something?