Difference between revisions of "Talk:Event Handling"

60 bytes removed ,  19:21, 10 April 2015
nope, I was wrong!
imported>JT
(Created page with "== OnHit & OnHitWith == An OnHit event handler with no filter ''will'' trigger when ''any'' object is struck by an attack or projectile, assigning the first parameter to ''an...")
 
imported>JT
(nope, I was wrong!)
Line 1: Line 1:
== OnHit & OnHitWith ==
== OnHit & OnHitWith ==


An OnHit event handler with no filter ''will'' trigger when ''any'' object is struck by an attack or projectile, assigning the first parameter to ''any'' physical object including statics, activators, misc items, doors, containers, etc.  However, unless an ''actor'' was struck, the second parameter (the attacker) will always be nullThis does unfortunately limit the usefulness somewhat.  (I'm not sure if this is actually an NVSE bug or merely "the best we've got", since OnHit on objects in Oblivion only worked for arrows.)
An OnHit event handler with no filter ''will'' trigger when ''any'' object is struck by an attack or projectile, assigning the first parameter to ''any'' physical object including statics, activators, misc items, doors, containers, etc.  However, unless an ''actor'' was struck, the second parameter (the attacker) will be a ''projectile'' if using a ranged attackThe second parameter will still correctly be an ''actor'' if using a melee weapon.


OnHitWith is somewhat more useful in that it ''will'' always trigger for any object, ''and'' will always provide the second parameter for the weapon used by the attacker.  However, it will still not yield which ''actor'' was the attacker, merely the weapon they are using.
OnHitWith is somewhat more useful in that it ''will'' always trigger for any object, ''and'' will always provide the second parameter for the weapon used by the attacker.  However, it will still not yield which ''actor'' was the attacker, merely the weapon they are using.


There is thus no way to determine who caused an impact against an object, although it is entirely possible to determine who caused an impact against a person or creature.
There is thus no way to determine who caused an impact against an object with a ranged weapon, although it is entirely possible to determine who caused an impact against a person or creature.


--[[User:JT|JT]] ([[User talk:JT|talk]]) 18:55, 10 April 2015 (EDT)
--[[User:JT|JT]] ([[User talk:JT|talk]]) 19:21, 10 April 2015 (EDT)
Anonymous user