[Opensim-users] npc and attachments
paul emery
pablo at lansing.com
Mon Sep 12 21:11:33 UTC 2011
Am wondering if anybody has some hints for simulating a bot picking up an
object carrying it some where and then putting it down. I have a kludge to
get the bot to bend over and "pick up" an object and carry it somewhere. I
cannot get him to drop the attachment. Here is my kludge.
...
// appearance is a note card of bot without an attachment
npc = osNpcCreate("Casias", "Twin", <104, 57, 27>,
"appearance");
vector first = osNpcGetPos(npc);
vector second = first + <6,0,0> ;
llOwnerSay("I am going to get it. ");
//osNpcMoveToTarget(npc, llGetPos() + <2,0,0>,
OS_NPC_NO_FLY);
osNpcMoveToTarget(npc, second, OS_NPC_NO_FLY);
llSleep(5);
llOwnerSay("I am picking it up.");
osAvatarPlayAnimation(npc, "Casbow");
osNpcLoadAppearance(npc,"carry");
// replaced the bot appearance from a second notecare that includes the item
attached to chest
llSleep(5);
vector xyz_angles = <0,0,180>; // This is to define a 45
degree change
vector angles_in_radians = xyz_angles * DEG_TO_RAD; //
Change to Radians
rotation rot_xyzq = llEuler2Rot(angles_in_radians); //
Change to a Rotation
rotation rot = osNpcGetRot(npc);
osNpcSetRot(npc, rot * rot_xyzq);
//osNpcMoveToTarget(npc, llGetPos() - <2,0,0>,
OS_NPC_NO_FLY);
llOwnerSay("returning");
osNpcMoveToTarget(npc,first, OS_NPC_NO_FLY);
llSleep(5);
llOwnerSay("I am putting it down.");
osAvatarPlayAnimation(npc, "Casbow");
llSleep(5);
// i thought going back to original notecard appearance
would get rid of the attachment
// but it doesn't. So really bad kludge
osNpcRemove (npc);
llOwnerSay("should have disappeared");
npc = osNpcCreate("Casias", "Twin", <104, 57, 27>,
"appearance");
Ok now don't laugh just give me some suggestions
--
View this message in context: http://opensim-users.2152040.n2.nabble.com/npc-and-attachments-tp6785269p6785269.html
Sent from the opensim-users mailing list archive at Nabble.com.
More information about the Opensim-users
mailing list