OnObjectUnequipped not working for ActiveMagicEffect script

Post » Mon Nov 19, 2012 1:55 pm

I have a script that extends ActiveMagicEffect, and I read from http://www.creationkit.com/ActiveMagicEffect_Script that "ActiveMagicEffects will also receive events from the Actor they are attached to", but this is not true for my script. Here is the script:

ScriptName test1 Extends ActiveMagicEffectAuto State InitEvent OnEffectStart(Actor akTarget, Actor akCaster)  Debug.Notification("Msg1")  GoToState("State1")EndEventEndStateState State1Event OnBeginState()  Debug.Notification("State1 started")EndEventEvent OnObjectUnequipped(Form akBaseObject, ObjectReference akReference)  Debug.Notification("Something unequipped")EndEventEndState

The script is added to a magic effect, which is added to a spell, which the player can cast to self. The spell is added to player by a quest.
It shows correctly the notifications "Msg1" and "State1 started", but won't show the "Something unequipped" message when I unequip an item. It seems the event is never detected by this script
Where is the problem?
User avatar
Iain Lamb
 
Posts: 3453
Joined: Sat May 19, 2007 4:47 am

Post » Mon Nov 19, 2012 12:42 am

What's your spell's duration? Do you remove your item right after casting the spell?
User avatar
Beat freak
 
Posts: 3403
Joined: Thu Dec 14, 2006 6:04 am

Post » Mon Nov 19, 2012 3:00 pm

What's your spell's duration? Do you remove your item right after casting the spell?
Ow thanks, looks like I forgot to set the duration, but how do I set infinite duration? Do I have to set 9999 days or is there a more elegant way?
User avatar
ShOrty
 
Posts: 3392
Joined: Sun Jul 02, 2006 8:15 pm

Post » Mon Nov 19, 2012 3:12 pm

if you want a very long duration, maybe you should try with a Constant type effect.
User avatar
RaeAnne
 
Posts: 3427
Joined: Sat Jun 24, 2006 6:40 pm

Post » Mon Nov 19, 2012 1:35 am

Yes, making it an Ability would be better...
User avatar
stevie critchley
 
Posts: 3404
Joined: Sat Oct 28, 2006 4:36 pm


Return to V - Skyrim