SHARE
TWEET

Example Snapback script

Edie_Shoreland Feb 20th, 2019 (edited) 21 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. //This is an example of how to "snap back" elements of a
  2. //necklace or hip chain back to their original size after
  3. //the entire object has been resized to fit the user's
  4. //shape. It puts more space between the links rather than
  5. //increasing them in size.
  6.  
  7. //This script was originally used in a candy hip chain to
  8. //keep the "candy" in the hip chain the same size as the
  9. //candy in the necklace when the hip chain was fitted to
  10. //larger bodies.
  11.  
  12. //The principles can be tailored towards specific elements
  13. //in a build if you want to allow the user to mod the item
  14. //with the option of an "Undo" or to allow the user to in-
  15. //crease the area of a build without resizing the individual
  16. //elements.
  17.  
  18. vector origsize = <0.02630, 0.01175, 0.02630>;
  19. //This is the size I want the "candy" for both objects
  20.  
  21. default
  22. {
  23.     changed(integer change)
  24.     {
  25.         if (change & CHANGED_SCALE)
  26.         {
  27.             llSetLinkPrimitiveParamsFast(LINK_ALL_OTHERS,[PRIM_SIZE, origsize]);
  28.             //If you want different sizes for various prims, you can always store
  29.             //sizes for each link in the script with llObjectPrimCount, a loop,
  30.             //and llGetLinkPrimitiveParams(counter,[PRIM_SIZE]) in state_entry().
  31.         }
  32.  
  33.     }
  34. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top