ID:2472808
 
(See the best response by Nadrew.)
So I cant seem to find a way to isolate the individual filters on a mob using the filter var and proc

I dont seem to be able to extract any type of information from the filter var itself.

One of the applications of this I'm trying to use is identifying if a mob has a specific filter applied. For example, if it has a specific drop_shadow filter on it.

The other issue I'm running in to is removing individual filters. I can remove all the filters, but I cant seem to find a way to remove a single filter and leave the others intact. For example, if I have a drop_shadow and a motion_blur on a mob, i cant find a way to remove the drop_shadow filter without also removing the motion_blur filter as well.

Are there any ways to do either of these? the first one is definitely more important. If need be, I can remove all the filters and then reapply the appropriate ones.
Best response
1)
var/dm_filter/somefilter = src.filters[1]
src << "Size: [somefilter.size], x: [somefilter.x], y: [somefilter.y], Offset: [somefilter.offset], Color: [somefilter.color], Flags: [somefilter.flags]"


However, it doesn't seem the 'type' of the filter is accessible anywhere that I've found. Probably a feature request thing.

2)

src.filters -= src.filters[1]


You'd probably be better off keeping track of what's where yourself then using that.
Kind of weird that filter just isn't a proper datum like any of the other recently added types.
That's the reason why the dm_filter type exists in stddef, since it's not a proper datum the compiler needed a way to handle the variables. What it needs is the 'type' variable added to the list.