Difference between revisions of "LlSetLinkPrimitiveParams"

From Second Life Wiki
Jump to navigation Jump to search
(Can get rot and pos using llGetObjectDetails)
m
 
(30 intermediate revisions by 11 users not shown)
Line 1: Line 1:
{{LSL Function/link|linknumber}}{{LSL Function
#redirect[[llSetPrimitiveParams#llSetLinkPrimitiveParams]]
|func_id=328|func_sleep=0.2|func_energy=10.0
{{:llSetPrimitiveParams|default=llSetLinkPrimitiveParams}}
|func=llSetLinkPrimitiveParams|sort=SetLinkPrimitiveParams
|p1_type=integer|p1_name=linknumber
|p2_type=list|p2_name=rules
|func_desc=Set primitive parameters for '''linknumber''' based on '''rules'''.
|spec
|caveats=*Applying an operation to [[LINK_SET]] is applied first to the root prim, then to each child prim.
*The sim will clamp attributes before storing them.
*The client will clamp attributes before rendering.
*There is currently no corresponding [[llGetLinkPrimitiveParams]] although [[llGetObjectDetails]] can get the position and rotation of a linked prim identified by its key.
**The only way to get many parameters from linked prims is to put a separate script in each child and use [[llMessageLinked|linked messages]].
|constants={{LSL Constants/PrimitiveParams|set|remote=true}}
|examples =
A simple script to light up a prim in a [[linkset]] when touched, and unlight the others using llSetLinkPrimitiveParams, when script is installed in the root prim of the linkset.
<lsl>
default
{
    touch_start(integer total_number)
    {
        // Turn off all prims
        llSetLinkPrimitiveParams(LINK_SET,[PRIM_FULLBRIGHT,ALL_SIDES,FALSE]);
        // Turn on the one that was touched
        llSetLinkPrimitiveParams(llDetectedLinkNumber(0),[PRIM_FULLBRIGHT,ALL_SIDES,TRUE]);       
    }
}
</lsl>
|helpers
|also_functions=
{{LSL DefineRow||[[llSetPrimitiveParams]]|Set many primitive parameters}}
{{LSL DefineRow||[[llGetPrimitiveParams]]|Get many primitive parameters}}
{{LSL DefineRow||[[llSetLinkAlpha]]|}}
{{LSL DefineRow||[[llSetLinkColor]]|}}
{{LSL DefineRow||[[llSetLinkTexture]]|}}
|also_tests
|also_events
|also_articles
|notes=
Note that avatars sitting on the object can be moved with this function as well. See [[llSitTarget#Useful_Snippets]] for an example of this.
 
The Mis-feature of using this function to move avatars 54 meters is now officialy supported according to Andrew Linden (see jira Link http://jira.secondlife.com/browse/SVC-3408?focusedCommentId=88574#action_88574 )
 
The below example moves avatar to x,y,z without moving the prim they are sitting on.  If x,y,z is more than 54 meters away the function will silently fail. Remember x,y,z is in object ralative coordinates just like any other linked prim in a set.
 
Agents are always the last prim in the set, so using llGetNumberOfPrims() for a single agent sitting on a vehicle is usefull.
 
Example Code : llSetLinkPrimitiveParams(llGetNumberOfPrims(), [PRIM_POSITION, <x,y,z>]);
 
Darling Brody (27/11/2008)
 
|cat1=Prim
|cat2=Movement
|cat3=Status
|cat4=Texture
|cat5=Object
|cat6=Teleport
|cat7=Link/Set
|cat8
}}

Latest revision as of 16:37, 12 September 2013