Scripted spell not working. Need a spell to "banish"

Post » Sun Nov 17, 2013 2:07 pm

I need spell that works like a banish spell, but on almost any type of NPC. I set it up as a modify value type spell with this script attached.

Scriptname LM_maskpowerScript extends activemagiceffect  {Disables target instance. This may be dangerous for use as a spell. Not sure yet.}actor targetEvent OnEffectStart(Actor akTarget, Actor akCaster)	debug.messagebox("Script initiated.")	target = self.getTargetActor()	utility.wait(3.0)	target.disable(true)endevent

I added the message box just to make sure the script was actually starting at all. I get no errors in CK. In game, the message box displays but the actor is not disabled. I feel like this may not be the best was to do it anyway, as it seems dangerous to just go around disabling actors. Any ideas?

User avatar
alicia hillier
 
Posts: 3387
Joined: Tue Feb 06, 2007 2:57 am

Post » Sun Nov 17, 2013 3:02 pm

Scriptname LM_maskpowerScript extends activemagiceffect  {Disables target instance. This may be dangerous for use as a spell. Not sure yet.}Event OnEffectStart(Actor akTarget, Actor akCaster)	debug.messagebox("Script initiated.")	utility.wait(3.0)	akTarget.disable(true)endevent

Got the script working. Still, I fell this is dangerous. It's only disabling the targeted instance, right? Say you used it on a respawning bandit, would the bandit still respawn?

User avatar
BethanyRhain
 
Posts: 3434
Joined: Wed Oct 11, 2006 9:50 am

Post » Sun Nov 17, 2013 9:34 pm

The disabled/enabled state actually does NOT get reset, so they will stay disabled forever. See: http://www.creationkit.com/Cell_Reset#What_Resets.3F

Also, some actors can not be disabled due to them having an "enable parent" (e.g. Guards).

akTarget.SetCriticalStage(akTarget.CritStage_DisintegrateEnd) could be an alternative way to make your actor disappear and it will get reset properly. The SetCriticalStage functions are used for things such as zombies crumbling to dust or similar effects.

User avatar
Stacyia
 
Posts: 3361
Joined: Mon Jul 24, 2006 12:48 am


Return to V - Skyrim