ID:262128
 
Ok heres my problem

Image Hosted by ImageShack.us

Image Hosted by ImageShack.us

Image Hosted by ImageShack.us


my hair is in 2 difrent frames cause its so big so m having toruble putting both on his head im fine with doing the first one but then the second one jsut dosent wanan do it

                if("Afro")
usr.hair="Afro"
var/new_rgb = F_Color_Selector.Get_Color(usr)
var/icon/I = new('afro_bottom.dmi')
I.Blend(new_rgb)
usr.overlays = ""
usr.overlays += I


i need ot add the top one now











Credit goes To Aoni And magetto for icons and To Flick for the color selector
                if("Afro")
usr.hair="Afro"
var/new_rgb = F_Color_Selector.Get_Color(usr)
var/icon/I = new('afro_bottom.dmi')
var/icon/I2 = new('afro_top.dmi')
I.Blend(new_rgb);I2.Blend(new_rgb)
usr.overlays += I;usr.overlays+=I2

In response to Crashed
it still didnt add the top
In response to Dranzer_Solo
Bleh, the line: "I2.pixel_y+=32" got deleted. Add it after you blend the RGB values.
In response to Crashed
                if("Afro")
usr.hair="Afro"
var/new_rgb = F_Color_Selector.Get_Color(usr)
var/icon/I = new('afro_bottom.dmi')
var/icon/I2 = new('afro_top.dmi')
I.Blend(new_rgb);I2.Blend(new_rgb)
usr.overlays += I;usr.overlays+=I2
I2.pixel_y+=32



like that?
In response to Crashed
Crashed wrote:
Bleh, the line: "I2.pixel_y+=32" got deleted. Add it after you blend the RGB values.

Uh, no. An /icon is not an atom. It has no pixel_x or pixel_y. It's just a holder for a dynamic icon.

To add an overlay with a pixel offset, you need to create an /image or atom and change its offsets, then add the object to the the overlays. You can delete the object afterward, because only a copy is added to the overlays.

Lummox JR
In response to Dranzer_Solo
Lumm, I really just followed Dranzer's first peice, but Dranz, change var/icon/ to var/obj/.
In response to Crashed
Crashed wrote:
Lumm, I really just followed Dranzer's first peice, but Dranz, change var/icon/ to var/obj/.

Wouldn't this be easier if you create the hair as an obj, make it all in one tile, then offset it's pixel_y? make it sit on the same tile as the body.
In response to Jik
Why would it be easier?
In response to Crashed
It would be easier to delete, and less lines of code alltogether.
In response to SSJ2GohanDBGT
More lines of code, and I don't see how it's easier to delete.
In response to Crashed
Crashed wrote:
More lines of code, and I don't see how it's easier to delete.

here is how it's easier:

You only need to work with one tile. The hair can be any size, just always make the base of the hair at the same point, then the offset of pixel_y is always the same. All this work he's going into to fix the hair is done away with.

There, less code (only handling one obj instead of 2 overlays), less time (don't have to figure out how to put the 2 overlays together)



In response to Jik
I believe the problem of the hair is that it doesn't fit in one icon all together, so making two objects is needed.
In response to Crashed
Crashed wrote:
I believe the problem of the hair is that it doesn't fit in one icon all together, so making two objects is needed.
Actually, if you look at the icons provided, the hair would only take up 3/4 of a tile. The problem(why it's 2 tiles) is the base of the hair. Read my post on pixel_y shifting again.
In response to Jik
It would be best to use a single offset overlay as Jik suggests. An excessive number of overlays on screen can slowdown Dream Seeker considerably.
In response to Crashed
If you look at the icon, if he moved it down it would easily fit on one icon. He was trying to do it the way you were and just add one part to the overlays and another as an object or otherwise.
In response to SSJ2GohanDBGT
im back from school and heh i still dont get it -_- do my make objs like

obj
afo
icon = 'afo_top'


or what?
In response to Dranzer_Solo
Arg still cant get it ( i feel live i have tried every thing )
In response to Dranzer_Solo
Dranzer_Solo wrote:
im back from school and heh i still dont get it -_- do my make objs like
 
obj
afo
icon = 'afo_top'


or what?

Yes, except

 
obj
afo
icon = 'afo_top'
pixel_y = 32


that will move it up to the next tile, fiddle with the amount until it looks correct. Also make sure thats the entire hair icon, not just a part of it(unless you would rather use Crashed's way).
In response to Crashed
Crashed wrote:
Lumm, I really just followed Dranzer's first peice, but Dranz, change var/icon/ to var/obj/.

I'm not sure what you're trying to say about following the first piece. If you mean you were just trying to keep it consistent with that without thinking through the problem any further, that was clearly not the way to go. You need to stop and think about what you're doing. Since this question was one of using pixel offsets on an overlay, it transcends anything you'd do with mere icons. Icons don't have pixel offsets; atoms and images do. So using another icon was all well and good, but then you have to do more with it.

Secondly, your advice this time around is as wrong as the last time. Since you're initializing I2 with new('icon.dmi') and using the Blend() proc, obviously changing it to an /obj is bogus. You still need I2. But you need an object as well.

Lummox JR
Page: 1 2