|
Cegaiel Shan
Registered User
Join date: 12 Apr 2007
Posts: 9
|
06-16-2007 15:04
Hi, I wrote a dance pole a while back that plays each animation about 30 seconds and continuously cycles through the animations.
Up until now I just used an average distance I want the avatar to be from the pole with llSitTarget(offset,ZERO_ROTATION); (where offset is something like <-0.3,0,-0.2>.
Now I have found some new animations that are specifically designed for the pole and each one seems to be way too far away from the pole (or too close).
I dont want the avatar to be unsitted each dance, just so I can call a new llSitTarget with the new offset coordinates.
How can I adjust the offset of the avatar is sitted?
I have seen it done on a one prim pole before (no hidden pose balls).
I've been playing around hours with several functions and the closest thing to do this, I've found, is llMoveToTarget. But llMoveToTarget() needs the vector location to move to...
So I've been trying combinations like llMoveToTarget(llGetPos-offset)) offset might be <0.3,0,-0.1>. Sometimes I dont move and a couple of times I wound up moving two sims away, lol...
Any help would be appreciated... Thanks in advanced.
|
|
Ravanne Sullivan
Pole Dancer Extraordinair
Join date: 10 Dec 2005
Posts: 674
|
06-16-2007 15:57
When the avatar sits on the object it becomes linked to it as the last part of the linkd set. You can use the commands to change the position of linked child prims to move the avatar's location relative to the parent prim. I haven't used this myself so YMMV and let the scripter beware. Some additional information can be found here: /54/35/178877/1.html
|
|
Qie Niangao
Coin-operated
Join date: 24 May 2006
Posts: 7,138
|
06-17-2007 08:20
From: Ravanne Sullivan I haven't used this myself so YMMV and let the scripter beware. It works very nicely for me... and is particularly handy for matching animations with different positions & rotations without resorting to a poseball that moves depending on which animation it's playing. (Note to Ravanne: handy for dancepoles!)
|
|
Cegaiel Shan
Registered User
Join date: 12 Apr 2007
Posts: 9
|
It works, thanks
06-17-2007 10:17
That forum link above certainly was what I needed, thank you. I just added this line in the timer loop to look something like this: offset = <0.2,0,-0.5>; llSetLinkPrimitiveParams(llGetNumberOfPrims(), [ PRIM_POSITION, offset] ); I'm using if..then statements to set the correct offset for each animation, so heres a preview of that, in case anyone is trying out the same thing in the future and finds this post... The dance 1 and dance 2 are case sensitive and the names of the dance loaded into pole. timer() {
if (llList2String(ANIMATION,CURRENTDANCE) == "Dance 1") { offset = <-0.2,0,-0.5>;
}else if (llList2String(ANIMATION,CURRENTDANCE) == "Dance 2") { offset = <-0.3,0.3,-0.5>;
}else if (llList2String(ANIMATION,CURRENTDANCE) == "Dance 3") { offset = <-0.2,0,-0.5>; }
llStopAnimation(llList2String(ANIMATION, CURRENTDANCE));
llSetLinkPrimitiveParams(llGetNumberOfPrims(), [ PRIM_POSITION, offset] );
llStartAnimation(llList2String(ANIMATION, CURRENTDANCE));
}
Works beautifully... Of course each offset is hardcoded into the script, so might be better to put the x,y,z coords, for each animation, in a notecard for quicker and easier changes...
|