Category:LSL Link/Get - Second Life Wiki

Category:LSL Link/Get

From Second Life Wiki

Second Life Wiki > LSL Portal > LSL Link/Get
Jump to: navigation, search

Template:Needs Translation/LSL/de Template:Needs Translation/LSL/es Template:Needs Translation/LSL/el Template:Needs Translation/LSL/fr Template:Needs Translation/LSL/he Template:Needs Translation/LSL/it Template:Needs Translation/LSL/ja Template:Needs Translation/LSL/ko Template:Needs Translation/LSL/nl Template:Needs Translation/LSL/hu Template:Needs Translation/LSL/no Template:Needs Translation/LSL/da Template:Needs Translation/LSL/sv Template:Needs Translation/LSL/tr Template:Needs Translation/LSL/pl Template:Needs Translation/LSL/pt Template:Needs Translation/LSL/ru Template:Needs Translation/LSL/uk Template:Needs Translation/LSL/zh-Hans Template:Needs Translation/LSL/zh-Hant

Useful Snippets

list GetLinkDetails(integer link, list OBJECT_FLAGS)
{//simple wrapper
    return llGetObjectDetails(llGetLinkKey(link), OBJECT_FLAGS);
}
 
key GetLinkCreator(integer link)
{
    return llList2Key(llGetObjectDetails(llGetLinkKey(link), (list)OBJECT_CREATOR) + NULL_KEY, 0);
}
 
key GetLinkGroup(integer link)
{
    return llList2Key(llGetObjectDetails(llGetLinkKey(link), (list)OBJECT_GROUP) + NULL_KEY, 0);
}
 
string GetLinkDesc(integer link)
{
    return (string)llGetObjectDetails(llGetLinkKey(link), (list)OBJECT_DESC);
}
 
vector GetLinkLocalPos(integer link)
{//This function may not produce a perfect result, expect there to be some drift. This will not work in attachments.
    vector pos = llGetRootPosition();
    if(llGetLinkNumber() > 1)
        return (llList2Vector(llGetObjectDetails(llGetLinkKey(link), (list)OBJECT_POS) + pos, 0) - pos) / llGetRootRotation();
    return pos;
}
 
rotation GetLinkLocalRot(integer link)
{//This function may not produce a perfect result, expect there to be some drift. This will not work in attachments.
    rotation rot = llGetRootRotation();//There is no llGetAttachmentRot :(
    if(llGetLinkNumber() > 1)
        return llList2Rot(llGetObjectDetails(llGetLinkKey(link), (list)OBJECT_ROT) + rot, 0) / rot;
    return rot;
}

Pages in category "LSL Link/Get"

The following 2 pages are in this category, out of 2 total.

G