ID:175289
 
When I try to create a new overlay
usr.overlays += new/obj/overlay/armor
I can't figure out how to color it, well how to call it
[what I need].icon += rgb(R,G,B)
I've tried checking the usr for overlays via
for(var/obj/overlay/armor in usr)
for(var/obj/overlay/armor in usr.loc)
for(var/obj/overlay/armor in world)
even the last gets no results... not even a single overlay
please help!

thanks
Vermolius wrote:
When I try to create a new overlay
usr.overlays += new/obj/overlay/armor
I can't figure out how to color it, well how to call it
[what I need].icon += rgb(R,G,B)

Nope, not a good idea. Start with a mostly white icon and multiply.

To create the colored overlay you have to create an obj of the type you want, change its icon, then add it to overlays. Then you can delete the obj itself, because it's just used like a template to create the overlay and you don't need it anymore.

Lummox JR
In response to Lummox JR
so you mean
var/color = new/obj/overlay/armor
color *= rgb(R,G,B) [with mostly white icons]
usr.overlays += color

It seems to work but I want to be sure Im doing it right thanks.

~Vermolius~
In response to Vermolius
Vermolius wrote:
so you mean
var/color = new/obj/overlay/armor
color *= rgb(R,G,B) [with mostly white icons]
usr.overlays += color

It seems to work but I want to be sure Im doing it right thanks.

You need to multiply the icon, not the obj itself.

After you add it to overlays, you should be able to delete it--unless for some reason you want to remove it from overlays later.

Lummox JR