Problem is, he's demented. I can't for the life of me make him come properly when called!
The script that manages his actions is inside his root prim which is a sphere (well not quite a sphere) located in his chest. The sphere is rotated so that when I do a llLookAt he is positioned upright (although he is kind of on a tilt instead of having 4 feet flat on the ground, which I guess happens because he is short and looking at my bellybutton, but that's another story). Sphere rotation is thus X: 0 Y:270 Z:180
What happens when I call him:
1) He stands up and looks at me
2) pauses for a moment
3) starts sliding over the ground toward me
4) when he's almost to his ending spot he does a full turn in place (while still moving)
5) he sits down as he finishes his moving/spinning
****What is interesting is, even if I comment out the second llLookAt (and sit) steps, he STILL does the fast turn in place towards the end of the movement, so that he is looking in approxomately the opposite direction! i.e. I don't think the spin has to do with the second llLookAt. Even more oddly, I suspect it may only happen when the avatar is standing certain places (i.e. the dog has to move a certain direction to get to the avatar.)
The entire effect of this is, he gets up, waits a moment, zooms over to me, spins in place and sits down. All very quickly. Bizarre dog!
Questions:
1) **Why** does he start spinning while moving? (He does it even when I comment out the second llLookAt and sit steps)
2) Why isn't he looking at my avatar when he's done with this whole thing? What's with looking the opposite direction from where he started?
3) Why isn't he pausing (sleeping for 1 sec) before sitting down?
4) What exactly does damping (in llMoveToTarget) mean anyway?
5) does llSetStatus(STATUS_ROTATE_X,TRUE) etc apply only to physical objects?
6) Is there a way to access just a certain part of a vector (e.g. just the x component)?
Here is the relevant part of the script that deals with coming when called.
CODE
// In the init() part of this script, I have set the below: Dog is not physical yet though.
// init() is called in on_rez, state_entry, etc.
//llSetStatus(STATUS_ROTATE_X,TRUE); // acts as Z axis due to root prim's rotation
//llSetStatus( STATUS_ROTATE_Z, FALSE);
//llSetStatus( STATUS_ROTATE_Y, FALSE);
.
.
.
if (message == "come") {
llOwnerSay("Coming!");
llSay(Chan, "stand"); // stand up
list avinfo = llGetObjectDetails(llGetOwner(), [OBJECT_POS, OBJECT_ROT]);
vector avpos = llList2Vector(avinfo,0);
rotation avrot = llList2Rot(avinfo,1);
vector offset =<-1,-1,-.5>; // just a guess as to where dog should stand
vector dogpos = avpos+offset;
llLookAt(dogpos, 0.1 , 0.2);
llSleep(.5);
llSetStatus(STATUS_PHYSICS, TRUE);
llMoveToTarget(dogpos, .5);
llSleep(1.0);
llSetStatus(STATUS_PHYSICS, FALSE);
llLookAt(avpos, 0.1 , 0.1);
llSay(Chan, "sit");
}
Any advice would be most welcome.
Thanks!
