Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Attachments and llSetPos()

Hiro David
Registered User
Join date: 2 Oct 2005
Posts: 10
06-13-2006 10:30
Is anyone else having problems using llSetPos() with attachments? My attachment apparently sets its position but doesnt appear to move unless I go back into edit mode on it... then it suddenly settles to where it's supposed to be.... *scratching my head* anyone?
Doug Tweak
Registered User
Join date: 4 Mar 2006
Posts: 21
06-14-2006 15:29
Hiro - I am having the same problem you describe. I have not used llSetPos to move an attachment before so at first I thought I was doing something wrong. Finally I stuck an llOwnerSay((string)llGetLocalPos) line in the code and was able to see that the position where it should be was changing however the object was not moving.
My object did not move up when I went into edit mode as yours did.

Anyone else know if this is a new bug or one that has already been commented on?
Thraxis Epsilon
Registered User
Join date: 31 Aug 2005
Posts: 211
06-14-2006 16:17
I have seen simliar behavior with objects not attached and the llSetRot() functions. What seems to be happening is that until the item shifts (at least in rotation) past a certain point, the change is not transmitted to the client. But when you are in edit mode, the position resolution is increased and it sends any and all position changes, so you see the obejct move.
Doug Tweak
Registered User
Join date: 4 Mar 2006
Posts: 21
06-14-2006 17:45
Thraxix – Based on your post I did the following that seems to support what you believe to be happening.



EXPERIMENT

My original code had my attachment moving up .01. As stated previously the numeric value position changed in my code but visibly the object did not move to where it should have.



After reading what you said I up the movement increment to .1. Clicked and value increased as it should but attachment did not move. Clicked a second time this time it jumped the sum of both increments, .2.



Ok – so now I changed my movement increment to .2 per click. Each click moved the object .2 up as expected.



Finally I had to zero in on the threshold value. An increment of .110 showed a visible move while .101 did not. I stopped playing at that point.



SOME OTHER OBSERVATIONS

If I increase the size with a llSetScale() by even .01 the change is visible on the attachment. So a much smaller scale change was visible.



QUESTION

My script calls for a movement of .01 up or down. As stated above I cannot see changes less then .11 up or down but I can see changes in scale as small as .01. Has this ALWAYS been the behavior or is this something that has changed in a recent update?



Thraxix’s theory as to why sounds plausible to me, anyone know this to be true for a fact?



FINALLY

If you know a work around so I can see small up/down changes please let me know.
Bitzer Balderdash
Dazed and Confused
Join date: 21 Dec 2005
Posts: 246
06-15-2006 03:30
A possible workaround would be to do something like setting the hover text, which will force a full update for the item.

It will also cause lag, of course, since it forces a full update for the item *sigh*
Joannah Cramer
Registered User
Join date: 12 Apr 2006
Posts: 1,539
06-15-2006 05:45
From: Doug Tweak
FINALLY

If you know a work around so I can see small up/down changes please let me know.

Let's say movement by 1 cm doesn't show, but 5 cm or more does:

* move the prim in desired direction by 5 cm + 1 cm
* move the prim back by 5 cm.

effectively a movement by 1 cm, but doubt the client is optimizing for something like this and filtering both operations out.

For smoother experience might want to pack both movement commands into single llSetPrimitiveParams() call so they're executed in single frame... this might have some sort of built-in optimization though, but that's just a guess ^^;;
Hiro David
Registered User
Join date: 2 Oct 2005
Posts: 10
slight update
06-15-2006 08:37
as perhaps a marginally interesting update... I put the object back into my inventory and put it back on. Sometimes it moves as suspected, sometimes it doesnt. It seems the former is more frequent.