power bash anim event?

Post » Thu Mar 13, 2014 3:18 pm

I am attempting to make my http://www.nexusmods.com/skyrim/images/399015/? http://www.nexusmods.com/skyrim/images/399320/? launch a magicka absorb effect wave when power-bashing. However, after examining the Auriel's Shield scripts and adapting the Dawnguard Rune Hammer script to my own ends... it seems that I did not figure out the anim event for a powerbash.

I reverted it to a regular bash to just make sure the effect was working at all, and it does... so the problem is not knowing what the power bash anim event is.

Here's my script:

Scriptname ShieldOfMagnusAbsorbBlastSCRIPT extends ActiveMagicEffect  ;derived from Dawnguard Rune Hammer scriptSPELL PROPERTY AbsorbBlast AUTOEVENT OnEffectStart(Actor target, Actor caster)            if(caster == game.getPlayer())        if(RegisterForAnimationEvent(game.getPlayer(), "bashExit") == true)            ;debug.trace("bashExit registered")        endif        endifENDEVENTEVENT OnAnimationEvent(ObjectReference akSource, string asEventName)       if(asEventName == "bashExit")          ;Debug.trace("Magnus Blast!")          ; //cast the Magnus blast          AbsorbBlast.cast(game.getPlayer())    endIfENDEVENTEVENT OnUnload()    UnregisterForAnimationEvent(game.getPlayer(), "bashExit")    ENDEVENT

bashExit works as expected... except that it does it on a normal bash too, not just a powerbash as I want it to. I *thought* it would be bashRelease, but it is not. I cannot use a perk that applies a spell when a powerbash connects, as that only works when the powerbash hits someone, and I want the powerbash to launch a projectile-based spell.

User avatar
James Smart
 
Posts: 3362
Joined: Sun Nov 04, 2007 7:49 pm

Post » Thu Mar 13, 2014 4:32 am

From a quick look at bashbehavior.hkx "SoundPlay.NPCHumanCombatShieldBashPower" seems to be the only animation event that can be used to distinguish a power bash from a normal one. Perhaps this will work:

Scriptname ShieldOfMagnusAbsorbBlastSCRIPT extends ActiveMagicEffect  ;derived from Dawnguard Rune Hammer scriptSPELL PROPERTY AbsorbBlast AUTOEVENT OnEffectStart(Actor target, Actor caster)            if(caster == game.getPlayer())        if(RegisterForAnimationEvent(game.getPlayer(), "SoundPlay.NPCHumanCombatShieldBashPower") == true)            ;debug.trace("Power bash registered")        endif        endifENDEVENTEVENT OnAnimationEvent(ObjectReference akSource, string asEventName)      if(asEventName == "SoundPlay.NPCHumanCombatShieldBashPower")         GoToState("Fire")         if(RegisterForAnimationEvent(game.getPlayer(), "bashExit") == true)            ;debug.trace("bashExit registered")         endif         ;Debug.trace("Power bash!")      endIfENDEVENTEVENT OnUnload()    UnregisterForAnimationEvent(game.getPlayer(), "bashExit")    UnregisterForAnimationEvent(game.getPlayer(), "SoundPlay.NPCHumanCombatShieldBashPower") ENDEVENTState FireEVENT OnAnimationEvent(ObjectReference akSource, string asEventName)       if(asEventName == "bashExit")          ;Debug.trace("Magnus Blast!")          ; //cast the Magnus blast          AbsorbBlast.cast(game.getPlayer())    endIfENDEVENTEndState
User avatar
Gavin Roberts
 
Posts: 3335
Joined: Fri Jun 08, 2007 8:14 pm


Return to V - Skyrim