ShowOff:OnExplosionHitAnyRef

From GECK
Jump to: navigation, search

An event handler added by the ShowOff NVSE Plugin version 1.80.

Description

This event runs whenever an Explosion hits any reference. It runs before the damage is applied, allowing SetExplosionHitDamage to change the damage that will be applied if called in this event.

GetExplosionHitDamage / SetExplosionHitDamage can only be used from inside this event.

Dispatched Args

GetSelf / GetSelfAlt will return the explosion reference.

The args dispatched to handlers are:

  1. The reference that was hit
  2. The actor reference that is the source of the attack (if any).

Syntax

Use SetEventHandler / SetEventHandlerAlt with the event name "ShowOff:OnExplosionHitAnyRef".

Handler Script

A skeleton handler script for this event:

begin Function { ref rHitRef, ref rSourceActor }

    ref rExplosion = ThisAlt
    printvar rHitRef, rExplosion 

    float fDamage = GetExplosionHitDamage  
    ;* NOTE: if another handler ran before and set the damage, will return that new damage. Use priority system wisely.
    printvar fDamage
    ;SetExplosionHitDamage 0  ; would make the reference take no damage from the explosion if uncommented

end

Example

SetEventHandlerAlt "ShowOff:OnExplosionHitAnyRef" TestShowoffOnExplosionHit

See Also