<HTML><HEAD></HEAD>
<BODY dir=ltr>
<DIV dir=ltr>
<DIV style="FONT-SIZE: 12pt; FONT-FAMILY: 'Calibri'; COLOR: #000000">
<DIV style="FONT-FAMILY: ; COLOR: ">
<DIV><FONT style='face: "Times' New roman?>List,</FONT></DIV>
<DIV><FONT style='face: "Times' New roman?></FONT> </DIV>
<DIV><FONT style='face: "Times' New roman?>I found a post and a response to the
post from Justin that suggests the several OSSL functions on “attachments” will
work for NPC’s.</FONT></DIV>
<DIV><A
title=http://opensim-users.2152040.n2.nabble.com/Dynamically-attaching-objects-to-NPCs-td7579601.html
style='href: "http://opensim-users.2152040.n2.nabble.com/Dynamically-attaching-objects-to-NPCs-td7579601.html"'>http://opensim-users.2152040.n2.nabble.com/Dynamically-attaching-objects-to-NPCs-td7579601.html</A></DIV>
<DIV><FONT style='face: "Times' New roman?><FONT style="face: calibri">I have
tried several variations to using these OSSL functions and they all work fine to
put an attachment on an avatar.</FONT></FONT></DIV>
<DIV><FONT style='face: "Times' New roman?><FONT style="face: calibri">I have
not been successful at putting an attachment on an NPC.</FONT></FONT></DIV>
<DIV>I chose to test with the <FONT style='face: "Times' New
roman?>osForceAttachToOtherAvatarFromInventory function.</FONT></DIV>
<DIV>I tested with both “owned” and “un-owned” NPC’s.</DIV>
<DIV><FONT style='face: "Times' New roman?><FONT
style="face: calibri"></FONT></FONT> </DIV>
<DIV><FONT style='face: "Times' New roman?><FONT style="face: calibri">Here is
an edited email I sent to Justin who asked I ask this question here on the
list.</FONT></FONT></DIV>
<DIV><FONT style='face: "Times' New roman?><FONT
style="face: calibri"></FONT></FONT> </DIV>
<DIV><FONT style='face: "Times' New roman?>> I read in a post you made
sometime ago where you implied you could use the OSSL function
osForceAttachToAvatarFromInventory and<BR>> the other OSSL commands as
well.<BR>> The original post suggested a way to attach using an lsl function
which I have not yet tried. Your suggestion was to use the OSSL
functions.<BR>> I have tried doing the following:<BR>> create a box and
place the script below in it.<BR>> create another box named “testbox”, and
put it in the first box along with the script.<BR>> I have then tried using
“box 1” in these ways.<BR>> - place it on the ground and touch it<BR>> -
wear it and touch it<BR>> - wear it and clone myself, and then touch it on my
cloned NPC.<BR>> None of these will attach the “testbox” to the NPC.<BR>>
They all attach it to my real avatar.<BR>> Did attaching an object to an NPC
work in the past? Is it broken in the release OSGrid put out Aug. 16,
2014?<BR>> Tom Ringate</FONT></DIV>
<DIV><FONT style='face: "Times' New roman?><BR>> Here is the script:<BR>>
//XEngine:lsl<BR>> string name = "NPC Mate test box ";<BR>> string version
= "V2.2";<BR>> list avatars = [];<BR>> key victim =
"aaefe00e-724a-4346-83df-92fa615b009f";<BR>> /* NPC Genie - id - V2.2<BR>>
* Licensed under the GPLv2, with the additional requirement that these scripts
remain "full perms".<BR>> *<BR>> */<BR>> /*** FUNCTIONS ***/<BR>>
/*** CODE ***/<BR>> default<BR>> {<BR>>
state_entry()<BR>>
{<BR>>
if(!llGetAttached()) llSetObjectName(name +
version);<BR>> else
llSetObjectName(llKey2Name(llGetOwner()));<BR>>
}<BR>> touch_start(integer
iNum)<BR>>
{<BR>> llSay(0,"You
touched me.");<BR>>
avatars = osGetAvatarList(); // get list of avatars on
region<BR>> llSay(0,
"Avatars in this sim (without the owner): " +
llList2CSV(avatars));<BR>>
victim =
llList2Key(avatars,0);<BR>>
if(osIsNpc(victim) ==
TRUE)<BR>>
{<BR>>
llSay(0, "Victim is Genie: " + victim);<BR>>
osForceAttachToOtherAvatarFromInventory(victim, "testbox",
ATTACH_PELVIS);<BR>>
}<BR>>
else<BR>>
{<BR>>
victim =
llGetOwner();<BR>>
llSay(0, "Victim is Avatar: " + victim);<BR>>
osForceAttachToAvatarFromInventory("testbox",
ATTACH_PELVIS);<BR>>
}<BR>> // llSleep(5);<BR>>
//
osForceDropAttachment();<BR>>
}<BR>> on_rez(integer
iParam)<BR>>
{<BR>>
llResetScript();<BR>> }<BR>>
}</FONT><BR></DIV></DIV></DIV></DIV></BODY></HTML>