Every Actor OnHit function, is it possible?

Post » Wed Jun 20, 2012 2:23 pm

Hi,

Is there a way to attach OnHit() on all Actors involved into a fight with the player?

Example:

Scriptname  extends Event OnHit(ObjectReference akAggressor, Form akSource, Projectile akProjectile, bool abPowerAttack, bool abSneakAttack, bool abBashAttack, bool abHitBlocked)	 Actor akAttacker  = (akAggressor as actor)	 Actor akTarget	= akAttacker.GetCombatTarget()	 If (akAttacker != None && akTarget != None)		  If (abHitBlocked == 0)										If (itemType != 9)									  						 If (abBashAttack == true)							  aktarget.DamageAV("", )						 ElseIf (abPowerAttack == true)							  aktarget.DamageAV("", )						 EndIf												 If (akTarget == Game.GetPlayer())							  Debug.Notification("Player got hit...")						 Else							  Debug.Notification("Someone got hit, but it's not the Player...")						 EndIf					 EndIf			EndIf	   EndIfEndEvent

I know how to "attach" OnHit() event to the player (with aliases), but it will trigger only when the player get hit (logic).. now, what I want is to attach the OnHit to everyone so it trigger when the player get hit AND when the player hit someone.

Any idea?
User avatar
Samantha Mitchell
 
Posts: 3459
Joined: Mon Nov 13, 2006 8:33 pm

Post » Wed Jun 20, 2012 2:24 pm

This has come up a lot in this forum. I'm sure you can find a thread. Basically what people have found is that you cannot add an OnHit to everyone in the world, but you can attach one to everyone in a radius around the player. I don't know more than that.
User avatar
Dan Scott
 
Posts: 3373
Joined: Sun Nov 11, 2007 3:45 am

Post » Wed Jun 20, 2012 3:47 pm

Found http://www.gamesas.com/topic/1349649-dynamically-attaching-scripts-to-actors-near-the-player/

Thank You :)
User avatar
Antony Holdsworth
 
Posts: 3387
Joined: Tue May 29, 2007 4:50 am

Post » Wed Jun 20, 2012 10:00 am

Found http://www.gamesas.com/topic/1349649-dynamically-attaching-scripts-to-actors-near-the-player/

Thank You :smile:

No prob brah.
User avatar
Laura Simmonds
 
Posts: 3435
Joined: Wed Aug 16, 2006 10:27 pm


Return to V - Skyrim