[Opensim-users] npc and attachments

Justin Clark-Casey jjustincc at googlemail.com
Tue Sep 13 22:20:50 UTC 2011


I'm surprised that going back to the original appearance saved in the notecard doesn't remove the attachment - it should.

On 12/09/11 22:11, paul emery wrote:
> 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.
> _______________________________________________
> Opensim-users mailing list
> Opensim-users at lists.berlios.de
> https://lists.berlios.de/mailman/listinfo/opensim-users
>


-- 
Justin Clark-Casey (justincc)
http://justincc.org/blog
http://twitter.com/justincc



More information about the Opensim-users mailing list