Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

llSetPrimitiveParams failing?

Lemieux Primeau
Registered User
Join date: 25 Oct 2006
Posts: 49
01-05-2007 10:24
I have the following code in a prim that is a child in a linkset. When run, the prim does not move, and comparing the output of the llOwnerSay and the position of the prim after the script runs confirms that. Btw, the output of the llOwnerSay is exactly the position I expect it to be.

The attempted move does not exceed the link distance limit nor does it attempt to move anything below ground.

This moving snippet immediately follows another call to llSetPrimitiveParams on the same prim that uses the PRIM_ROTATION constant. Eventually I was going to combine the two calls into one, doing the rotation first and then the move. But first I wanted to get them operating correctly on their own.

Anyone know what I'm doing wrong?

CODE

vector vMove = llGetScale();

vMove = <vMove.x/2,0,0>;

llSetPrimitiveParams([PRIM_POSITION, (llGetPos() - (vMove * llGetRot()))]);

llOwnerSay((string)(llGetPos() - (vMove * llGetRot())));
Ziggy Puff
Registered User
Join date: 15 Jul 2005
Posts: 1,143
01-05-2007 11:07
I think there are some issues where the client might not be getting updated if the movement is very small. Try editing the object and see if the prim moves to its new position when you do that.

Also, I think this might end up working in local coordinates in a child prim, so the llGetPos part might not be needed. So, maybe the llGetPos when added to the offset gives you a large number in local coordinates, and that does break the link distance limit. For instance, maybe you want to move 1m in the X axis. But if you use llGetPos and you're at 100, you decide you need to move to 99. But since it's in a child prim, it tries to move 99m away from the root prim, not to X=99 on the sim.

Hope that made sense :)
Lemieux Primeau
Registered User
Join date: 25 Oct 2006
Posts: 49
01-05-2007 11:50
Excellent thank you Ziggy. The local coords was exactly the problem.

I swapped out llGetLocalPos() for llGetPos() and it now works.

Using the region coordinates, I was setting that x component to a point at like 87 meters - waaaay over the limit. In local coords it is something more like 2 lol.

Thanks again - cheers!