ID:2249313
 
Code: Hey yall, I'm trying to make it so that the player's susanoo is the same color as their first stage.
mob
verb
Susanoo()
set category = "Dojutsu"
if(susanoo_stage<1)
susanoo_stage=1
src.susanoo = new('Stage 1.dmi')
src.susanoo += src.susanoocolor
src.overlays += src.susanoo
src.verbs+= /mob/Mangekyo/verb/End_Susanoo
return
if(susanoo_stage)
susanoo_stage=2
src.overlays -= src.susanoo
var/obj/Uchiha/Mangekyou/Susanoo/Stage_2/S = new/obj/Uchiha/Mangekyou/Susanoo/Stage_2/
src.overlays += S
return


Problem description: I was able to use the same code I use for hair for the first stage, but the second and so on are not 32x32, so since I had to change the pixe_x in the obj code, I had to use a different code. So far with the code it works perfectly fine, but I can't for the life of me change the color. The normal color of it is black if that is what you need to know.
Please help!


You'd remove it from overlays, change its color variable, then add it back to overlays. Simply changing a variable of an overlay won't cause its appearance to update.
In response to Nadrew
So I would do:

                    susanoo_stage=2
src.overlays -= src.susanoo
var/obj/Uchiha/Mangekyou/Susanoo/Stage_2/S = new/obj/Uchiha/Mangekyou/Susanoo/Stage_2/
src.overlays -= S
S.color = src.susanoocolor
src.overlays += S
Well, since you're not adding S to overlays anywhere else, you don't need to remove it from overlays to color it, just color it and add it to the overlays.
In response to Nadrew
I tried as you said and the susanoo is still black.
If the base icon's color is black, setting 'color' to a straight rgb() value isn't gonna work. You'd want to do additive blending and not multiplicative.

S.color = list(null,null,null,null,src.susanoocolor)
In response to Nadrew
I finally got it working, thanks bro.
In response to Nadrew
Just 1 more problem, I have a save issue. When I re log, the color goes back to black. Is that something I am not going to be able to fix?
You generally shouldn't be saving overlays, instead rebuilding them upon loading based on what you're wearing and whatnot.

In this case you'd re-add the overlay when loading was done, properly coloring it as needed.