ID:139571
 
Code:
Update_Icon()
overlays = initial(overlays)
icon = null
var/icon/Ship = icon('Ship System.dmi')
Ship.Blend(rgb(0,0,0,255),ICON_ADD)
Ship.Scale(64,64)
var/image/I1 = image(Ship,"[icon_state] 0,0",)
var/image/I2 = image(Ship,"[icon_state] 0,1")
var/image/I3 = image(Ship,"[icon_state] 1,0")
var/image/I4 = image(Ship,"[icon_state] 1,1")
I1.pixel_x = -16
I1.pixel_y = 0
I2.pixel_x = -16
I2.pixel_y = 32
I3.pixel_x = 16
I3.pixel_y = 0
I4.pixel_x = 16
I4.pixel_y = 32
I1.layer = 3
I2.layer = 6
I3.layer = 3
I4.layer = 6
overlays.Add(I1)
overlays.Add(I2)
overlays.Add(I3)
overlays.Add(I4)


Problem description:
It's probably an error on my part but for some reason this makes the icon disappear. I've tried to do a few changes but the result is always the same.

You set the icon to null, then never set it again after that.
In response to DarkeWarrior
Because it's resizing the obj into seperate icons and placing them on the map.

Why would you add the enlarged states and the original (smaller) icon.
In response to Akushumi
Then where are you defining its icon?
In response to DarkeWarrior
DarkeWarrior wrote:
Then where are you defining its icon?

    Ship.Scale(64,64)
var/image/I1 = image(Ship,"[icon_state] 0,0",)
var/image/I2 = image(Ship,"[icon_state] 0,1")
var/image/I3 = image(Ship,"[icon_state] 1,0")
var/image/I4 = image(Ship,"[icon_state] 1,1")


The ship is turned into 4 tiles and then later added as overlays.
In response to Akushumi
That would be setting the ships icon states. You still haven't given it an icon yet.
In response to DarkeWarrior
DarkeWarrior wrote:
That would be setting the ships icon states. You still haven't given it an icon yet.

 var/icon/Ship = icon('Ship System.dmi')


The icon is 'Ship System.dmi'


I figured it out...
BYOND doesn't divide the icon into states when it resizes at run time.
In response to Akushumi
My sincere apologies, I overlooked that part. I could have helped you earlier if I had seen that.
In response to Akushumi
Akushumi wrote:
I figured it out...
BYOND doesn't divide the icon into states when it resizes at run time.

Actually it does, but only in TILED_ICON_MAP format. Normally BYOND now handles large icons as a single icon rather than splitting them up like it used to.
In response to Destroy
Destroy wrote:
Akushumi wrote:
I figured it out...
BYOND doesn't divide the icon into states when it resizes at run time.

Actually it does, but only in TILED_ICON_MAP format. Normally BYOND now handles large icons as a single icon rather than splitting them up like it used to.


I should have rephrased that. D:
Thanks for the clarification though. :D