Event on successful player melee attack Universal OnHit?

Post » Mon Jun 18, 2012 11:39 am

I'm looking for a way to cause a script to run every time the player lands a successful melee hit on any enemy, however the closest thing I can find is "OnHit", which seems to be a script placed on the actor being hit, not the aggressor (i.e. the player), so placing an OnHit script on the Player actor doesn't seem like it could work.

Is there a different event script that I can use on the aggressor of the attack or, less ideally, is there a way to apply a universal Onhit script to every creature in the game?

The Creation Kit is fun to use but when it comes to scripting I feel like I'm lost in an ocean of useless information in a leaky ship :/

I already ran a search of this forum but only came up with semi-related threads which I couldn't really get help from.
User avatar
Lance Vannortwick
 
Posts: 3479
Joined: Thu Sep 27, 2007 5:30 pm

Post » Mon Jun 18, 2012 1:46 pm

No way to do this yet really besides using an enchant or creating a custom crit effect and making crit chance 100% on the weapon.

The problem with this solution is that it overrides enchantments, and it makes criticals no longer part of the game with that weapon.

It used to be very easily doabled via script effect, but they decided (for no good reason that I can see) to change the way scripts attached to weapons work.
User avatar
Laura
 
Posts: 3456
Joined: Sun Sep 10, 2006 7:11 am

Post » Mon Jun 18, 2012 7:54 pm

I'm looking for a way to cause a script to run every time the player lands a successful melee hit on any enemy, however the closest thing I can find is "OnHit", which seems to be a script placed on the actor being hit, not the aggressor (i.e. the player), so placing an OnHit script on the Player actor doesn't seem like it could work.

Is there a different event script that I can use on the aggressor of the attack or, less ideally, is there a way to apply a universal Onhit script to every creature in the game?

The Creation Kit is fun to use but when it comes to scripting I feel like I'm lost in an ocean of useless information in a leaky ship :/

I already ran a search of this forum but only came up with semi-related threads which I couldn't really get help from.

Started a thread earlier - haven't really got anywhere with it, but maybe you can make something of it so far:

http://www.gamesas.com/topic/1346426-effect-on-strike-how-do-i-give-weapons-script-abilities-on-striking-an-enemy/page__fromsearch__1

Have some coding discussions, but can't seem to get them to trigger even though they compile correctly.
User avatar
Stephanie Nieves
 
Posts: 3407
Joined: Mon Apr 02, 2007 10:52 pm


Return to V - Skyrim