ID:162283
 
Lets say I use the new icon feature to import a PNG I want to use for an item. How would then make parts of that item dense while leaving other parts non-dense?
Are you wanting to have an icon be both dense and not dense at the same time or are you just talking about making parts transparent?
In response to Jholder84
With the new icon features you can easily create multi-tiled mob, objects and turfs. Lets say I make a battlemech obj, and use this feature to create an object that is 5 tiles wide by 4 tiles high. The only part of the mech I want to be dense are the feet, the rest I want to be a different layer, no density so I can create the illusion that the mech is 3d.
In response to Zuglilth
Overlays are your friend here. When I did this I had separate DMIs but you could easily do it with one and icon_state.

I put this in my mob definition:
New()
src.overlays += new/obj/top
..()

and added this after it:
obj
top
icon = 'Head.dmi'//duh...
//icon_state = 'Head'//Didn't do this but could have
density = 0//so it will move over other items
layer = MOB_LAYER+2//puts the layer above other items
pixel_y = 32//sets base y pixel to the one right above the topmost one for the bottom


Now obviously my head is staying right on tob of my body so I don't have any need to change this icon and programmed it that way.
In response to Jholder84
This isnt what I asked for at all.

Byond 4.0+ has a feature in which you can import external files (like PNG) into an icon that will be the extact weight and width of the file you imported. This means no longer needing to jigsaw pieces of an icon together to create multiled effects.

My question is not how do I create a multi-tiled mob. My question is what do I change on my obj definition to have certain tiles be dense and others not to be. I think it is something like this:

obj
player
Rigger
vehicles
car
icon = 'bots3.dmi'
name = "BMW i985"
icon_state = "move"
layer =1
if(icon_state ="move 0,0")
density = 0


But I am not sure.
In response to Zuglilth
No, that's my code. Before I try to explain what I was talking about, are you using multiple DMI files to make your multi tile object or are you using one big picture?
In response to Jholder84
I know what you were talking about, and I am telling you that isn't what I asked for. I thank you for trying though.

It is one big picture, as I have explained twice now.
In response to Zuglilth
If you import the pic and make it a DMI it sets the icon_state like a grid to put it back together. You can easily use what I gave and change the icon_state and do it that way.
In response to Jholder84
Why would I want to turn parts of it into an overlay when the whole thing gets rebuilt automatically?
In response to Zuglilth
If you only want parts of it to be dense you have to split it up. That IS what you asked in the original post. You can't make something both dense and not dense at the same time. You have to split it into parts and set the parts individually.
In response to Jholder84
Just a thought, wouldn't it be much easier to set the icon into the overlay and just leave the actual icon as null? That way you don't have to worry about splitting it up, and byond still figures the PNG as one large picture. Not sure if this would work with overlays as I have not played around with the 4.0+ features, but it sounds plausible.