G Geral

Apply root alpha to child prims [Full Perm] Versão 1.0

Apply root alpha to child prims [Full Perm]
Detalhes
Destaques
Conteúdo
Resenhas

I have a hobby of futzing small scripts together occasionally for my purposes. I've always wanted to release these, but can't find the time/money/will to start a website around it, so I'm listing them here.
_____

I'm no stranger to ripping out the (script) guts from a cool gun or sword to put in my own gun for (un)sheathing/animation/roleplay purposes. This doesn't always work out swimmingly when said no-mod script assumes it only has to hide/unhide the root prim in question.
This has led to some cool gun designs being tossed aside as being unusable with the weapon system I want to use if their design is made out of multiple mesh objects that are linked together.

With this script, such problems are a thing of the past. Put in any object, this script will detect specifically if the root prim's alpha has actively changed by something. If it's made wholly invisible, it mirrors this to all child prims, and vice versa when made visible.

Special credit goes to the meticulously maintained LSL wiki from which I wholly cobbled this together using their examples and explanations.

Like before, the full code is available below for free, because, in the wise words of Joel Haver:
"Art should be in the hands of everyone. We shouldn't have to break our backs and our wallets and waste our lives to make it."

default
{
changed(integer change)
{

if (change & CHANGED_COLOR)
{
if (llGetAlpha(0))
{
llSetLinkAlpha(LINK_ALL_CHILDREN, 1.0, ALL_SIDES);
llResetScript();
}
else
{
llSetLinkAlpha(LINK_ALL_CHILDREN, 0.0, ALL_SIDES);
llResetScript();
}
}
}
}

As usual, you're free to still buy it for 15L$. The script you'll buy this way is also Full Perms and will have convenient //comments written in to help explain the functioning of the script to you. If you have no need for this, the code above should perfectly suffice.

Every L$ purchase is a sort of donator's "thank you" in a sense, you're not obligated to buy it. There's no licensing requirement, nothing of the sort. It's yours to do with as you please.

The code's right there, do something fun with it. Now get out there and make cool things.

  • When a root prim's alpha flips between transparent or visible...
  • ...repeats this to all child prims
  • Includes instructions on how to do this only for specific child prims