Jump to content

affect prims in one object by there names


RhaDo2496
 Share

You are about to reply to a thread that has been inactive for 2840 days.

Please take a moment to consider if this thread is worth bumping.

Recommended Posts

You just asked this question in Answers a while ago.  You got one end of an answer there.  Here's the other end.

If you have several child prims with the same name, just make a list of which prims they are.  The economical time to do that is in state_entry, but you could do it anywhere:

 

gLights = [];    // This is a global list you'll need later.integer i;while (i < llGetNumberOfPrims() ){    ++i;    if (llGetLinkName(i) == "LightBulb")    {        gLights += [i];    // Add the link number to your list    }}

Now you have a list of all the links named "LightBulb". When you want to make them all glow (or not glow) at once, you write, for example:

touch_start (integer num){    gON = !gON;    // This is a global integer that you create to use as a switch    list temp;    integer i;    while (i < llGetListLength(gLights))    {        temp += [PRIM_LINK_TARGET,llList2Integer(gLights,i),PRIM_GLOW, gON,0.1];        ++i;    }    llSetLinkPrimitiveParamsFast(LINK_SET,temp);}
Link to comment
Share on other sites

You are about to reply to a thread that has been inactive for 2840 days.

Please take a moment to consider if this thread is worth bumping.

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
 Share

×
×
  • Create New...