Item not going invisable
|
|
Klaire Larnia
Learner, be gentle....
Join date: 2 Jun 2008
Posts: 41
|
05-20-2009 22:14
Hi, I am trying to make a prim turn phantom and invisbible when I click on it. I have come up with this so far: default { state_entry() { llSay(0, "Hello!"); }
touch_start(integer total_number) { llSetAlpha (0.0, ALL_SIDES) ; llSetPrimitiveParams([PRIM_PHANTOM, TRUE]); llSleep(10.0); llSetAlpha (1.0, ALL_SIDES) ; llSetPrimitiveParams([PRIM_PHANTOM, FALSE]);
} }
This should (from my understanding) turn the prim invisable by setting the Alpha channel to 0, then make it phantom. Wait 10 seconds and put it back to normal. The script is making the item phantom but not invisable. Is there a reason for this as I see you can do it via the llSetPrimativeParams command too but the Alpha one makes more sense, Acutally the SetPrimativeParams does not work either for me  Any ideas or thoughts as to what is wrong are appriecated. Thanks, Klaire
|
|
Viktoria Dovgal
…
Join date: 29 Jul 2007
Posts: 3,593
|
05-20-2009 23:05
What version of SL are you using? There is a bug in the current RCs that makes settings like this sticky until you joggle the camera or select the object.
|
|
Winter Ventura
Eclectic Randomness
Join date: 18 Jul 2006
Posts: 2,579
|
05-20-2009 23:32
I added some "says" so you can see where the script is while it's running, and what it's doing.
default { state_entry() { llSay(0, "Ready!"); // <----- Debug }
touch_start(integer total_number) { llSay(0, "Setting Invisible"); // <----- Debug llSetAlpha (0.0, ALL_SIDES) ; llSetPrimitiveParams([PRIM_PHANTOM, TRUE]); llSay(0, "Pausing..."); // <----- Debug llSleep(10.0); llSay(0, "Setting Visible"); // <----- Debug llSetAlpha (1.0, ALL_SIDES) ; llSetPrimitiveParams([PRIM_PHANTOM, FALSE]); llSay(0, "Done"); // <----- Debug } }
Yeap.. it's working fine for me... but I'm not using the RC.
_____________________
 ● Inworld Store: http://slurl.eclectic-randomness.com ● Website: http://www.eclectic-randomness.com ● Twitter: @WinterVentura
|
|
Klaire Larnia
Learner, be gentle....
Join date: 2 Jun 2008
Posts: 41
|
05-21-2009 00:30
I am on the latest RC version... so that could be it then. I will install the standard viewer on my laptop when I get home from work and see how it looks on that in case. thanks for the help. nice to know I got the code right being new to scripting. that is a good sign  Klaire.
|
|
Cheree Bury
ChereeMotion Owner
Join date: 6 Jun 2007
Posts: 666
|
05-21-2009 05:17
I'm not in world right now and won't try to code it here, but I would replace that llSleep call with an llSetTimerEvent and then make the prim reappear in the timer event.
_____________________
Visit ChereeMotion - Life's Best Pinup Poses http://slurl.com/secondlife/Wild%20Rice/38/230/51
|
|
Hewee Zetkin
Registered User
Join date: 20 Jul 2006
Posts: 2,702
|
05-21-2009 08:37
Is this a single prim object? Are you expecting one prim to become transparent, or all of them?
|
|
Rolig Loon
Not as dumb as I look
Join date: 22 Mar 2007
Posts: 2,482
|
05-21-2009 11:11
Klaire -- If you are changing more than one prim property at a time, it can sometimes be easier to use llSetPrimitiveParams and put the multiple changes in a single statement, like this ..... llSetPrimitiveParams([PRIM_COLOR,ALL_SIDES,<1,1,1>,0.0,PRIM_PHANTOM, TRUE]) will set the prim to transparent and phantom at the same time, and ..... llSetPrimitiveParams([PRIM_COLOR,ALL_SIDES,<1,1,1>,1.0,PRIM_PHANTOM, FALSE]) will make it opaque and non-phantom. I don't know whether changing transparency this way instead of llSetAlpha will make any difference (it shouldn't), but at least this is an option you should be aware of.
_____________________
It's hard to tell gender from names around here but if you care, Rolig = she. And I exist only in SL, so don't ask....  Look for my work in XStreetSL at 
|
|
Ruthven Willenov
Darkness in your light
Join date: 16 Jan 2008
Posts: 965
|
05-21-2009 11:15
From: Rolig Loon [PRIM_COLOR,ALL_SIDES,<1,1,1>,1.0 that would work if all the sides need to stay white, if all the sides are the same color (other than white) you could change the vector to match. however, if they're different colors, i recommend you continue using llSetAlpha
|
|
Klaire Larnia
Learner, be gentle....
Join date: 2 Jun 2008
Posts: 41
|
05-21-2009 11:20
Hi thanks for the extra replies. It is just one prim I am changing and it is pathcut to be a slice of the main prim so there is no problem with the colour/texture.
Handly to know the PrimsPArams can do colour/transparency/phantom in one go. Not needed at the moment but usefull to store away for later on.
Thanks again for the comments, always helpful and usefull to someone like me who is learning in slow but steady steps.
Klaire
|
|
Void Singer
Int vSelf = Sing(void);
Join date: 24 Sep 2005
Posts: 6,973
|
05-21-2009 11:30
the fact that they choose to tie the prim params alpha call to the color call, still makes me shake my head...
_____________________
| | . "Cat-Like Typing Detected" | . This post may contain errors in logic, spelling, and | . grammar known to the SL populace to cause confusion | | - Please Use PHP tags when posting scripts/code, Thanks. | - Can't See PHP or URL Tags Correctly? Check Out This Link... | - 
|