Tell if player is hit, or blocks a hit

Post » Tue May 21, 2013 10:04 am

Hello, I am new to Skyrim Modding but not to scripting/programming. When searching the script reference, I could not find a function to check if the player successfully blocked a hit, or to tell if he had been hit by an enemy at all. Is there a function for this? If not, what could anyone recommend for a relatively simple way to check this? Thanks.

User avatar
CRuzIta LUVz grlz
 
Posts: 3388
Joined: Fri Aug 24, 2007 11:44 am

Post » Tue May 21, 2013 10:13 am

There is an event that gets triggered from this.

http://www.creationkit.com/OnHit_-_ObjectReference

Create a quest, check the start game enabled box, and then putting the player into a reference alias. Attach a script to the reference alias and it would be something like...

Scriptname _Test_Testscript extends ReferenceAliasEvent OnHit(ObjectReference akAggressor, Form akSource, Projectile akProjectile, bool abPowerAttack, bool abSneakAttack, bool abBashAttack, bool abHitBlocked)    if abHitBlocked        ;the player blocked the attack    else        ;the player didn't block the attack    endIfendEvent
User avatar
Jesus Sanchez
 
Posts: 3455
Joined: Sun Oct 21, 2007 11:15 am

Post » Tue May 21, 2013 5:50 am

Thanks! I'll try this out.

User avatar
trisha punch
 
Posts: 3410
Joined: Thu Jul 13, 2006 5:38 am


Return to V - Skyrim