Noobie color changing help and advice, pls
|
|
Keera Zenovka
Registered User
Join date: 23 Mar 2007
Posts: 35
|
02-02-2008 14:21
I'm completely new to "tint" changing scripts. I make sculpted items (linked with regular prims) and for instance I want someone to be able to change just the color of the sculpty texture of a shoe, without affecting the other prim parts of the shoe.
I don't want to choose any particular colors and I don't want to deal with color vectors...I want the owner of the shoe to be able to choose ANY color themselves, from the Color Picker Menu under the edit menu. I've heard that this can be done, using some kind of Color Control prim for the Color Picker that would send a linkmessage to the sculpty prim, I'm assuming?
Can anyone give me advice on how to create this - I have some very basic scripting skills. With limited scripting experience, would something like this be beyond me?
|
|
Void Singer
Int vSelf = Sing(void);
Join date: 24 Sep 2005
Posts: 6,973
|
02-02-2008 16:38
not using vectors, or at least web color numbers or using any presets will make it tough... the simplest sytem I can imagine, is a seperate 'application' prim, which is fully moddable, and whenever it's color changes, it speaks a message to the shoes which have a listen, and the shoe script applies the color for example, this in a prim named "Shoe Tinter" default{ changed( integer vBitChanged ){ if (CHANGED_COLOR & vBitChanged){ llSay( -420, (string)llGetColor( ALL_SIDES ) ); } } }
then in your shoes, default{ state_entry(){ llListen( -420, "Shoe Tinter", "", "" ); }
listen( integer vIntNull, string vStrNull, key vKeySpeaker, string vStrHeard ){ if (llGetOwnerKey( vKeySpeaker ) == llGetOwner()){ vector vClrShoe = (vector)vStrHeard; //-- apply the color to whatever part(s) you want, using vClrShoe } }
to change the color of the shoe just change the color of the tinter prim in edit.
_____________________
| | . "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... | - 
|
|
Keera Zenovka
Registered User
Join date: 23 Mar 2007
Posts: 35
|
02-03-2008 17:31
Wow Void, that is EXACTLY the thing I'm looking for, TY! I couldn't get it to work, though. Followed your instructions exactly, tried it 10 times over - don't know what I could be doing wrong. The shoe prim just refused to listen to the Tinter Prim when I changed the Tinter Prim color in Edit. 
|
|
Void Singer
Int vSelf = Sing(void);
Join date: 24 Sep 2005
Posts: 6,973
|
02-03-2008 18:39
if the listen is not triggering it's probably because of a difference in spelling between the listen in the shoe, and the name of tinter prim, (capitalization counts) make sure they match, and make sure the tinter and the listen are triggering (throw in some llOwnerSay() to test)
_____________________
| | . "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... | - 
|
|
Keera Zenovka
Registered User
Join date: 23 Mar 2007
Posts: 35
|
02-05-2008 15:08
I tried llOwnerSay and that appears to be working, but the color change is still not happening... I dropped my test prims in your inventory if you wanted to take a quick look at it in-world 
|
|
Jesse Barnett
500,000 scoville units
Join date: 21 May 2006
Posts: 4,160
|
02-05-2008 18:46
From: Keera Zenovka I tried llOwnerSay and that appears to be working, but the color change is still not happening... I dropped my test prims in your inventory if you wanted to take a quick look at it in-world  Bet 1$L you forgot to put llSetColor(face?) in the script 
_____________________
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
|
|
Void Singer
Int vSelf = Sing(void);
Join date: 24 Sep 2005
Posts: 6,973
|
02-05-2008 19:39
inventory never recieved (thanks LL, really =/ ) in the meantime try this for the shoe script, then post back with your version default{ state_entry(){ llListen( -420, "Shoe Tinter", "", "" ); }
listen( integer vIntNull, string vStrNull, key vKeySpeaker, string vStrHeard ){ if (llGetOwnerKey( vKeySpeaker ) == llGetOwner()){ vector vClrShoe = (vector)vStrHeard; llSetLinkColor( LINK_SET, vClrShoe, ALL_SIDES ); } }
that'll set all the prims in the shoe to that color (assuming the textures aren't black), it'll tint any textures that aren't solid white.
_____________________
| | . "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... | - 
|
|
Usagi Musashi
UM ™®
Join date: 24 Oct 2004
Posts: 6,083
|
02-05-2008 20:31
there are some nice free color changing scripts around. That would alot better.......
|
|
Rob Adelaide
Cream Cheese Fanatic
Join date: 19 Oct 2006
Posts: 34
|
02-05-2008 20:47
Void, might help if she names the prim she puts the original color changed() script in "Shoe Tinter" as that's what you have the shoe script set to listen for.^_^ If she doesn't name the speaking prim to appropriately match the listen, it will never be heard.  I have beaten my computer up many times over this simple mistake. -R
|
|
Void Singer
Int vSelf = Sing(void);
Join date: 24 Sep 2005
Posts: 6,973
|
02-05-2008 20:58
Rob, I assume the instructions were read, but barring that, OP says the listens showed it working correctly otherwise, which I assume means in BOTH scripts. yeah I know, that's alot of assumption, but I like to give people as much credit as possible when I can 
_____________________
| | . "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... | - 
|
|
Rob Adelaide
Cream Cheese Fanatic
Join date: 19 Oct 2006
Posts: 34
|
02-05-2008 21:43
Could be... I was just going by "Noobie" in the post title. I only learned to check by forgetting a few times. Here's the script I would write for said effect(first part is exactly like Void's): default { changed(integer bit_mask) //called whenever the prim changes in certain ways { if (bit_mask & CHANGED_COLOR) //If the prim changed color { llSay(-420, (string)llGetColor(ALL_SIDES); //Says on a hidden channel what color the prim is changed to } } }
and then in the shoes I would put: default { state_entry() { llListen(-420, "", NULL_KEY, ""); //Listens for the color from the other prim you changed }
listen(integer doesnt_matter_1, string doesnt_matter_2, key doesnt_matter_3, string received_message) //Happens when this prim hears something on the hidden channel { llSetColor((vector)received_message, ALL_SIDES); //Sets all sides of the prim the script is in to match the other prim you changed } }
If you create the first script and put it in any new prim you create, it will update your shoes if you are within 20m and change the color. If this is something you are going to be selling you will probably want to specify a different, harder-to-guess hidden channel so people don't go around maliciously changing people's shoe colors  If you create the second script and drop it in the prims on your shoes you want to change color, they will listen for anything with the first script to change colors. Feel free to contact me in-world if you still can't get it working or need any help. -R
|
|
Void Singer
Int vSelf = Sing(void);
Join date: 24 Sep 2005
Posts: 6,973
|
02-06-2008 03:33
on thing, you really don't need to specify NULL_KEY, since "" evaluates the same, and takes up less space in the script.... in places you need to test if a key is valid (must be of TYPE key), just use
if (vKeyTest)
it's even worse if use null key in link messages, since it's in effect the same as passing around 36+bytes of data you just don't need
_____________________
| | . "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... | - 
|
|
Keera Zenovka
Registered User
Join date: 23 Mar 2007
Posts: 35
|
02-07-2008 22:32
Thanks everyone! I can't believe how much I just learned from this. You guys are invaluable.
|