scn NPTrashHumperSCRIPT; Big thanks to otm from the gamesas forums for putting me on the right trackshort doOnceref yourPaper ; yourPaper is gonna be ShackPaperDebris01-05Begin GameMode set yourPaper to GetFirstRef 32 1 0 ; Find static world object in cell Label 10 if yourPaper != 0 if yourPaper.GetIsID ShackPaperDebris01 || yourPaper.GetIsID ShackPaperDebris02 || yourPaper.GetIsID ShackPaperDebris03 || yourPaper.GetIsID ShackPaperDebris04 || yourPaper.GetIsID ShackPaperDebris05 if doOnce == 0 if yourPaper.GetDistance player < 90 ; If the player is close to yourPaper player.AddSpell NPTrashHumperSPELL ; Add perk ability set doOnce to 1 endif else player.RemoveSpell NPTrashHumperSPELL ; Remove perk ability set doOnce to 0 endif endif set yourPaper to Pencil01 ; Prevent apple bug set yourPaper to GetNextRef ; Find the next static world object Goto 10 ; Loop the loop! endifEnd
The first bit will run fine if I comment out the RemoveSpell line, but when I let the RemoveSpell line run, the NPTrashHumperSPELL ability won't work correctly (I get the message that it's running, but no stat change). I've tried Dispel and CastImmediateOnSelf with no improvement, as well as changing the spell from Ability to Actor Effect to Disease.
EDIT: Tried ModAV instead of AddSpell and RemoveSpell, and I'm now able to trigger the effect both coming and going. Unfortunately many (not all) of the ShackPaperDebris objects have stopped working with the script, even though the exact same ones worked with the spell version. I'm kind of confused.