ID:178859
 
Lately, i've been experimenting with the rgb() proc and am stuck with a problem.On Login the usr chooses there skin color either preset or custom, thats easy, but i'm having trouble with hair, i want it so only the hair changes when they are asked for a hair color (the hair is an overlay)but i cannot seem to make it change only the hair it changes the whole icon.. Anyone know a way that i can do it??

-NilFisk
NilFisk wrote:
(the hair is an overlay)but i cannot seem to make it change only the hair it changes the whole icon.. Anyone know a way that i can do it??

Well, you're probably doing it right with the overlay thing. The way I'd do it is to have the hair overlay completely black (255,255,255), prompt them for their rgb choices, then rgb() the overlay with their input as the arguments.
In response to Vortezz
Vortezz wrote:
Well, you're probably doing it right with the overlay thing. The way I'd do it is to have the hair overlay completely black (255,255,255), prompt them for their rgb choices, then rgb() the overlay with their input as the arguments.

I dont really understand, how do i put the rgb choice onto the overlay, i can't get it working..what would i put the overlay as??

usr.icon += rgb(5,5,5) is the usr..
so would usr.overlays+= rgb(5,5,5) be right..?

Thanks
-NilFisk
NilFisk wrote:
Lately, i've been experimenting with the rgb() proc and am stuck with a problem.On Login the usr chooses there skin color either preset or custom, thats easy, but i'm having trouble with hair, i want it so only the hair changes when they are asked for a hair color (the hair is an overlay)but i cannot seem to make it change only the hair it changes the whole icon.. Anyone know a way that i can do it??

What you need to do is create separate icons for each thing that can be colored in. These can then be combined as overlays, or you can use icon.Blend() like this:
var/icon/theicon=new('person.dmi',"body")
theicon.Blend(rgb(skinr,sking,skinb),ICON_MULTIPLY)
var/icon/icon2=new('person.dmi',"hair")
icon2.Blend(rgb(hairr,hairg,hairb)
theicon.Blend(icon2,ICON_OVERLAY)
themob.icon=theicon

Lummox JR
In response to NilFisk
If the hair is an object that you are overlaying, you could do this:
for(var/obj/O in usr.overlays)
if(istype(O,/obj/hair/))
O += rgb(255,0,0)


I believe that would work.

Hope I helped...

-Rcet
In response to Rcet
Thanks for that guys it worked i am happy now :

-nilfisk