I want to add another 10 child prims to this link set, and I want just THESE 10 to fade out to invisible, and fade in again upon Messagelinked commands. I've got the message linking down fine and it works.
What I don't know how to do is target the new 10 child prims to fade, and leave the original 5 prims alone, including the parent.
Right now I'm testing it out with 1 extra prim added to the linkset, so 6 linked prims all together. I want just this 1 prim to fade in and out. But not only is this 1 prim fading, so are 3 prims from the original link set.
Here's the script in the 1 new fading prim:
float alpha;
float fadespeed = 1.0; //This sets the speed of the fading in and out effect.
integer visible = FALSE;
integer links = 6; //Change this to how many linked objects you have.
integer linknr;
integer thislink;
fadeout()
{
if (visible == TRUE)
{
alpha = llGetAlpha(1)*6;
do
{
++alpha;
do
llSetLinkAlpha(linknr,alpha/6,ALL_SIDES);
while((++linknr)<links);
linknr = thislink;
llSleep(fadespeed);
}
while((integer)alpha<6);
visible = FALSE;
}
}
fadein()
{
if (visible == FALSE)
{
alpha = llGetAlpha(1)*6;
do
{
--alpha;
do
llSetLinkAlpha(linknr,alpha/6,ALL_SIDES);
while((++linknr)<links);
linknr = thislink;
llSleep(fadespeed);
}
while(alpha>0);
visible = TRUE;
}
}
default
{
state_entry()
{
thislink = llGetLinkNumber();
linknr = thislink;
}
link_message(integer sender, integer num, string str, key id)
{
if (str == "hide"

{
fadeout();
}
if (str == "show"

{
fadein();
}
}
}