Difference between revisions of "LlSetLinkPrimitiveParams"

From Second Life Wiki
Redirect page
Jump to: navigation, search
m (~caveats +useful-snippets workarounds for bugs)
m
 
(22 intermediate revisions by 7 users not shown)
Line 1: Line 1:
{{Issues/SVC-2105}}{{LSL Function/link-face|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.
+
*[[llGetLinkPrimitiveParams]] can be used to get corresponding parameters from linked prims.
+
* [[PRIM_ROTATION]] is bugged in child prims, see [[llSetLinkPrimitiveParams#Useful_Snipptes|Useful Snippets]] for a workaround, or the linked SVC-93 issue below.
+
|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=
+
<lsl>//-- PRIM_ROTATION workaround for child prims (works in unattached objects only)
+
llSetLinkPrimitiveParams( linknumber, [PRIM_ROT_LOCAL, rot * llGetRootRotation()] )
+
+
//-- PRIM_ROTATION workaround for child prims (works in all scenarios)
+
llSetLinkPrimitiveParams( linknumber, [PRIM_ROT_LOCAL, rot * (rotation)((string)llGetLinkPrimitiveParams( LINK_ROOT, [PRIM_ROT_LOCAL] ))] )</lsl>
+
|also_functions=
+
{{LSL DefineRow||[[llSetPrimitiveParams]]|Set many primitive parameters}}
+
{{LSL DefineRow||[[llSetLinkPrimitiveParamsFast]]|Set many primitive parameters without sleep on link objects}}
+
{{LSL DefineRow||[[llGetPrimitiveParams]]|Get many primitive parameters}}
+
{{LSL DefineRow||[[llGetLinkPrimitiveParams]]|Get many primitive parameters of link objects}}
+
{{LSL DefineRow||[[llSetLinkAlpha]]|}}
+
{{LSL DefineRow||[[llSetLinkColor]]|}}
+
{{LSL DefineRow||[[llSetLinkTexture]]|}}
+
|also_tests
+
|also_events
+
|also_articles
+
|notes=
+
===[[PRIM_POSITION]]===
+
{{#var:PRIM_POSITION/SLPP&A}}
+
|cat1=Prim
+
|cat2=Movement
+
|cat3=Status
+
|cat4=Texture
+
|cat5=Object
+
|cat6=Teleport
+
|cat7=Link/Set
+
|cat8=PrimitiveParams
+
}}
+

Latest revision as of 16:37, 12 September 2013