Magic Effect script misbehaving

Post » Wed Jun 20, 2012 8:39 am

I am trying to get this script to apply an attribute modification to the actor the spell hits, but for some reason, the game is mis-identifying the target actor as the Player.

Also, the debug.Notifications are returning "Target is [Actor" and "caster is [Actor" which doesn't seem right.

Spoiler
scriptname doomTKAtronachEffect3Script extends ActiveMagicEffectSpell property doomAtronachEffect3Spell auto    Float TargetMagickaEvent OnEffectStart(Actor akCaster, Actor akTarget)    Debug.Notification("Target is " + akTarget)    Debug.Notification("Caster is " + akCaster)    TargetMagicka = akTarget.GetAV("Magicka")    akTarget.ModAV("Magicka", -(TargetMagicka))    game.getPlayer().addSpell(doomAtronachEffect3Spell)    EndEventEvent OnEffectFinish(Actor akCaster, Actor akTarget)        akTarget.ModAV("Magicka", TargetMagicka)    game.getPlayer().removeSpell(doomAtronachEffect3Spell)    EndEvent
User avatar
Lakyn Ellery
 
Posts: 3447
Joined: Sat Jan 27, 2007 1:02 pm

Post » Wed Jun 20, 2012 11:10 am

Event OnEffectStart(Actor akCaster, Actor akTarget)

The first parameter is supposed to be the target, and the second is supposed to be the caster. That's why your code is being applied to the player.

And that's how the notifications seem to work. No GetName() function and looks like they won't return form IDs too.
User avatar
Amy Cooper
 
Posts: 3400
Joined: Thu Feb 01, 2007 2:38 am

Post » Wed Jun 20, 2012 2:13 pm

I knew it was something as simple as that...

Thanks.
User avatar
Andrew
 
Posts: 3521
Joined: Tue May 08, 2007 1:44 am


Return to V - Skyrim