So, with some expert help from members here, I managed to make my little Dwemer Artificer mod actually usable . . . then I screwed up and tried to get all clever by making it "better" and blew everything to hell.
This script deletes a misc item and spawns a critter in its place when that item is hit by a certain projectile:
Scriptname PDAMSpiderguardianscript extends ObjectReference{Causes an inert spider guardian disappear and spawn a PDAM spider guardian in its place}ActorBase Property PDAMSpiderGuardian Auto;Declare variables for the control rod hit detectionProjectile Property PDAMActivationBolt AutoEvent OnHit (ObjectReference akAggressor, Form akSource, Projectile akProjectile, bool abPowerAttack, bool abSneakAttack, bool abBashAttack, bool abHitBlocked)If akProjectile == PDAMActivationBolt self.PlaceActorAtMe(PDAMSpiderGuardian) ;spawns friendly self.Delete() ;deletes inert Debug.Notification("Spider Guardian Activated!")EndIfEndEventTHIS script is formatted identically, and should do the inverse: when the critter is hit by that same projectile, it should spawn the misc item and delete the critter (in addition to making it drop whatever it's carrying so that those things don't vanish - a feature that doesn't actually work properly . . . yet. but that's a different issue entirely!).
Scriptname PDAMSpiderGuardianDisableScript extends ObjectReference{delete active spider guardian and spawn inert one}MiscObject Property PDAMSpiderGuardianInert Auto;Declare variables for the control rod hit detectionProjectile Property PDAMActivationBolt AutoEvent OnHit (ObjectReference akAggressor, Form akSource, Projectile akProjectile, bool abPowerAttack, bool abSneakAttack, bool abBashAttack, bool abHitBlocked)If akProjectile== PDAMActivationBolt Self.RemoveAllItems() ;Drop Everything self.PlaceAtMe(PDAMSpiderGuardianInert) ;spawns inert self.Delete() ;deletes friendly Debug.Notification("Spider Guardian Deactivated!")EndIfEndEventFor some reason, though, it spawns TWO instances of the misc item and that makes me sad because I can't understand why it would do that.
Does anyone have any clue whatsoever why this should be happening? And, more importantly, does anyone know what I could do to fix it?
As always, thanks for the advice! This fledgling modder will be very grateful and a place in my mod's credits section is just waiting for whoever can help straighten this out.
Thanks!
-P


