Show/Hide script question
|
|
Chiharu Izutsu
Registered User
Join date: 30 Oct 2006
Posts: 4
|
09-13-2007 15:53
I have an object that I'd like to be able to show and hide upon clicking the object. I have found many scripts with the show/hide command in them but they also have sitting poses or other scripts embedded in them. All I want is the show/hide script portion and I am unfamiliar with how to take this portion of the script and add it to the object by itself. If someone would be so kind as to give me a hand with this, that would be wonderful!  ~Chi
|
|
Auron Reardon
Registered User
Join date: 30 Jun 2006
Posts: 41
|
09-13-2007 16:14
By show/hide if you mean making it visible/invisible, then this should work. If not, then I may have misunderstood.
integer nIsVisible = 1;
default {
touch_start(integer num_detected) { if (nIsVisible == 1) { llSetAlpha(0.0, ALL_SIDES); nIsVisible = 0; } else { llSetAlpha(1.0, ALL_SIDES); nIsVisible = 1; } }
}
|
|
Chiharu Izutsu
Registered User
Join date: 30 Oct 2006
Posts: 4
|
09-13-2007 18:00
Thank you very much!! ^^ But if it's more than one prim how do I get it all the prims to "hide" with just a single click..? If that means a ton of script don't worry about it, I'll just work with the script I have 
|
|
Auron Reardon
Registered User
Join date: 30 Jun 2006
Posts: 41
|
09-13-2007 18:20
Replace:
llSetAlpha(0.0, ALL_SIDES);
and
llSetAlpha(1.0, ALL_SIDES);
with
llSetLinkAlpha(LINK_SET, 0.0, ALL_SIDES);
and
llSetLinkAlpha(LINK_SET, 1.0, ALL_SIDES);
|
|
Chiharu Izutsu
Registered User
Join date: 30 Oct 2006
Posts: 4
|
09-13-2007 18:55
You are fantastic!
|
|
Samara Kasshiki
Registered User
Join date: 28 Sep 2006
Posts: 30
|
Thanks from another non-scripter
11-12-2007 11:15
Just wanted to say that this was EXACTLY what I was looking for!!! and thanks. Of course I spent a VERY long time with trial and error before I found this. So much smarter if slightly painfully so.
|
|
Kitoth Beck
Registered User
Join date: 22 Sep 2007
Posts: 7
|
11-22-2007 10:36
I'd like a little help myself with a hide/show script. someone made one for me for a pair of male bits but when i got new bits that did not have them i tried the script and it would not work. so is there something i did wrong?
|
|
DoteDote Edison
Thinks Too Much
Join date: 6 Jun 2004
Posts: 790
|
11-22-2007 13:58
What didn't work about it? Here's an abridged version that should work: From: someone integer switch;
default { touch_start(integer num) { llSetLinkAlpha(LINK_SET, switch, ALL_SIDES); switch = !switch; } }
|
|
Kitoth Beck
Registered User
Join date: 22 Sep 2007
Posts: 7
|
11-22-2007 19:58
From: DoteDote Edison What didn't work about it? Here's an abridged version that should work: Well here is the script made for an older male bit i was given since that had no hide/show one: string fang; default { state_entry() { fang = "hide"; llListen(1,"",llGetOwner(),"!bit"  ; } listen(integer c,string n,key i,string m) {if(fang == "hide"  {fang = "show"; llSetAlpha(1, ALL_SIDES);} else{fang = "hide";llSetAlpha(0, ALL_SIDES);} } } That one added a /1 !bit to hide and show but this new male bit uses a two feature method /1 with 5 choices and then /7 with 4 choices, and i put the script in and nothing.
|
|
Jesse Barnett
500,000 scoville units
Join date: 21 May 2006
Posts: 4,160
|
11-22-2007 20:15
Just wanted to let you and "fang" know that you nearly put me in the hospital. Sitting here eating leftovers from Thanksgiving dinner when I looked at your script. Needless to say the turkey went down the wrong way and it took quite a while to recover.
_____________________
I (who is a she not a he) reserve the right to exercise selective comprehension of the OP's question at anytime. From: someone I am still around, just no longer here. See you across the aisle. Hope LL burns in hell for archiving this forum
|