ShowOff:OnExplosionHit

From GECK
Jump to: navigation, search

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

Description

This event runs whenever an Explosion hits an Actor. 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 actor 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:OnExplosionHit".

Handler Script

A skeleton handler script for this event:

begin Function { ref rHitActor, ref rSourceActor }

    ref rExplosion = ThisAlt
    printvar rHitActor, 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 actor take no damage from the explosion if uncommented

end

Example

SetEventHandlerAlt "ShowOff:OnExplosionHit" TestShowoffOnExplosionHit

See Also