|
Carina Cannoli
Registered User
Join date: 22 Aug 2005
Posts: 13
|
11-01-2007 02:34
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. Please help me.
|
|
Stephen Zenith
Registered User
Join date: 15 May 2006
Posts: 1,029
|
11-01-2007 02:53
From: Carina Cannoli 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. Please help me. Will the prims be linked together?
|
|
Carina Cannoli
Registered User
Join date: 22 Aug 2005
Posts: 13
|
11-01-2007 04:02
The red and green prims I will link, the blank prim is seperate. But they don't need to be linked. Whatever is the easest to do.
|
|
Stephen Zenith
Registered User
Join date: 15 May 2006
Posts: 1,029
|
11-01-2007 04:22
Ok - if the blank prim were linked to the others, there would be a totally different way of doing it. This first script simply tells any prims listening what colour it is when it's clicked. Put it in both the red and green prims. integer CHANNEL = -7443259;
default { touch_start (integer num_detected) { vector prim_color = llGetColor (0); llSay (CHANNEL, (string)prim_colour); } }
And this second script listens to other scripts saying what colour they are, and sets itself to be the same colour. Put it in the blank prim. integer CHANNEL = -7443259;
default { state_entry () { llListen (CHANNEL, "", "", ""); }
listen (integer channel, string name, key id, string message) { vector color = (vector)message; llSetColor (color, ALL_SIDES); } }
These *should* work, but I'm not in-world to check right now. I've assumed that it's ok to set the blank prim to be the same colour as face 0 of the prim being clicked and that the blank one will be relatively close to the coloured prims.
|
|
Carina Cannoli
Registered User
Join date: 22 Aug 2005
Posts: 13
|
11-01-2007 04:30
Thank you Stephen for your quick reply, I will be in game shortly and will give it a try 
|