I'm trying to make a mod to make objects like Mini Nukes, Mines, Grenades, etc, explode when they're hit. Now I've hit a wall trying to figure out how to make the explosion from an affected object trigger other nearby objects. My script is dynamically added to certain objects in the loaded cell. Relevant code:
Event OnHit(ObjectReference akTarget, ObjectReference akAggressor, Form akSource, Projectile akProjectile, bool abPowerAttack, \
bool abSneakAttack, bool abBashAttack, bool abHitBlocked, string apMaterial)
akTarget.PlaceAtMe(fragMineExplosion, 1) //Doesn't trigger OnHit events of other objects
akTarget.Delete()
EndEvent
The fact that explosions or projectiles placed with PlaceAtMe() doesn't trigger OnHit events wasn't all that surprising but I'm stumped to find any other way to trigger the explosion. I guess I could just use FindAllReferencesWithKeyword() and iterate over all nearby explosives, but I feel like that will require quite a bit more complex scripting and will be more prone to bugs. So does anyone know of a way to trigger an explosion from a script that will then also trigger the OnHit events of nearby objects? Any help would be very much appreciated.