Edie_Shoreland icon

Roz's Linked Information Script

Edie_Shoreland | PRO | 03/27/19 11:56:00 AM UTC | 0 ⭐ | 9625 👁️ | Never ⏰ | []
Linden Scripting |

0 B

|

None

|

0 👍

/

0 👎

//Roz's Link Information Script
 
//Sends out llSetLinkPrimitiveParams and link information to your
//chat window and records it in the object link descriptions so you
//can compare builds, and paste the output into scripts.
 
//If you're making a HUD with moving parts, or you want linked prims
//to shrink, expand or hide on a timer (or touch) this tells you the
//link numbers (in the link description) and gives you the links' 
//relationship to the root prim. The information is limited to position,
//size, and rotation.
 
integer primz;
integer a;
integer spamzy = FALSE;
 
primLink()
{
    string strA;
    list posinfo;
    string descinfo;
    for (a=2; a<=primz; a++) 
    //Gets information for every link, except the root.
    {
        strA = (string)a;
        posinfo = llGetLinkPrimitiveParams(a,[PRIM_POS_LOCAL,PRIM_SIZE,PRIM_ROT_LOCAL]);
        descinfo = llList2CSV(posinfo);
        llOwnerSay ("llSetLinkPrimitiveParamsFast (" + strA + ", [PRIM_POS_LOCAL," + llList2String(posinfo,0) + ", PRIM_SIZE," + llList2String(posinfo,1) + ", PRIM_ROT_LOCAL," + llList2String(posinfo,2) + "]);");
        llSetLinkPrimitiveParams(a,[PRIM_DESC,"Link "+ strA + ": " + descinfo ] );
    }
}
 
default
{
    state_entry()
    {
        llOwnerSay ("Touch this object to update link information");
        primz = llGetObjectPrimCount(llGetKey());
        primLink();
    }
 
    changed(integer change)
    {
        //If multiple changes to link order are made, there's no
        //need to continuously spam the owner with updates.
        if (spamzy == FALSE)
        {
            if (change & (CHANGED_LINK | CHANGED_SCALE))
            {
                llOwnerSay ("Touch me, once you're finished editing, to update the object's link information.");
                spamzy = TRUE;
            }
        }    
    }
 
    touch_start(integer total_number)
    {
        //Let's update the information for all links
        llResetScript();
        //Thanks to the Brewers who took the time to test and
        //give feedback on this script.
    }
}

Comments

  •  icon
    01/01/70 12:00:00 AM UTC
    Plain Text |

    0 B

    |

    👍

    /

    👎

    
        
  •  icon
    01/01/70 12:00:00 AM UTC
    Plain Text |

    0 B

    |

    👍

    /

    👎

    
        
  •  icon
    01/01/70 12:00:00 AM UTC
    Plain Text |

    0 B

    |

    👍

    /

    👎