1) I would like to be able to modify the script so instead of changing the color on all linked objects it would just change the color on the primary linked object and leave the others alone.
In a perfect world I would like to find out how to add a menu to it so that different objects in a linked object can have it's individual color changed via the menu but that's not important. Basically I just want to be able to modify the script to have it change the color of the primary linked object and leave the other objects alone. Thank you.
CODE
// Global variables
integer g_listener = FALSE; // Listen Handler
integer randomChannel = 0; // Our random channel
integer place = 0; // Place in the Script
integer exit = FALSE; // Exit param
vector color = <1,1,1>; // Global color param
list colors = ["Orange","Purple","Lime","Pink","Teal","Gray","Blue","Red","Green","White","Yellow","Custom"];
list custom = ["0.8","0.9","1.0","0.5","0.6","0.7","0.2","0.3","0.4","0.0","0.1"];
default
{
touch_start(integer total_number)
{
if(llDetectedKey(0) == llGetOwner())
{
// Refresh the goods
place = 0;
llListenRemove(g_listener);
// Add a random channel
randomChannel = 10 + (integer)llFrand(100000);
g_listener = llListen(randomChannel,"",llGetOwner(),"");
// Fire up the expiration timer
llSetTimerEvent(720.0);
// Fire up the dialog
llDialog(llGetOwner(),"Select a Color Theme:",colors,randomChannel);
}
}
listen(integer chan, string name, key id, string msg)
{
// When we receive a dialog response...
if(chan == randomChannel) // Redundant, unless you want more chans
{
// This depth is reserved for Configuration Options
if(place == 0)
{
llSetTimerEvent(720.0);
++place;
integer test = llListFindList(colors,(list)msg);
if(test != -1)
{
// If we select "Orange"
if(test == 0)
{
color = <1,0.6,0>;
}
// If we select "Purple"
else if(test == 1)
{
color = <0.6,0,1>;
}
// If we select "Lime"
else if(test == 2)
{
color = <0.6,1,0>;
}
// If we select "Pink"
else if(test == 3)
{
color = <1,0,0.6>;
}
// If we select "Teal"
else if(test == 4)
{
color = <0,1,1>;
}
// If we select "Gray"
else if(test == 5)
{
color = <0.5,0.5,0.5>;
}
// If we select "Blue"
else if(test == 6)
{
color = <0.3,0.3,1>;
}
// If we select "Red"
else if(test == 7)
{
color = <1,0.3,0.3>;
}
// If we select "Green"
else if(test == 8)
{
color = <0.3,1,0.3>;
}
// If we select "White"
else if(test == 9)
{
color = <1,1,1>;
}
// If we select "Yellow"
else if(test == 10)
{
color = <1,1,0>;
}
// If we select "Custom"
else if(test == 11)
{
llDialog(llGetOwner(),"Custom Color Mode Selected! Choose a value for RED (Second Life RGB).",custom,randomChannel);
return;
}
llSetLinkColor(LINK_SET,color,ALL_SIDES);
exit = TRUE;
llSetTimerEvent(0.1);
return;
}
else
llSetTimerEvent(0.1);
}
// This depth is reserved for Custom Colors ONLY!
else if(place == 1)
{
llSetTimerEvent(720.0);
++place;
color.x = (float)msg;
llDialog(llGetOwner(),"Choose a value for GREEN (Second Life RGB).",custom,randomChannel);
}
else if(place == 2)
{
llSetTimerEvent(720.0);
++place;
color.y = (float)msg;
llDialog(llGetOwner(),"Choose a value for BLUE (Second Life RGB).",custom,randomChannel);
}
else if(place == 3)
{
llSetTimerEvent(720.0);
++place;
color.z = (float)msg;
llSetLinkColor(LINK_SET,color,ALL_SIDES);
exit = TRUE;
llSetTimerEvent(0.1);
return;
}
}
}
timer()
{
llSetTimerEvent(0.0);
if(exit == FALSE) llOwnerSay("Timer Expired. Please try again.");
llListenRemove(g_listener);
}
}