Edie_Shoreland icon

Example Snapback script

Edie_Shoreland | PRO | 02/21/19 04:10:10 AM UTC | 0 ⭐ | 9359 👁️ | Never ⏰ | []
Linden Scripting |

0 B

|

None

|

0 👍

/

0 👎

//This is an example of how to "snap back" elements of a
//necklace or hip chain back to their original size after
//the entire object has been resized to fit the user's 
//shape. It puts more space between the links rather than
//increasing them in size.
 
//This script was originally used in a candy hip chain to
//keep the "candy" in the hip chain the same size as the
//candy in the necklace when the hip chain was fitted to
//larger bodies.
 
//The principles can be tailored towards specific elements
//in a build if you want to allow the user to mod the item
//with the option of an "Undo" or to allow the user to in-
//crease the area of a build without resizing the individual
//elements.
 
vector origsize = <0.02630, 0.01175, 0.02630>;
//This is the size I want the "candy" for both objects
 
default
{
    changed(integer change)
    {
        if (change & CHANGED_SCALE) 
        {
            llSetLinkPrimitiveParamsFast(LINK_ALL_OTHERS,[PRIM_SIZE, origsize]);
            //If you want different sizes for various prims, you can always store
            //sizes for each link in the script with llObjectPrimCount, a loop, 
            //and llGetLinkPrimitiveParams(counter,[PRIM_SIZE]) in state_entry().
        }
 
    }
}

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

    |

    👍

    /

    👎