|
Carina Cannoli
Registered User
Join date: 22 Aug 2005
Posts: 13
|
01-31-2008 03:54
Hi, I'm very new to scripting, and I have looked through the forum for hours and can't find what I want. I bascially want to have three prims, one red, one green and the third prim blank. I want to click the green prim and the blank prim goes green, or click the red prim and the blank prim then turns red. So I can control the blank prim using the others as its control. I don't want the ordinary color change, but rather the color within the light feature box, so the prim actually glows that color, not just looks that color. Please help me!!
|
|
Kahiro Watanabe
Registered User
Join date: 28 Sep 2007
Posts: 572
|
01-31-2008 04:01
You need to use llSetPrimitiveParams: http://lslwiki.net/lslwiki/wakka.php?wakka=llSetPrimitiveParamsYou have a good description in that site.
|
|
Carina Cannoli
Registered User
Join date: 22 Aug 2005
Posts: 13
|
01-31-2008 04:14
I try putting into the scripts I have, but just comes up with errors, I don't know how to set it up properly even if I do know the function to use. Can anyone please write a basic script for what I need?
|
|
DoteDote Edison
Thinks Too Much
Join date: 6 Jun 2004
Posts: 790
|
01-31-2008 16:03
So, you link the three prims, with the blank prim as the root. Within that root prim, you would add a script that 1) detects a touch, 2) gets the color of the prim touched, 3) applies that color to your root (blank) prim. In this situation, you would name the red and green prims with the color vector. Name the red prim "<1,0,0>" and name the green prim "<0,1,0>". From: someone default { touch_start(integer num) { integer link = llDetectedLinkNumber(0); if (link == 1) return; // do nothing when the blank prim is touched vector color = (vector)llGetLinkName(link); llSetPrimitiveParams([PRIM_COLOR, ALL_SIDES, color, 1.0,PRIM_POINT_LIGHT, TRUE, color, 1.0, 10.0, 0.75]); } }
|
|
Jesse Barnett
500,000 scoville units
Join date: 21 May 2006
Posts: 4,160
|
01-31-2008 17:35
This is an old script I had to demonstrate how passing touches works. It just happens to do just about what you asked for. Just change to 3 prim and llSetPrimParamaters. As it is setup; Link four prim together and put this in the root. Whenever you touch on of the colored prims, the root will change to that color. You set the color for each prim to what you want below. integer child; string childname; vector color;
say(){ llOwnerSay( "Child Prim name: " + childname + ", link #" + (string)child + " touched." ); } params(){ llSetPrimitiveParams([PRIM_COLOR, 4, color, 0.6]); say(); }
default { touch_start( integer n ) { child = llDetectedLinkNumber( 0); childname = llGetLinkName( child ); if(child == 2){ color = <1, 0, 0>;//Choose your color here params(); } if(child == 3){ color = <0, 1, 0>;//Choose your color here params(); } if(child == 4){ color = <0, 0, 1>;//Choose your color here params(); } } }
_____________________
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
|