Show/Hide Script help
|
|
Jesseaitui Petion
king of polynesia :P
Join date: 2 Jan 2006
Posts: 2,175
|
03-05-2009 23:34
I don`t know much about scripting  I have 1 linked object that is made up of about 15 prims. I would like the user to be able to hide only one prim of the entire object. I think this script is capable of that? I`m guessing it has something to do with the line that says "llSetLinkAlpha(LINK_SET , 0.0, ALL_SIDES);" Currently the script hides the entire object. I have no idea what command to enter to get it to change just one prim to transparent/phantom... Could somebody lend a hand please or is this more complex then just a small script mod? Here is the script: default { on_rez(integer total) { llResetScript(); } touch_start(integer total_number) { llOwnerSay("Removing Sheet..."  ; llSetLinkAlpha(LINK_SET , 0.0, ALL_SIDES); state otherway; } } state otherway { touch_start(integer total_number) { llOwnerSay("Showing...."  ; llSetLinkAlpha(LINK_SET , 1.0, ALL_SIDES); state default; } }
_____________________
a i t u i // Tattoo & Fashion House
http://slurl.com/secondlife/Aitui/127/128/41
|
|
Strayn Janus
Registered User
Join date: 2 May 2007
Posts: 3
|
03-05-2009 23:40
From: Jesseaitui Petion touch_start(integer total_number) { llOwnerSay("Removing Sheet..."  ; llSetLinkAlpha(LINK_SET , 0.0, ALL_SIDES); state otherway; } } state otherway { touch_start(integer total_number) { llOwnerSay("Showing...."  ; llSetLinkAlpha(LINK_SET , 1.0, ALL_SIDES); state default; } } You just need to change the LINK_SET to the link number for the prim to hide - finding that number can be a bit more of a challenge. You may find it easier to use a slave script in the prim which sets the alpha and use llMessageLinked to communicate with it.
|
|
Papalopulus Kobolowski
working mind
Join date: 11 Aug 2006
Posts: 326
|
03-06-2009 00:11
to find what prim number you need to hide try this easy way. 1 .- Unlink the object 2.- select all prims. 3.- desselect the prim what you need to hide and the root prim with the script inside. 4.- select the prim to hide and last one the root prim. 5.- Link it all. Ready you have the prim number to hide in your link set . If the root prim is the last selected that is the link number 1 the the second is your prim to hide. llSetLinkAlpha(2 , 1.0, ALL_SIDES); // "2" prim to hide . It sounds complicated but its simple 
|
|
Jesseaitui Petion
king of polynesia :P
Join date: 2 Jan 2006
Posts: 2,175
|
03-06-2009 00:15
Thank you both a ton. worked like a charm. Perfect  Is there any way to also make the hidden piece phantom or is 1 phantom prim in the midst of a non-phantom primmed linked object impossible?
_____________________
a i t u i // Tattoo & Fashion House
http://slurl.com/secondlife/Aitui/127/128/41
|
|
Papalopulus Kobolowski
working mind
Join date: 11 Aug 2006
Posts: 326
|
03-06-2009 00:49
I think if you make one prim phantom all the link set would be phantom ...(correct me if im wrong) from the wiki: http://wiki.secondlife.com/wiki/LlSetLinkPrimitiveParams default { state_entry() { llSetLinkPrimitiveParams(2,[PRIM_COLOR,ALL_SIDES,<1.0, 1.0,1.0>,1.0]); // visible llSetLinkPrimitiveParams(2,[PRIM_PHANTOM,FALSE]); //no phantom }
touch_start(integer total_number) { llSetLinkPrimitiveParams(2,[PRIM_COLOR,ALL_SIDES,<1.0, 1.0,1.0>,0.0]); //invisible llSetLinkPrimitiveParams(2,[PRIM_PHANTOM,TRUE]); //phantom } }
Im not inworld so i cant test it , try it and let us know
|
|
Osprey Therian
I want capslocklock
Join date: 6 Jul 2004
Posts: 5,049
|
03-06-2009 03:04
If it's the right kind of shape you could make it flexi if you want it to be phantom and linked.
|
|
Innula Zenovka
Registered User
Join date: 20 Jun 2007
Posts: 1,825
|
03-06-2009 10:03
Or you can use a script to manipulate it in other ways too -- shrinking it, perhaps, or cutting a big hole in the middle, using a similar function to llSetLinkAlpha, llSetLinkPrimitiveParams http://www.lslwiki.net/lslwiki/wakka.php?wakka=llSetLinkPrimitiveParams, which might also, depending on the size and shape of the prim, be a good way to achieve an effect similar to making it invisible and quasi-phantom by making it flexy.
|