Here is the code I am using at the moment:
obj
Items
Tools
Fishing
Harpoon
New()
..()
harpoonhead=new('ToolHeads.dmi',"sharp")
changeLength(15)
var
icon/harpoonhead
proc
changeLength(length)
var/icon/handle
for(var/i=1,i<=length,i++)
handle=new('ToolHeads.dmi',"handle[i]")
handle.Shift(i,SOUTH)
icon+=handle
icon+=harpoonhead
In therory this should work. Though I have found out some problems. According to the help file, it says this:
Addition and Subtraction
The result of adding two icons is an arithmetic combination of the color components of each individual pixel. At positions where either icon is transparent, the result is also transparent. Subtraction, instead of increasing the intensity, decreases it by the amount in each pixel of the icon being subtracted.
Suppose you wanted to add together different bodies and heads. You could do that by making a few of each type with black backgrounds. When these add together, the black contributes nothing but prevents pixels in the other icon from getting clipped.
So I make the icons backgrounds black, as that is the effect I want to achieve. Though when I create it, the whole black background is visible. So then I made it transparent. It was excelling, it didn't show... :(. The harpoon was completely invisible.
The second problem I have is with Shift(). When I use it, it never actually shifts the handle part. By the way, the handle is actually 4 pixels in a horizontal line. The harpoon head is just one small icon. I know shift doesn't work because when I run it all the handle pieces are on the same place.
So, would anyone know an answer to this problem? Any help would be greatly appriciated.
ADT_CLONE