I've been working feverishly on the next update for my Dwemer Artificer mod, and I've hit a weird snag . . .
I can't figure out why this script works perfectly:
Scriptname PDAMActivationScript03 extends ObjectReference{Delete inert automata and spawns friendly ones in thier place}ActorBase Property PDAMSpiderGuardian AutoEvent OnHit (ObjectReference akAggressor, Form akSource, Projectile akProjectile, bool abPowerAttack, bool abSneakAttack, bool abBashAttack, bool abHitBlocked)If akAggressor == Game.GetPlayer()self.PlaceActorAtMe(PDAMSpiderGuardian) ;spawns friendlyself.Delete() ;deletes inertDebug.Notification("Spider Guardian Activated!")EndifEndEventBut this one doesn't do anything
Scriptname PDAMActivationScript03 extends ObjectReference{Delete inert automata and spawns friendly ones in thier place}ActorBase Property PDAMSpiderGuardian AutoEnchantment Property PDAMActivationEnch Auto ;a custom staff enchantmentEvent OnHit (ObjectReference akAggressor, Form akSource, Projectile akProjectile, bool abPowerAttack, bool abSneakAttack, bool abBashAttack, bool abHitBlocked)If akSource == PDAMActivationEnchself.PlaceActorAtMe(PDAMSpiderGuardian) ;spawns friendlyself.Delete() ;deletes inertDebug.Notification("Spider Guardian Activated!")EndifEndEventThe idea is that when the object that this script is attached to gets hit by a particular weapon - in this case, a staff with the PDAMActivationEnch on it - it deletes the object and spawns a creature there. I've also tried using the staff itself for akSource, and that didn't work either.

As always, I'd be enormously grateful for any pushes in the right direction.

P
EDIT: Just to clarify, both versions compile just fine, but the version that uses akSource doesn't actually do anything in-game.

