Advertisement
Edie_Shoreland

Roz's Linked Information Script

Mar 27th, 2019
727
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. //Roz's Link Information Script
  2.  
  3. //Sends out llSetLinkPrimitiveParams and link information to your
  4. //chat window and records it in the object link descriptions so you
  5. //can compare builds, and paste the output into scripts.
  6.  
  7. //If you're making a HUD with moving parts, or you want linked prims
  8. //to shrink, expand or hide on a timer (or touch) this tells you the
  9. //link numbers (in the link description) and gives you the links'
  10. //relationship to the root prim. The information is limited to position,
  11. //size, and rotation.
  12.  
  13. integer primz;
  14. integer a;
  15. integer spamzy = FALSE;
  16.  
  17. primLink()
  18. {
  19.     string strA;
  20.     list posinfo;
  21.     string descinfo;
  22.     for (a=2; a<=primz; a++)
  23.     //Gets information for every link, except the root.
  24.     {
  25.         strA = (string)a;
  26.         posinfo = llGetLinkPrimitiveParams(a,[PRIM_POS_LOCAL,PRIM_SIZE,PRIM_ROT_LOCAL]);
  27.         descinfo = llList2CSV(posinfo);
  28.         llOwnerSay ("llSetLinkPrimitiveParamsFast (" + strA + ", [PRIM_POS_LOCAL," + llList2String(posinfo,0) + ", PRIM_SIZE," + llList2String(posinfo,1) + ", PRIM_ROT_LOCAL," + llList2String(posinfo,2) + "]);");
  29.         llSetLinkPrimitiveParams(a,[PRIM_DESC,"Link "+ strA + ": " + descinfo ] );
  30.     }
  31. }
  32.  
  33. default
  34. {
  35.     state_entry()
  36.     {
  37.         llOwnerSay ("Touch this object to update link information");
  38.         primz = llGetObjectPrimCount(llGetKey());
  39.         primLink();
  40.     }
  41.  
  42.     changed(integer change)
  43.     {
  44.         //If multiple changes to link order are made, there's no
  45.         //need to continuously spam the owner with updates.
  46.         if (spamzy == FALSE)
  47.         {
  48.             if (change & (CHANGED_LINK | CHANGED_SCALE))
  49.             {
  50.                 llOwnerSay ("Touch me, once you're finished editing, to update the object's link information.");
  51.                 spamzy = TRUE;
  52.             }
  53.         }    
  54.     }
  55.  
  56.     touch_start(integer total_number)
  57.     {
  58.         //Let's update the information for all links
  59.         llResetScript();
  60.         //Thanks to the Brewers who took the time to test and
  61.         //give feedback on this script.
  62.     }
  63. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement