Scripts extending ActiveMagicEffect, like those extending ReferenceAlias, are sent events from the Actor on which they're running. However, effects are dispelled when an actor dies, so this isn't so useful if you're listening for OnDeath. You could try using OnDying, though.
Cipscis
OnDeath was just an example among others, I was hoping for a generalised way to listen to the events available to Actors. Using ReferenceAliases and a quest is a bit clumsy to set up, but at least once it's done I can just refer to them in script without any further hassle. I guess I'll stick with that for now.
However, your mention of ActiveMagicEffects does sound like an interesting alternative in some cases. If I understand correctly, you're suggesting I create a MagicEffect if I want to track an actor, extend a script have it handle the events I want to handle? I just saw the "ActiveMagicEffects will also receive events from the Actor they are attached to." footnote and that does seem like an obscure detail to remember. Heh.
As an aside, is it possible to either:
- Get the MagicEffect that would be triggered by a potion or poison, given a valid reference to said potion or poison's base item?
- Listen to OnEffectStart/OnEffectFinish events on ActiveMagicEffects from any alchemy potions or poisons, given an actor ref to the subject of said potion or poison?
Basically, I'm looking for a way to know when any potion/poison effect starts and ends, and preferably know
what MagicEffect it has. Extending every single alchemy effect with a script would be cumbersome, not to mention conflict-prone if any other mod touches alchemy effects.