ID:138832
 
Code:
CabelosFoward()
if(sexo == "Masculino")
if(cab<5)
cab++
winset(src,null,"CreateChar.label6.text='Cabelo [cab]/[5]'");
usr.overlays = null
var/cabelo = icon('spr_cabeloM1.dmi',"Cabelo [cab]")
usr.cabelo = cabelo
usr.overlays += usr.cabelo
//usr.overlays += rgb(255,0,0)


Problem description:
Well, i wanna set the overlay color to the hair of the character, but it isn't work with the rgb(a,b,c). What can i do?

someone please could help me? :/
Karrasko wrote:
Code:
> CabelosFoward()
> if(sexo == "Masculino")
> if(cab<5)
> cab++
> winset(src,null,"CreateChar.label6.text='Cabelo [cab]/[5]'");
> usr.overlays = null
> var/cabelo = icon('spr_cabeloM1.dmi',"Cabelo [cab]")
> usr.cabelo = cabelo
> usr.overlays += usr.cabelo
> //usr.overlays += rgb(255,0,0)
>

Problem description:
Well, i wanna set the overlay color to the hair of the character, but it isn't work with the rgb(a,b,c). What can i do?


Change the color of the icon not the overlay. Also, define cabelo like this: var/icon/cabelo = icon('spr_cabeloM1.dmi',"Cabelo [cab]")

Look up SwapColor in the help file, it's an icon function. Same with MapColors. They will be useful to you. I can help you more later if you still need help, I'm not at a computer that has BYOND on it at the moment,
In response to Zaltron
Well, i try to use this
usr.cabelo = cabelo.SwapColor(rgb(0,0,0),rgb(40,0,0))
usr.overlays += usr.cabelo


But, it isn't working :P....
In response to Karrasko
Hope this helps.

source: http://dl.dropbox.com/u/17935054/Overlays_src.zip

Also, avoid using usr when you don't need to use it. It can cause you problems down the road when used incorrectly.

mob
var/hat
icon = 'Graphics.dmi'
icon_state = "smiles"

mob/verb/wear_hat()
if(src.hat)
src.overlays -= hat
hat = null
var/icon/i = icon('Graphics.dmi', "hat")
src.hat = i
src.overlays += i

mob/verb/wear_hat_with_pixel_offset()
if(src.hat)
src.overlays -= hat
hat = null
var/icon/i = icon('Graphics.dmi', "hat")
var/obj/o = new
o.icon = i
o.pixel_y = 5
src.hat = o
o.layer = MOB_LAYER + 1
src.overlays += o

mob/verb/wear_hat_with_SwapColor()
if(src.hat)
src.overlays -= hat
hat = null
var/icon/i = icon('Graphics.dmi', "hat")
i.SwapColor(rgb(0, 0, 0), rgb(100, 100, 255))
i.SwapColor(rgb(255, 255, 255), rgb(0, 255, 0))
src.hat = i
src.overlays += i

mob/verb/wear_hat_with_MapColors()
if(src.hat)
src.overlays -= hat
hat = null
var/icon/i = icon('Graphics.dmi', "hat")
i.MapColors(rgb(51,13,13), rgb(26,77,51), rgb(26,26,102), rgb(0,0,0))
src.hat = i
src.overlays += i

mob/verb/remove_hat()
if(src.hat)
src.overlays -= hat
hat = null
In response to Zaltron
But with swap color, it will waste much time taking all the colors of the icon etc... cause i wanna make this for the hair of the player... but it isn't work normaly as the usual
hair += rgb(a,b,c)...
In response to Karrasko
Whoops, I overlooked adding that.

source: http://dl.dropbox.com/u/17935054/Overlays_src.zip

mob/verb/wear_hat_with_rgb()
if(src.hat)
src.overlays -= hat
hat = null
var/icon/i = icon('Graphics.dmi', "hat")
var/obj/o = new
o.icon = i
o.pixel_y = 5
o.icon += rgb(200, 0, 0);
src.hat = o
o.layer = MOB_LAYER + 1
src.overlays += o
In response to Zaltron
aw man, thank you, it works xDDD i'm so grateful!
You can help me in one more thing?
Well, in the game space station 13 they have a system that you can put the color that you want to the hair, in character customization...
They have used something that make it's easy to do, or they have made it with winset, blends, procs etc?
In response to Karrasko
I hope this is what you want.

source: http://dl.dropbox.com/u/17935054/Overlays_src.zip

mob/verb/wear_custom_hat_with_specific_rgb()
var
h = input("What hat would you like to wear?", "Hat Selection") in list("hat", "hat2", "hat3")
icon/i = icon('Graphics.dmi', h)
obj/o = new
if(src.hat)
src.overlays -= hat
hat = null
src.current_hat = h
o.icon = i
o.icon += src.hat_color
src.hat = o
o.layer = MOB_LAYER + 1
src.overlays += o

mob/verb/wear_specific_hat_with_custom_color()
var
color = input("What color would you like the hat to be?", "Hat Color") as color
icon/i = icon('Graphics.dmi', src.current_hat)
obj/o = new
if(src.hat)
src.overlays -= hat
hat = null
src.hat_color = color
o.icon = i
o.icon += src.hat_color
src.hat = o
o.layer = MOB_LAYER + 1
src.overlays += o

mob/verb/wear_custom_hat_with_custom_color()
var
h = input("What hat would you like to wear?", "Hat Selection") in list("hat", "hat2", "hat3")
color = input("What color would you like the hat to be?", "Hat Color") as color
icon/i = icon('Graphics.dmi', h)
obj/o = new
if(src.hat)
src.overlays -= hat
hat = null
src.current_hat = h
src.hat_color = color
o.icon = i
o.icon += src.hat_color
src.hat = o
o.layer = MOB_LAYER + 1
src.overlays += o
In response to Zaltron
Yes! it's exactly what i want... Thank you one more time! =D
In response to Karrasko
Anytime, let me know if you need help with anything else.
In response to Zaltron
have msn?
In response to Karrasko
I only use Skype.
In response to Zaltron
can you pass your email, and skype?
In response to Karrasko
Not over the forums, add me to your pager and I can get you it.