ID:2790916
 
(See the best response by Kaiochao.)
Code:
proc/CreateHair(STATE,MASK_STATE,ALPHA,SIZE,ANGLE,PX,PY)
var masked_object/mo = new
mo.icon = 'icons/hair.dmi'
mo.icon_state = "[STATE]"
mo.overlays += new/mask(MASK_STATE,ALPHA,SIZE,ANGLE,PX,PY)
mo.color = "#F00"
return mo



masked_object
parent_type = /obj
appearance_flags = KEEP_TOGETHER


mask
parent_type = /obj
icon = 'icons/_masks.dmi'
appearance_flags = RESET_COLOR
blend_mode = BLEND_INSET_OVERLAY
New(MASK_STATE,ALPHA=255,SIZE=1.0,ANGLE=45,PX,PY)
transform = turn(matrix()*SIZE,ANGLE)
icon_state = "[MASK_STATE]"
alpha = ALPHA
pixel_x = PX
pixel_y = PY
color = "#FF0"


mob/Login()
vis_contents.Add(

CreateHair(1,1,255,0.2,45,0,5),

CreateHair(1,1,255,0.35,13,0,5),

CreateHair(1,1,255,1.0,0,0,0),

CreateHair(1,1,255,0.1,45,0,8),
)
..()
animate(vis_contents[1],pixel_x=0,pixel_y=0)
animate(vis_contents[2],pixel_x=32,pixel_y=0)
animate(vis_contents[3],pixel_x=0,pixel_y=32)
animate(vis_contents[4],pixel_x=32,pixel_y=32)


Problem description:
I'm trying to give the mask its own color but since the main icon uses KEEP_TOGETHER not even RESET_COLOR on the mask is resetting its color.
You want to use KEEP_APART to separate it from the parent.
Using KEEP_APART on the mask makes it so it isn't a mask anymore :(



Left is KEEP_APART
Right is my above code.
Best response
Since you can't use RESET_COLOR with KEEP_TOGETHER and you can't use BLEND_INSET_OVERLAY without KEEP_TOGETHER, it probably just shouldn't be an overlay. Try an alpha mask filter that masks the yellow thing by the red thing, and add both the yellow and red things to the mob's vis_contents, instead of adding the yellow thing to the red thing's overlays. Or, add the yellow thing to the mob's overlays instead of the red thing.
In response to Kaiochao
Kaiochao wrote:
Since you can't use RESET_COLOR with KEEP_TOGETHER and you can't use BLEND_INSET_OVERLAY without KEEP_TOGETHER, it probably just shouldn't be an overlay. Try an alpha mask filter that masks the yellow thing by the red thing, and add both the yellow and red things to the mob's vis_contents, instead of adding the yellow thing to the red thing's overlays. Or, add the yellow thing to the mob's overlays instead of the red thing.

Possible to get a code example?
When you're using the BLEND_INSET_OVERLAY method of masking, the parent icon is the mask and it has to have KEEP_TOGETHER. The child icon (the one getting masked) uses BLEND_INSET_OVERLAY and can't use KEEP_APART or a different plane.
In response to Lummox JR
Lummox JR wrote:
When you're using the BLEND_INSET_OVERLAY method of masking, the parent icon is the mask... The child icon (the one getting masked) uses BLEND_INSET_OVERLAY...

So I'm doing it backwards? lol