Jump to content

OnHit clarification request


FlashyJoer

Recommended Posts

Hi all,

 

I have an OnHit event set up that tells me if the player has been hit by an explosion - this works, no problem but I would like to refine it to say by WHAT explosion. Is it possible to limit to 'form akSource' to a specific formid? Many thanks for insight...

 

Right now the script fragment looks like:

 

If akTarget == PlayerREF && (akSource as explosion)

...

Endif

Edited by joerqc
Link to comment
Share on other sites

Explosion Property pcryoMineExplosion Auto Const Mandatory
Explosion Property pfragMineExplosion Auto Const Mandatory

Event OnHit(ObjectReference akTarget, ObjectReference akAggressor, Form akSource, Projectile akProjectile, bool abPowerAttack, \
  bool abSneakAttack, bool abBashAttack, bool abHitBlocked, string apMaterial)
	
	If akTarget == PlayerREF && (akSource as explosion)
		If akSource == pcryoMineExplosion
			Debug.Notification("Brrr... It's chilly in here.")
		ElseIf akSource == pfragMineExplosion
			Debug.Notification("Beep beep beep BOOM!")
		Else
			; Else explosion is not a cryo mine or frag mine...
		EndIf
	Else
		; Else hit was not an explosion on player...
	EndIf

EndEvent

Creation Kit > SpecialEffect > Explosion. Note that exploding objects like cars appear to have 17 variants, but the use count shows the top one is probably the best. If you wanted to check for all variants of cars, all grenades, all mines, etc then you might need to create formlists and search them to refine akSource.

 

 

DQja2HgXUAAbjfx.jpg

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...