ID:1378891
 
(See the best response by Lummox JR.)
Code:
// Create a kind of pulsing in-and-out animation
animate(object, alpha = 0)
animate(object, alpha = 255, time = 10, loop=-1)
animate(alpha = 0, time = 10)


Problem description:
The above code works, and indeed applies the alpha to all of the object's overlays, which is a very good thing. However, I'm wondering if there's some way to selectively animate overlays instead, or perhaps blacklist certain overlays from being affected by at least the alpha variable.

For example, if there's a certain mob that's using the above animation, and if clicking a mob makes it have an underlay/overlay which indicates the mob is targetted, how would you avoid applying the alpha channel modification to that specific overlay or underlay?

Where are you specifying this at in the code such as which proc, atom, etc....
In response to Akando5959
I don't think that really matters; the above code will have the same effect for wherever it is called provided there aren't existing animations being called for the object.

But, if it's at all important, which I doubt it is, let's say it's being called under /mob/ghost/New()
In response to Doohl
Currently the only way seems to be to use a follower object instead of an overlay.

Edit: try what Ter suggested. It makes sense to me that animating wouldn't affect an overlay that wasn't on at the time.
Have you tried using objects?

I have noticed one quirk about animate(), that it seems to apply the animations for objects inserted into overlays instantly, then freezes them so they don't animate.

You might try removing the overlay objects, explicitly animating them to alpha 1, then animating the base object, then adding the object back.

It might not work, so you might have to use an /image object tied to the base mob instead of added as an overlay. It might work differently as well.
Best response
Animations should apply to whatever overlays are current, not just to ones added before the animation began. The routine that converts the overlay Appearances into display icons already has all the parent obj's animation parameters provided to it, and the overlay should merely be working on top of that.
And this too applies to /image objects?