There are a few places in the vanilla Skyrim scripts that use the OnMagicEffectApply
event but don't actually care what type of effect triggered the event. With the original game this is a fairly trivial issue because most, if not all, Magic Effects are intended to have consequences and the vanilla area-of-effect spells (Cloak Spells) are no exception.
The issue arises now that modders are getting creative with their solutions. For example dynamically attaching scripts
to objects/actors in an area by use of cloak spells. This technique causes the nonpartisan OnMagicEffectApply events to be triggered regardless of the spell's settings, giving authors no way to have their spell ignored.
This issue is most obvious during Brawls, because the script (DGIntimidateAliasScript) which handles if the player is cheating will always notice these cloak spells. But it's also completely plausible that hanging oil lamp traps in dungeons will suddenly fall without notice because of a user made cloak spell. Or even critters dying because a cloaked actor is nearby.A partial work-around.
Currently most modders who need to use 'silent' cloak-spells run condition checks to remove their spell just before a brawl or where one might take place. While this method is perfectly accurate to avoid Brawls turning into fights, It means the spell must be removed temporally and it also wont help with other scripts that neglect to check magic effect accurately - like the poor critters.Possible solutions
Finding a solution to this issue starts with identifying all instances in the vanilla script where OnMagicEffectApply() is used without adequate checks for conditions. (I've currently discovered 15) Then designing an actual solution:
1) Detailed Approach
Determine what function the entire affected script is performing and what the intent behind the OnMagicEffectApply was. Then add conditions to check accordingly for what the script needs to know and ignore ALL other spells.
- Pro. Fixes the issue like a patch and lets modders and users ignore it once and for all.
- Con. Requires a lot of time and script experience to understand what the script's intent is.
- Con. Assumes all Skyrim's spells are set up correctly, otherwise they might get ignored.
2) Shot-gun Approach
Check effects against a list of keywords. If the effect doesn't match any, allow the spell to fall through the cracks and be ignored.
- Pro. Fixes the issue like a patch
- Pro. Easy to implement.
- Con. Could easily accidentally ignore vanilla spells if the check-list is too small.
- Con. Assumes all Skyrim's spells are set up with keywords, otherwise they might get ignored.
3) Modder's Approach.
Leave the script to perform as it ordinaraly does, but define a keyword for spells which should be ignored by the event entirely.
- Pro. Easy to implement.
- Pro. The script performs as normal.
- Pro. Makes no assumptions about how Skyrim is 'meant' to work.
- Con. Is not a patch, it requires mod authors to adjust their spells accordingly.
I've chosen to favor option 3.. While it doesn't perform like a patch and allow the community to ignore the issue it does give modders a way to have their 'silent' spell perform as intended. But most importantly this approach doesn't make any assumptions about how Skyrim is made and leaves the responsibility in the hands of the spell author.