Why my script no work? Specifically an activemagiceffect loo

Post » Sat Nov 17, 2012 2:34 pm

Starting to feel like every time I try to make a script I need to bring it here so someone can fix it...oh well! Can anyone tell me why my script isn't working?
It's supposed to be registering the weapon swing animation, the first debug message fires, though I don't know if it actually is registering the animation.
Second event never seems to fire.
It's all within a lesser power lasting 30 seconds.
Spoiler
Event OnEffectStart(Actor akTarget, Actor akCaster)Debug.Notification("Script fired!")RegisterForAnimationEvent(Game.GetPlayer(), "WeaponSwing")EndEventEvent OnAnimationEvent(ObjectReference akSource, String asEventName)if asEventName == "WeaponSwing"Debug.Notification("Ooo it caught the attack!")EndIfEndEvent

As usual thanks for any of your help!
User avatar
[ becca ]
 
Posts: 3514
Joined: Wed Jun 21, 2006 12:59 pm

Post » Sat Nov 17, 2012 1:30 am

Remove the IF (and EndIf) from the second scriptlet ... Do you get a messagebox?

If you do, then the event IS firing, but you probably have the wrong "name"
If you don't, then the event is not firing

At least that should help you move forward ;)
User avatar
Solène We
 
Posts: 3470
Joined: Tue Mar 27, 2007 7:04 am

Post » Sat Nov 17, 2012 4:42 am

I'll try this when I get back from work later, thanks h4vent!
User avatar
Jodie Bardgett
 
Posts: 3491
Joined: Sat Jul 29, 2006 9:38 pm

Post » Sat Nov 17, 2012 1:18 am

I would also suggest taking a look at this thread from earlier today on animation events:
http://www.gamesas.com/index.php?act=findpost&pid=1396987

You might find some of the issues you are going to experience next are already answered.
User avatar
Tha King o Geekz
 
Posts: 3556
Joined: Mon May 07, 2007 9:14 pm

Post » Sat Nov 17, 2012 4:13 am

So I got rid of my if and sure enough the event WAS firing, tried a few different anim events and got nothing that would fire, went back to weaponswing and boom...the event no longer fires...I don't understand. : /

EDIT: Ignore me, I didn't compile my script. #iamamoron
User avatar
Amanda Leis
 
Posts: 3518
Joined: Sun Dec 24, 2006 1:57 am


Return to V - Skyrim