OnHit event script for perk not working

Post » Thu Jun 21, 2012 1:03 pm

I'm trying to make silver weapons add spells and such to vampires when they are hit. Silver weapons are handled with a silver perk in the CK and a calculate weapon damage. So I added a script to this perk, with a basic bit of code in it, but I couldn't seem to get it to fire.

Event Onhit()
Debug.notification("script is working")
EndEvent

Even with no conditions on it, it didn't play when I hit anything with a silver sword, nor when my vampire character was struck by a silver hand.

How do I define the victim? In the wiki it has aggressor, but who cares who's swinging the sword? I want to know who my actor victim is. Is my OnHit() too vague? Do I need to specify whom got hit somehow?
User avatar
Celestine Stardust
 
Posts: 3390
Joined: Fri Dec 01, 2006 11:22 pm

Post » Thu Jun 21, 2012 11:27 am

OnHit fires when you are hit: I wish they had called it OnBeingHit. If you want to trap the event of you hitting something, you could attach a script dynamically to it to use its OnHit instead: example http://www.creationkit.com/Dynamically_Attaching_Scripts.
User avatar
Gavin Roberts
 
Posts: 3335
Joined: Fri Jun 08, 2007 8:14 pm


Return to V - Skyrim