Backwards?

Post » Tue Jun 19, 2012 2:58 am

So I have written this script:
_________________________________________________________________________________________
Scriptname powerfulundead extends ActiveMagicEffect


Event OnEffectStart(actor akTarget, actor akCaster)
If (akCaster.hasperk(necromancy))

akTarget.forceav("health", 1)
akTarget.modav("magicka", 50)
akTarget.modav("stamina", 50)
akTarget.modav("speedmult", 200)
Debug.MessageBox("Is THIS WORKING?")

endIF
endEvent

perk property necromancy auto
_________________________________________________________________________________________
The script compiles, but in game something weird happens: The effects effect my character, not the target. I know that the walrus I am testing this on does not have the perk "necromancy", so it obviously recognizes me as the caster. So why does it effect me as the target as well. I have been struggling with this ONE SINGLE PROBLEM for two days now. Any help?
User avatar
Eddie Howe
 
Posts: 3448
Joined: Sat Jun 30, 2007 6:06 am

Post » Mon Jun 18, 2012 7:43 pm

Are you using a modified version of one of the dead raising spells? Part of the spell affects you. The same happens with summon spells. I didn't dig too much in this, but I suppose you will have various effects when opening the script. Edit another one.
User avatar
c.o.s.m.o
 
Posts: 3419
Joined: Sat Aug 12, 2006 9:21 am

Post » Tue Jun 19, 2012 4:31 am

I'm not sure how to use debug text like this exactly but I've seen it in other scripts...
you should be able to get the debug text to tell you the target of the script as well

try using something like
Debug.MessageBox("this spell targeted" + akTarget)

also, why not just use another magic effect with a conditional to achieve that(like the vanilla spells do with DarkSouls perk)? I'm not criticizing, it just seems like a simpler solution
User avatar
Nuno Castro
 
Posts: 3414
Joined: Sat Oct 13, 2007 1:40 am

Post » Mon Jun 18, 2012 2:58 pm

also, why not just use another magic effect with a conditional to achieve that(like the vanilla spells do with DarkSouls perk)? I'm not criticizing, it just seems like a simpler solution
I just tried your idea, using
Scriptname powerfulundead extends ActiveMagicEffect Event OnEffectStart(actor akTarget, actor akCaster)	    akTarget.forceav("health", 1)	    akTarget.modav("magicka", 50)	    akTarget.modav("stamina", 50)	    akTarget.modav("speedmult", 200)	    Debug.MessageBox("Is THIS WORKING?" + akTarget) 			 endEvent
and equipping it on a new magic effect with the conditional of HasPerk necromancy == 1, then equipping that onto the reanimate corpse spell, but it didn't work. I have no clue why, but that does seem like the better approach than what I was doing. Sometimes the best solution is the simplest, eh?
User avatar
Alexander Lee
 
Posts: 3481
Joined: Sun Nov 04, 2007 9:30 pm

Post » Tue Jun 19, 2012 4:01 am

I finally got the above method to work by checking the Recover, No Death Dispel, No area, and the Hide in UI boxes in the magic effect box. I'm not entirely sure why that fixed it though....
User avatar
Christie Mitchell
 
Posts: 3389
Joined: Mon Nov 27, 2006 10:44 pm


Return to V - Skyrim