Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Please help

Rhaorth Antonelli
Registered User
Join date: 15 Apr 2006
Posts: 7,425
04-14-2009 10:19
I tried posting this on the resident answers, and there was only one answer and it was not what I was looking for. I know this is not the products wanted, but.. once you read the rest of the post then maybe it will make sense why I put it here. (I am at a loss)
but not sure what to ask for, otherwise I would have put it in products wanted.

I need/want the color change script that is NOT the one that gives the many different colors to choose from. (I am afraid if I put this in the products wanted, the only thing people would see is "color change script wanted" and I would get offers for the one I already have.
(there is also another one I have that changes the colors in specified prims via chat command, it is not that one either that I am trying to find)

I want the one that allows you to add to the RGB values using the + and - buttons, as well as being able to lighten and darken the prim it is in

does anyone know the name of this script and/or where it can be found.
(free if possible as I can not afford to purchase anything at the moment)

I am sure I had a free one of this somewhere, but can not seem to find it now

I seem to recall using it in something but... good lord... what..

please, someone help me.

Thank you
_____________________
From: someone
Morpheus Linden: But then I change avs pretty often too, so often, I look nothing like my avatar. :)


They are taking away the forums... it could be worse, they could be taking away the forums AND Second Life...
Sindy Tsure
Will script for shoes
Join date: 18 Sep 2006
Posts: 4,103
04-14-2009 10:27
Doesn't really answer your question but you might want to look at the Particle Lab in Teal. Jopsey has a particle thing with a color control on it that's really pretty neat. It's not what you're asking for but you should go look anyway. No idea if he's got a version that's for sale.
Malia Writer
Unemployed in paradise
Join date: 20 Aug 2007
Posts: 2,026
04-14-2009 11:13
Maybe this?
/54/68/310835/1.html
_____________________
Rolig Loon
Not as dumb as I look
Join date: 22 Mar 2007
Posts: 2,482
04-14-2009 11:58
From: Malia Writer


That one doesn't do it, at least not in the way the OP wants. I think something like this would work .....

CODE

list buttons = ["<< - ", "+ >>", "Next Color"];
integer chat_channel = 12;
integer menu_channel = -1234;
vector color;
default
{
state_entry()
{
llListen(chat_channel,"",NULL_KEY,"COLORS");
llListen(menu_channel,"",NULL_KEY,"");
color = llGetColor(ALL_SIDES);
}
listen(integer channel, string name, key id, string message)
{
if (channel == chat_channel)
{
llDialog(id, "Adjust the RED value",buttons, menu_channel);
}
if (message == "<< -")
{
llSetColor(<color.x - 0.01, color.y, color.z>, ALL_SIDES);
}
else if (message == "+ >>")
{
llSetColor(<color.x + 0.01, color.y, color.z>, ALL_SIDES);
}
if (color.x <= 0.0)
{
color.x = 0.0;
}
if (color.x >=1.0)
{
color.x = 1.0;
}
if (message == "Next Color")
{
llDialog(id, "Adjust the GREEN value", buttons, menu_channel);
}

// blah blah blah

}
}


You'd want to make it possible to loop back and readjust R,G, or B iteratively instead of doing R, then G, then B, and it would be smart to let the user make BIG changes in a color parameter at first instead of stepping through in tiny 0.01 steps. Still, I think this basic scheme would work. Yes?
Rolig Loon
Not as dumb as I look
Join date: 22 Mar 2007
Posts: 2,482
Here's an answer that works .....
04-14-2009 17:49
OK, forget the suggestion I made earlier. Doing it with Dialogs is way too slow. I wrote a pair of scripts this afternoon that seem to do exactly what the OP wants. At least they seem to work properly when I test them in world. I'd appreciate it if a truly gifted scripter could suggest ways to improve them.

The first script, ColorChange, is to be dropped in a prim whose color you want to modify. When the other script is running, a click on a face in the prim containing ColorChange identifies the face to be modified and tells the other script what it's initial color is.

The second script, ColorControl, is placed in a cube prim. As the comments in that script indicate, clicks on a face of that prim signal the ColorChange prim (by use of llDetectedTouchUV) that you want to increase or decrease R,G,B, or total intensity.

Typing REDO in channel 12 resets the color in the controlled prim to its initial state. Typing DONE in channel 12 deleted the ColorChange script.

Here are the two scripts ...

CODE

//ColorChange by Rolig Loon -- April 2009
//Place this script in the prim that you want to modify.
//Click on a face to identify it as the one to be recolored.
// This script will remove itself when you have finished.
integer face;
vector color;
vector SaveColor;
integer channel = -1798;
init(integer TouchedFace)
{
color = llGetColor(TouchedFace);
SaveColor = color;
llSay(channel,(string)color);
}
default
{
state_entry()
{
llSay(0,"Initializing ....");
init(0);
llListen(channel,"",NULL_KEY,"");
}
touch_start(integer total_number)
{
face = llDetectedTouchFace(0);
init(face);
}
listen(integer channel, string name, key id, string message)
{
if(message == "R+")
{color.x += 0.01;}
if (message == "R-")
{color.x -= 0.01;}
if (color.x <= 0.0)
{color.x = 0.0;}
if (color.x >= 1.0)
{color.x = 1.0;}
if(message == "G+")
{color.y += 0.01;}
if (message == "G-")
{color.y -= 0.01;}
if (color.y <= 0.0)
{color.y = 0.0;}
if (color.y >= 1.0)
{color.y = 1.0;}
if(message == "B+")
{color.z += 0.01;}
if (message == "B-")
{color.z -= 0.01;}
if (color.z <= 0.0)
{color.z = 0.0;}
if (color.z >= 1.0)
{color.z = 1.0;}
if (message == "D+")
{color = color * (1.1);}
if (message == "D-")
{color = color /1.1;}
if(message == "Ooops!")
{
llSetColor(SaveColor,face);
llResetScript();
}
if (message == "Done!")
{
llSay(0,"Task completed. Removing script....");
llRemoveInventory(llGetScriptName());
}
llSetColor(color, face);
}
}


And here's the second one ....

CODE

//ColorControl by Rolig Loon -- April 2009
//Controls the companion script, ColorChange, which is placed in a prim that you want to recolor.
//This script goes in a prim with one face textured as a 2 column x 4 row matrix:
//Clicking in column 1 (left) decreases values of R, G, B, or total intensity in the controlled prim.
//Clicking in column 2 (right) increases values of R, G, B, or total intensity in the controlled prim.
//Row 1 (top) controls R, Row 2 controls G, Row 3 controls B, and Row 4 (bottom) controls darkness/lightness.
//Type REDO in channel 12 to reset the color in the controlled prim to its initial state.
//Type DONE in channel 12 to end the color changing process and remove the script from the controlled prim.
integer CHANNEL = -1798;
float colorR;
float colorG;
float colorB;
vector UV;
string signal;
default
{
state_entry()
{
llListen(CHANNEL,"",NULL_KEY,"");
llListen(12,"",llGetOwner(),"");
}
listen (integer channel, string name, key id, string message)
{
integer strength = llStringLength(message);
string temp = llDeleteSubString(message,0,(strength-1));
list Color = llParseString2List(temp,[","],[]);
colorR = llList2Float(Color,0);
colorG = llList2Float(Color,1);
colorB = llList2Float(Color,2);
if (message == "DONE")
{
llSay(CHANNEL,"Done!");
}
else if (message == "REDO")
{
llSay(CHANNEL, "Ooops!");
}
}

touch(integer total_number)
{
UV = llDetectedTouchUV(0);
if (UV.x <= 0.5 & UV.y <= 0.25)
{
signal = "D-";
}
else if (UV.x >0.5 & UV.y <= 0.25)
{
signal = "D+";
}
else if (UV.x <= 0.5 & UV.y > 0.25 & UV.y <= 0.5)
{
signal = "B-";
}
else if (UV.x > 0.5 & UV.y > 0.25 & UV.y <= 0.5)
{
signal = "B+";
}
else if (UV.x <= 0.5 & UV.y > 0.5 & UV.y <= 0.75)
{
signal = "G-";
}
else if (UV.x > 0.5 & UV.y > 0.5 & UV.y <= 0.75)
{
signal = "G+";
}
else if (UV.x <= 0.5 & UV.y > 0.75)
{
signal = "R-";
}
else if (UV.x > 0.5 & UV.y > 0.75)
{
signal = "R+";
}
llSay(CHANNEL, signal);
}
}
Void Singer
Int vSelf = Sing(void);
Join date: 24 Sep 2005
Posts: 6,973
04-14-2009 21:05
because the range for standard color pickers is 0 - 255 per color (16 million colors) and LSL wants 0.0 - 1.0... resulting in a small progressive rounding error of 1/10,000th for for ever 5 rough edits in a single direction. final result, it's damn close but not 100%. takes a max of 11 presses to get to any specific color number.

I was lazy and didn't include anything to select a face, but it'd only require one higher level dialog

CODE

list gLstVal;
list gLstMod = ["-1", "-8", "-64", "+1", "+8", "+64", " ", " ", " ", "All", "Red", "Green", "Blue"];
list gLstTxt = ["\nModifying All", "\nModifying Red", "\nModifying Green", "\nModifying Blue"];
integer gIdxPanel;
integer gChnDialog;
key gKeyOwner;

fColorDialog(){
llListen( gChnDialog, "", gKeyOwner, "" );
llDialog( gKeyOwner,
llList2String( gLstTxt, gIdxPanel ) + fStrColor(),
llDeleteSubList( gLstMod, gIdxPanel + 9, gIdxPanel + 9 ),
gChnDialog );
llSetTimerEvent( 30.0 );
}

string fStrColor(){
vector vColTemp = llGetColor( ALL_SIDES ) * 255;
return "\n\nCurrent Values (0-255):\n"
+ "Red:" + (string)llRound(vColTemp.x)
+ ", Green:" + (string)llRound(vColTemp.y)
+ ", Blue:" + (string)llRound(vColTemp.z);
}

vector fColFix( vector vColRaw ){
return <fFltFix(vColRaw.x), fFltFix(vColRaw.y), fFltFix(vColRaw.z)>;
}

float fFltFix( float vFltFix ){
if (vFltFix < 0){
return 0.0;
}
if (vFltFix > 1){
return 1.0;
}
return vFltFix;
}

fUpdateOwner(){
gIdxPanel = 0;
gKeyOwner = llGetOwner();
gChnDialog = (integer)("0x" + llGetSubString( gKeyOwner, 0, 7 ));
}

default{
state_entry(){
gLstVal = [-1/255.0, -8/255.0, -64/255.0, 1/255.0, 8/255.0, 64/255.0, <1, 1, 1>, <1, 0, 0>, <0, 1, 0>, <0, 0, 1>];
fUpdateOwner();
}

changed( integer vBitChanges ){
if (CHANGED_OWNER & vBitChanges){
fUpdateOwner();
}
}

touch_start( integer vIntTotalTouches ){
@loop; {
if (llDetectedKey( --vIntTotalTouches ) == gKeyOwner){
fColorDialog();
}
}if (vIntTotalTouches) jump loop;
}

listen( integer vIntChannel, string vStrName, key vKeySpeaker, string vStrHeard ){
integer vIdxReply = llListFindList( gLstMod, (list)vStrHeard );
if (~vIdxReply){
if (6 > vIdxReply){
llSetColor( fColFix( llGetColor( ALL_SIDES )
+ llList2Vector( gLstVal, gIdxPanel + 6 )
* llList2Float( gLstVal, vIdxReply ) ),
ALL_SIDES );
}else if (8 < vIdxReply){
gIdxPanel = vIdxReply - 9;
}
}
fColorDialog();
}

timer(){
llSetTimerEvent( 0.0 );
state sKillListen;
}
}

state sKillListen{
state_entry(){
gIdxPanel = 0;
state default;
}
}


PS anyone notice that you can save and retrieve colors outside of the 0.0-1.0 range? totally blew my mind when I was trying to max the color and it kept going up. was that always like that? I thought it was clamped.
_____________________
|
| . "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...
| -
Rolig Loon
Not as dumb as I look
Join date: 22 Mar 2007
Posts: 2,482
04-14-2009 22:10
From: Void Singer
PS anyone notice that you can save and retrieve colors outside of the 0.0-1.0 range? totally blew my mind when I was trying to max the color and it kept going up. was that always like that? I thought it was clamped.


I wondered about that. I put a cap on RGB values in my script to keep them between 0.0 and 1.0, but before I did that, I seemed to be able to run outside the range with no error message. Odd.

Incidentally, after I posted my two-part script I decided to add a hover text to the ColorChange one so I could pop the scripts in a couple of prims and use them as a demo tool. It's kinda neat and simple.

I DO like your Dialog-driven version, Void. Nice. :)
Void Singer
Int vSelf = Sing(void);
Join date: 24 Sep 2005
Posts: 6,973
04-14-2009 23:44
I'm unhappy with my solution for manually clamping the vector values (I had to write that function on the fly, as evidenced by the inconsistent indentation). I suppose I could have done all the calculation on change in the integer range and clamped it there, but it's still hard to clamp a [x,y] range, (modulus can do [x,y) and even (y,x] if your creative) but I'd still have to tear the vector apart to do it =(
_____________________
|
| . "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...
| -
ElQ Homewood
Sleeps Professionally
Join date: 25 Apr 2007
Posts: 280
04-15-2009 05:03
I did a dialog one of these maybe a year ago, with the + and - buttons..in the end, though, it was just so freakin tedious to get anywhere changing colors, even with an extra tier to give a starting color to shade out from. In the end I didn't use it because it seemed like just too much work for the end-user. I'm not inworld atm, but if I can find it down in the bowels of my gargantuan inventory closet, I'll put it in here so you can pull it apart and maybe get what you are looking for.
Rhaorth Antonelli
Registered User
Join date: 15 Apr 2006
Posts: 7,425
04-18-2009 16:00
Thank you all very much, I will give these a try and see if they do what I need

VERY much appreciated!
_____________________
From: someone
Morpheus Linden: But then I change avs pretty often too, so often, I look nothing like my avatar. :)


They are taking away the forums... it could be worse, they could be taking away the forums AND Second Life...
Rolig Loon
Not as dumb as I look
Join date: 22 Mar 2007
Posts: 2,482
04-18-2009 16:21
If you're using the script that I posted, drop this small script in the prim that you use for ColorControl. It will put a useful touch pattern on face 2 of the prim so you know where to click.

CODE

default
{
llSetTexture("f3fb210a-0fad-5e41-3be9-230a0ca68dce", 2);
}
Johan Laurasia
Fully Rezzed
Join date: 31 Oct 2006
Posts: 1,394
04-18-2009 22:13
I think everyone over in resident answers is busy reading the 65,000 posts in "just ignore this and let this die".
_____________________
My tutes
http://www.youtube.com/johanlaurasia
Rhaorth Antonelli
Registered User
Join date: 15 Apr 2006
Posts: 7,425
04-19-2009 14:45
From: Johan Laurasia
I think everyone over in resident answers is busy reading the 65,000 posts in "just ignore this and let this die".


even though I was the one that unintentionally started that thread, I wish it would just die

(it is sad the amount of grief I get because of that thread, people think I started it with the intention of it being what it is now)
:(
_____________________
From: someone
Morpheus Linden: But then I change avs pretty often too, so often, I look nothing like my avatar. :)


They are taking away the forums... it could be worse, they could be taking away the forums AND Second Life...
Rhaorth Antonelli
Registered User
Join date: 15 Apr 2006
Posts: 7,425
04-19-2009 14:51
From: Malia Writer


replying to each post as I try the scripts mentioned

this one is exactly like the ones I have, it lets you choose a "specific color"
That is not what I want to do.

thank anyway though, might be useful for someone else.

Off to try the next suggestion.
_____________________
From: someone
Morpheus Linden: But then I change avs pretty often too, so often, I look nothing like my avatar. :)


They are taking away the forums... it could be worse, they could be taking away the forums AND Second Life...
Rhaorth Antonelli
Registered User
Join date: 15 Apr 2006
Posts: 7,425
04-19-2009 14:55
From: Rolig Loon
That one doesn't do it, at least not in the way the OP wants. I think something like this would work .....

*script omitted*

You'd want to make it possible to loop back and readjust R,G, or B iteratively instead of doing R, then G, then B, and it would be smart to let the user make BIG changes in a color parameter at first instead of stepping through in tiny 0.01 steps. Still, I think this basic scheme would work. Yes?


I tried yours and not even sure how to use it as it doesn't seem to have the on touch command or a menu come up.

Someone with more scripting knowledge will definitely know what to do with it though.

On to the next suggestion.

(just to clarify, I was not looking for someone to write me a script, I seem to recall seeing what I am looking for out there for free once, even thought I had it but now can not seem to find it.)

PS the second suggestion has me totally lost :(

Thank you for helping though
_____________________
From: someone
Morpheus Linden: But then I change avs pretty often too, so often, I look nothing like my avatar. :)


They are taking away the forums... it could be worse, they could be taking away the forums AND Second Life...
Rhaorth Antonelli
Registered User
Join date: 15 Apr 2006
Posts: 7,425
04-19-2009 15:04
From: Void Singer
because the range for standard color pickers is 0 - 255 per color (16 million colors) and LSL wants 0.0 - 1.0... resulting in a small progressive rounding error of 1/10,000th for for ever 5 rough edits in a single direction. final result, it's damn close but not 100%. takes a max of 11 presses to get to any specific color number.

I was lazy and didn't include anything to s elect a face, but it'd only require one higher level dialog



PS anyone notice that you can save and retrieve colors outside of the 0.0-1.0 range? totally blew my mind when I was trying to max the color and it kept going up. was that always like that? I thought it was clamped.


THIS!! This is very much like what I am looking for!!

I like this better than the one I am thinking of, this is even handy for those who do the screen shot and get the RGB from the skin to match the skin colors as well as fine tuning!

Now to figure out how to add a reset button... and figure out how to make it work on all 10 toes!!

AWESOME TY!!!

(had to add a space to the word s elect to allow me to post... GRRR)
_____________________
From: someone
Morpheus Linden: But then I change avs pretty often too, so often, I look nothing like my avatar. :)


They are taking away the forums... it could be worse, they could be taking away the forums AND Second Life...
Void Singer
Int vSelf = Sing(void);
Join date: 24 Sep 2005
Posts: 6,973
04-19-2009 18:05
From: Rhaorth Antonelli
THIS!! This is very much like what I am looking for!!

I like this better than the one I am thinking of, this is even handy for those who do the screen shot and get the RGB from the skin to match the skin colors as well as fine tuning!

Now to figure out how to add a reset button... and figure out how to make it work on all 10 toes!!

AWESOME TY!!!

(had to add a space to the word s elect to allow me to post... GRRR)

instead of just a llSetColor, it needs an llSetLinkColor with either a loop to run through the neccessary linked prims, or LINK_ALL_OTHERS if it can go in a single prim that WON'T get changed. reset is as easy as adding a button (I suggest replacing a blank one) and an if to catch it in the listen (with a default value to apply)
_____________________
|
| . "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...
| -
Rhaorth Antonelli
Registered User
Join date: 15 Apr 2006
Posts: 7,425
04-19-2009 22:52
From: Void Singer
instead of just a llSetColor, it needs an llSetLinkColor with either a loop to run through the neccessary linked prims, or LINK_ALL_OTHERS if it can go in a single prim that WON'T get changed. reset is as easy as adding a button (I suggest replacing a blank one) and an if to catch it in the listen (with a default value to apply)


thanks for the info void and the script, sadly though, what you just said there, was greek to me. I am a very very beginner scripter, trying to wrap my brain around scripting, and I do manage to put together some very basic scripts, but sadly this is beyond my grasp.
_____________________
From: someone
Morpheus Linden: But then I change avs pretty often too, so often, I look nothing like my avatar. :)


They are taking away the forums... it could be worse, they could be taking away the forums AND Second Life...
Johan Laurasia
Fully Rezzed
Join date: 31 Oct 2006
Posts: 1,394
04-19-2009 23:58
From: Rhaorth Antonelli
even though I was the one that unintentionally started that thread, I wish it would just die

(it is sad the amount of grief I get because of that thread, people think I started it with the intention of it being what it is now)
:(



Well, if it's any consolation, I meant it tongue-in-cheek, not to be mean. If anything, it's a dig aimed at the idiots who have been keeping the thread alive for the last YEAR. I don't know why, but it seems every ding dong in SL who visits these forums winds up in Resident Answers. It's more like Resident Whiners. Every time LL makes even the smallest change, people wind up there complaining about how it's completely ruined their life. One idiot out there actually asked LL if his strip club would have to be moved to the up coming adult continent, and was surprised when the answer was yes. Go figure. Have you ever considered asking a mod to close the thread?
_____________________
My tutes
http://www.youtube.com/johanlaurasia
Rhaorth Antonelli
Registered User
Join date: 15 Apr 2006
Posts: 7,425
04-20-2009 17:55
From: Johan Laurasia
Well, if it's any consolation, I meant it tongue-in-cheek, not to be mean. If anything, it's a dig aimed at the idiots who have been keeping the thread alive for the last YEAR. I don't know why, but it seems every ding dong in SL who visits these forums winds up in Resident Answers. It's more like Resident Whiners. Every time LL makes even the smallest change, people wind up there complaining about how it's completely ruined their life. One idiot out there actually asked LL if his strip club would have to be moved to the up coming adult continent, and was surprised when the answer was yes. Go figure. Have you ever considered asking a mod to close the thread?



I have considered it, but then I would have the wrath of the whole crew that chats in there, and at this point, I just ignore the complainers that choose to "blame" me for starting it.
(not only that but mods seem to have deserted us) and if they feel it should be closed then they will do it without my intervention.

I would rather a few people complain that I started it on purpose, than have all those who use it, hate me and do whatever they think of to get even for me requesting it closed. (if that makes sense)


It has actually kept a lot of the general chatter in that thread.

Yeah I saw the thread about the strip club... who really would think a strip club is not adult???
I did not bother to say anything but... get real, it is adult for god's sake.

*shrug*
_____________________
From: someone
Morpheus Linden: But then I change avs pretty often too, so often, I look nothing like my avatar. :)


They are taking away the forums... it could be worse, they could be taking away the forums AND Second Life...
Void Singer
Int vSelf = Sing(void);
Join date: 24 Sep 2005
Posts: 6,973
04-21-2009 03:16
From: Rhaorth Antonelli
I have considered it, but then I would have the wrath of the whole crew that chats in there, and at this point, I just ignore the complainers that choose to "blame" me for starting it.
(not only that but mods seem to have deserted us) and if they feel it should be closed then they will do it without my intervention.

I would rather a few people complain that I started it on purpose, than have all those who use it, hate me and do whatever they think of to get even for me requesting it closed. (if that makes sense)


It has actually kept a lot of the general chatter in that thread.

Yeah I saw the thread about the strip club... who really would think a strip club is not adult???
I did not bother to say anything but... get real, it is adult for god's sake.

*shrug*

eh, the whole thing was made stupid my LL choosing a word that didn't really reflect their stated intent (I mean seriously? mature == adult in normal english conversation). They really need to rethink their classification system, so that the words used reflect their intent(which they need to clarify anyways), then there won't be much to complain about.
_____________________
|
| . "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...
| -