Difference between revisions of "User:Daemonika Nightfire/Scripts/LinkNumber-List in llSetLinkPrimitiveParamsFast"

From Second Life Wiki
Jump to navigation Jump to search
Line 5: Line 5:
It is especially interesting when multiple prims are a linksets changed. For example, it must not be written for each link number, a new complete llSetLinkPrimitiveParams. When would be a very large number of prims is too much work.
It is especially interesting when multiple prims are a linksets changed. For example, it must not be written for each link number, a new complete llSetLinkPrimitiveParams. When would be a very large number of prims is too much work.


==Beispiel==
==Example==
Fuer dieses Beispiel habe ich einfach nur 4 Prims miteinander verlinkt und nur 1 script in den root des Linksets gelegt.
For this example I have just only 4 prims linked together and only one script in the root of the linksets laid.
  Ich habe mich fuer die touch Variante entschieden damit man beim klicken auch was zu sehen bekommt :)
  I opted for the touch to click the option to get to see what :)
Viel Spass mit meinem Schnipsel :)
Have fun with my snippet :)
<lsl>
<lsl>
// LinkNumber-List in llSetLinkPrimitiveParamsFast
// LinkNumber-List in llSetLinkPrimitiveParamsFast

Revision as of 07:54, 11 July 2010

LinkNumber-List in llSetLinkPrimitiveParamsFast

With this small script I want to prove that it is possible in llSetLinkPrimitiveParams the link points to put into a list.

It is especially interesting when multiple prims are a linksets changed. For example, it must not be written for each link number, a new complete llSetLinkPrimitiveParams. When would be a very large number of prims is too much work.

Example

For this example I have just only 4 prims linked together and only one script in the root of the linksets laid.

I opted for the touch to click the option to get to see what :)

Have fun with my snippet :) <lsl> // LinkNumber-List in llSetLinkPrimitiveParamsFast // 11. Juli 2010 by Daemonika Nightfire

integer s; list prims = ["2","4"]; default {

   touch_start(integer total_number)
   {
       integer i = ~llGetListLength(prims);
       if(s == FALSE)
       {
           while (++i)
           {
               llSetLinkPrimitiveParamsFast(llList2Integer(prims,i),[PRIM_TEXT,"Hovertext",<1,1,1>,1]);
           }
           s = TRUE;
       }
       else
       {
           while (++i)
           {
               llSetLinkPrimitiveParamsFast(llList2Integer(prims,i),[PRIM_TEXT,"",ZERO_VECTOR,0]);
           }
           s = FALSE;
       }
   }

} </lsl>

Erweitertes Beispiel mit 2 Listen im wechsel

Ebenfalls mit 4 Prims. <LSL> // LinkNumber-List in llSetLinkPrimitiveParamsFast // 11. Juli 2010 by Daemonika Nightfire

integer s; list prims = ["1","3"]; list prims2 = ["2","4"]; default {

   touch_start(integer total_number)
   {
       integer i = ~llGetListLength(prims);
       integer i2 = ~llGetListLength(prims2);
       if(s == FALSE)
       {
           while (++i && ++i2)
           {
               llSetLinkPrimitiveParamsFast(llList2Integer(prims,i),[PRIM_TEXT,"test",<1,1,1>,1]);
               llSetLinkPrimitiveParamsFast(llList2Integer(prims2,i2),[PRIM_TEXT,"",ZERO_VECTOR,0]);
           }
           s = TRUE;
       }
       else
       {
           while (++i && ++i2)
           {
               llSetLinkPrimitiveParamsFast(llList2Integer(prims,i),[PRIM_TEXT,"",ZERO_VECTOR,0]);
               llSetLinkPrimitiveParamsFast(llList2Integer(prims2,i2),[PRIM_TEXT,"test",<1,1,1>,1]);
           }
           s = FALSE;
       }
   }

} </LSL>