Jump to content

llAttachToAvatar


RhaDo2496
 Share

You are about to reply to a thread that has been inactive for 2694 days.

Please take a moment to consider if this thread is worth bumping.

Recommended Posts

Yes.  You may use either llAttachToAvatar or llAttachToAvatarTemp, depending on whether the object that you want to attach already belongs to the avatar or you are just "loaning" it to the avatar temporarily.  In either case, you cannot attach an object without first requesting and receiving permission with llRequestPermissions(av_UUID,PERMISSION_ATTACH).  You'll find descriptions in the LSL wiki.

In order to attach any object you will first need to rez it in world.  Your HUD, in this case, acts as the rezzer. As it creates the object, the rezzer can pass information (in its start parameter or as a chat message) to a script in the object that will do the job of requesting permission and then attaching. So, your final project consists of writing at least two scripts: (1) A HUD script that includes a rezzing function and (2) a script to attach the new object, to be placed in the object itself.

Link to comment
Share on other sites

The only way to do it without rezzing the object is if the avatar using the HUD is using RLV, and uses shared folders.

Then, you can have the HUD 

  1. Check to see if a shared folder exists in the agent's inventory and, if so, if it contains the item you want to attach.
  2. If so, use RLV to force-attach the object.
  3. If the shared folder exists, but doesn't contain the item you want,
  4. Use RLV to set notifications if the avatar accepts an inventory offer, and then use llGiveInventoryList to place the item in the shared folder
  5. On receiving notification that the item has been accepted, then use RLV to force-attach it.

You need a pretty good understanding of  RLV in general and (in particular) of how shared folders work to write a script that can correctly interpret and form the appropriate shared folder commands and responses.    And if the agent doesn't use RLV or doesn't have a shared folder (or doesn't accept the inventory folder offer) then it won't work.

Link to comment
Share on other sites

You are about to reply to a thread that has been inactive for 2694 days.

Please take a moment to consider if this thread is worth bumping.

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
 Share

×
×
  • Create New...