|
Glitch Colonial
Registered User
Join date: 10 Oct 2006
Posts: 3
|
01-22-2007 03:58
I've got a little problem with a creation of mine. I'm making a weapon that needs to be able to show single linked prims (that're invisible when rezzed) when the safety is off. I know how to make a linked object invisible via the use of trigger words, but I need to be able to let seperate prims get visible in a linked object without having to make two seperate versions of the weapon.
The concept is generally known to be used for certain types of male animal genitalia where you (again via the use of triggerwords) can make it drop, get aroused, sheath and such. This is a linked object that typically consists of 30 prims in a single object and such only attached to a single spot (the pelvis usually).
I hope there's a helpful and enlightened person that're willing to help me out.
|
|
Newgate Ludd
Out of Chesse Error
Join date: 8 Apr 2005
Posts: 2,103
|
01-22-2007 04:06
From: Glitch Colonial I've got a little problem with a creation of mine. I'm making a weapon that needs to be able to show single linked prims (that're invisible when rezzed) when the safety is off. I know how to make a linked object invisible via the use of trigger words, but I need to be able to let seperate prims get visible in a linked object without having to make two seperate versions of the weapon.
The concept is generally known to be used for certain types of male animal genitalia where you (again via the use of triggerwords) can make it drop, get aroused, sheath and such. This is a linked object that typically consists of 30 prims in a single object and such only attached to a single spot (the pelvis usually).
I hope there's a helpful and enlightened person that're willing to help me out. llSetLinkAlpha
|
|
Glitch Colonial
Registered User
Join date: 10 Oct 2006
Posts: 3
|
Thanks but I'm a nut
01-22-2007 04:21
#2 Thanks for the fast reply. I'm good at buildin' but I'm a complete nut at writing scripts.  I was sorta hoping for a short walkthrough of how to get the script to work.
|
|
Newgate Ludd
Out of Chesse Error
Join date: 8 Apr 2005
Posts: 2,103
|
01-22-2007 05:10
From: Glitch Colonial #2 Thanks for the fast reply. I'm good at buildin' but I'm a complete nut at writing scripts.  I was sorta hoping for a short walkthrough of how to get the script to work. basically you need to know the link number of the item being made visible/invisible. You can either hard code it or set it up dynamically. Dynamically Is obviously best although it can lead to complications. Once you have the link numbers you just call llSetlinkAlpha with the appropriate value when you want to show or hide the prim The following code uses the name of a prim to know if it should be hidden or not
integer Show = TRUE;
list PrimsToManipulate;
GetPrimNumbers() { integer a = llGetNumberOfPrims(); while(a > 0) { string str = llGetLinkName(a); if(str == "~HIDEME~") { PrimsToManipulate = (PrimsToManipulate = []) + PrimsToManipulate + [a]; } --a; } }
HideShowPrims(float alpha) { integer a = llGetListLength(PrimsToManipulate); while(a > 0) { llSetLinkAlpha(a,alpha,ALL_SIDES); --a; } }
default { state_entry() { GetPrimNumbers(); HideShowPrims(1.0); }
touch_start(integer total_number) { Show = !Show; if(Show)HideShowPrims(1.0); else HideShowPrims(0.0); } }
There are other ways to do this as well though. You could have a script in the prim you want to hide that responds to a specific linked Message and sets its own alpha accordingly. This would allow for different 'trigger' message s to show or hide different prims.
|