ID:170382
 
Okay, I don't know how to use or implement the pixel_y tag. I have this:

                    if("Goku")
new_mob.hair = "Goku"
var/hairred = input("How much red do you want to put into your hair?") as num
var/hairblue = input("How much blue do you want to put into your hair?") as num
var/hairgreen = input("How much green do you want to put into your hair?") as num
var/hairover = 'gokuhair.dmi'
hairover += rgb(hairred,hairgreen,hairblue)
new_mob.rhair = hairred
new_mob.ghair = hairgreen
new_mob.bhair = hairblue
new_mob.overlays += hairover
if("Vegeta")
new_mob.hair = "Vegeta"
var/hairred = input("How much red do you want to put into your hair?") as num
var/hairblue = input("How much blue do you want to put into your hair?") as num
var/hairgreen = input("How much green do you want to put into your hair?") as num
var/hairover = 'vegetahair.dmi'
hairover += rgb(hairred,hairgreen,hairblue)
new_mob.rhair = hairred
new_mob.ghair = hairgreen
new_mob.bhair = hairblue
new_mob.overlays += hairover


I need to insert the settings there so that the hair goes on the head of the icon. If anyone can give me a hand, that would be great.
I'm guessing hairover is the hair graphic, just place a simple line of: hairover.pixel_y+=number
In response to Crashed
It didn't work. I tried alot of different ways.
In response to Plagu3r
Instead of just using an icon, make an obj and add it to overlays.

var/obj/hair=new
hair.icon='whatever.dmi'
hair.icon+=rgb(blah,blah,blah)
hair.pixel_y=12
overlays += hair
del hair // We don't need the obj any more once it's been added as an overlay


By the way, you're repeating WAY too much code there. Do something like this instead:

// Ask for hair colour
var/hairred = input("How much red do you want to put into your hair?") as num
var/hairblue = input("How much blue do you want to put into your hair?") as num
var/hairgreen = input("How much green do you want to put into your hair?") as num
// Create hair obj
var/obj/hair=new
// Set icon
switch(...) // Replace the ... with the appropriate variable
if ("Goku")
hair.icon='gokuhair.dmi'
if ("Vegeta")
hair.icon='vegetahair.dmi'
// Set up overlay
hair.icon+=rgb(hairred,hairgreen,hairblue)
hair.pixel_y=12
overlays += hair
del hair


That way you end up duplicating far less code, meaning that it'll much easier to change things and debug your game in future. You can do similar things in many cases; if you're ever tempted to duplicate some code which is only slightly different, stop and think how you could so it so that it's not duplicated.
In response to Crispy
                var/obj/hair=new
switch(input("What hair style do you want?", "Customization", text) in list ("Bald", "Goku", "Vegeta"))
if("Bald")

if("Goku")
hair.icon='gokuhair.dmi'
hairred = input("How much red do you want to put into your hair?") as num
hairblue = input("How much blue do you want to put into your hair?") as num
hairgreen = input("How much green do you want to put into your hair?") as num
if ("Vegeta")
hair.icon='vegetahair.dmi'
hairred = input("How much red do you want to put into your hair?") as num
hairblue = input("How much blue do you want to put into your hair?") as num
hairgreen = input("How much green do you want to put into your hair?") as num
hair.icon+=rgb(hairred,hairgreen,hairblue)
hair.pixel_y=2
overlays += hair
del hair


For some reason now, the hair just won't show up at all. I don't know why, but it just doesn't display.
In response to Plagu3r
That's because you deleted it with

del hair


del nulls all references to the object, including the reference to it in the overlay list. Don't del objects unless you completely don't need them anymore.
In response to Neo Skye
I think something is wrong with the overall code. Even when I take out the del hair, it still doesn't show up. Something has got to be wrong with the coding.