Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

llSetColor problem

Robin Peel
Registered User
Join date: 8 Feb 2005
Posts: 163
09-14-2005 10:35
Hello,
Can somebody please help? With llSetColor(<1,0,0>, ALL_SIDES); you change all sides of a prim to another color. What would you write if you don't want to change all the sides to another color but just 3 of the 4 sides?
Thank you.
Michael Martinez
Don't poke me!
Join date: 28 Jul 2004
Posts: 515
09-14-2005 10:59
Just change the ALL_SIDES to the side # you want...you will have to put mulitple setcolor statements for each side, but just take ALL_SIDES out and replace with 3 for side 3 (starting at 0)..then again for side 4....
Robin Peel
Registered User
Join date: 8 Feb 2005
Posts: 163
09-14-2005 11:10
From: Michael Martinez
Just change the ALL_SIDES to the side # you want...you will have to put mulitple setcolor statements for each side, but just take ALL_SIDES out and replace with 3 for side 3 (starting at 0)..then again for side 4....

i'm sorry for asking this, but could you please give me an example? i'm not a coder so i'm going blind. this is turning out to be more effort than i wanted to do this. LOL
Julian Fate
80's Pop Star
Join date: 19 Oct 2003
Posts: 1,020
09-14-2005 11:14
CODE
default {

state_entry() {
// For individual faces you need to set the
// color individually.
llSetColor(<1,0,0>, 1);
llSetColor(<1,0,0>, 3);
llSetColor(<1,0,0>, 5);
// These could be inside a touch or timer event
// or wherever you need them.
}

}

Keep in mind if you are switching colors a lot it will cause a lot of object updates and can contribute to lag. If you need the colors to blink or switch back and forth often a better route might be a two frame llSetTextureAnim() since that updates once to start the animation then lets the client handle it instead of the server.
Robin Peel
Registered User
Join date: 8 Feb 2005
Posts: 163
09-14-2005 11:57
no, i just want to change the color of a vehicle that i'm making. and i've never coded or made something like this before.
what am i getting myself into.
LOL
Julian Fate
80's Pop Star
Join date: 19 Oct 2003
Posts: 1,020
09-14-2005 12:12
From: Robin Peel
what am i getting myself into. LOL

Welcome to Hell. It's a very nice Hell though. :)

Should we assume you mean you want to be able to change the vehicle's color at will? It gets tricky to answer without seeing the design but the code above is basically what you need if your design makes it a problem to change ALL_SIDES.

I suggest you read up on llMessageLinked() and the possibility of putting your color changes into link_message events. That is the best method for communicating with prims inside a linked object and might help you out.
Robin Peel
Registered User
Join date: 8 Feb 2005
Posts: 163
09-14-2005 12:18
yes, that's what i'm trying to do. its working, but some of the prims can only change on all but 1 of the sides. so now i have to edit all the colors on those prims. fun.
no it really isn't as bad as i'm coming on as.
thanks for the example. it helped get me going.