Difference between revisions of "LlGetAttachedList"
Jump to navigation
Jump to search
Simon Linden (talk | contribs) |
|||
(8 intermediate revisions by 5 users not shown) | |||
Line 5: | Line 5: | ||
|func_sleep | |func_sleep | ||
|func_energy | |func_energy | ||
|func= | |func=llGetAttachedList | ||
|func_desc | |func_desc | ||
|p1_type=key|p1_name=avatar|p1_desc | |p1_type=key|p1_name=avatar|p1_desc | ||
|return_type=list|return_text=of public attachments worn by an {{LSLPT|avatar}}. | |return_type=list|return_text=of object keys corresponding to public attachments worn by an {{LSLPT|avatar}}. | ||
|func_footnote= | |func_footnote=By design HUD attachment keys are not reported by this function.<br/> <br/> | ||
If avatar is a child agent, ["NOT ON REGION"] is returned.<br/> | |||
If avatar is not a main agent and not a child agent or not an agent at all, ["NOT FOUND"] is returned. | |||
|spec | |spec | ||
|caveats | |caveats=<br> | ||
|examples | When an avatar first arrives in a region, there is a brief period when their attachments are not yet fully rezzed or added. During this time, those attachments will not appear in the results. | ||
</br></br> | |||
|examples=<source lang="lsl2"> | |||
// Touch to list all attachments | |||
default | |||
{ | |||
touch_start(integer total_number) | |||
{ | |||
list AttachedNames; | |||
list AttachedUUIDs = llGetAttachedList(llDetectedKey(0)); | |||
integer i; | |||
while (i < llGetListLength(AttachedUUIDs) ) | |||
{ | |||
list temp = llGetObjectDetails(llList2Key(AttachedUUIDs,i),[OBJECT_NAME]); | |||
AttachedNames += [llList2String(temp,0)]; | |||
++i; | |||
} | |||
llSay(PUBLIC_CHANNEL,"\n" + llDumpList2String(AttachedNames,"\n")); | |||
} | |||
} | |||
</source> | |||
|spec | |spec | ||
|helpers | |helpers | ||
|also_functions={{LSL DefineRow||[[llGetAttached]]}} | |also_functions={{LSL DefineRow||[[llGetAttached]]}} | ||
Line 26: | Line 47: | ||
|notes | |notes | ||
|history= | |history= | ||
{{LSL DefineRow|20/Dec/08|{{Jira|SVC-3560}}|llQueryAvatarAttachments Suggested}} | |||
{{LSL DefineRow|30/Apr/13|{{Jira|BUG-2467}}|llGetAttachedList Suggested}} | |||
{{LSL DefineRow|14/Jul/15|{{Jira|BUG-9683}}|llGetAttachedList Suggested again}} | |||
|cat1=Attachment | |cat1=Attachment | ||
|cat2 | |cat2=Avatar | ||
|cat3 | |cat3 | ||
|cat4 | |cat4 | ||
}} | }} |
Revision as of 11:36, 2 January 2024
LSL Portal | Functions | Events | Types | Operators | Constants | Flow Control | Script Library | Categorized Library | Tutorials |
Summary
Function: list llGetAttachedList( key avatar );Returns a list of object keys corresponding to public attachments worn by an avatar.
• key | avatar | – | avatar UUID that is in the same region |
By design HUD attachment keys are not reported by this function.
If avatar is a child agent, ["NOT ON REGION"] is returned.
If avatar is not a main agent and not a child agent or not an agent at all, ["NOT FOUND"] is returned.
Caveats
When an avatar first arrives in a region, there is a brief period when their attachments are not yet fully rezzed or added. During this time, those attachments will not appear in the results.
Examples
// Touch to list all attachments
default
{
touch_start(integer total_number)
{
list AttachedNames;
list AttachedUUIDs = llGetAttachedList(llDetectedKey(0));
integer i;
while (i < llGetListLength(AttachedUUIDs) )
{
list temp = llGetObjectDetails(llList2Key(AttachedUUIDs,i),[OBJECT_NAME]);
AttachedNames += [llList2String(temp,0)];
++i;
}
llSay(PUBLIC_CHANNEL,"\n" + llDumpList2String(AttachedNames,"\n"));
}
}
See Also
Events
• | attach |
Functions
• | llGetAttached | |||
• | llAttachToAvatar | |||
• | llDetachFromAvatar | |||
• | llAttachToAvatar | |||
• | llGetObjectDetails | – | OBJECT_ATTACHED_POINT |