Background for Starfield
Member of the ScriptObject script

Description

Wiki Description

Event called when a magic effect is about to be applied to the target.

This event will only be sent to the specific script that registered for it. Other scripts attached to the same form/alias/active magic effect will not receive the event unless they also register.

Documentation Comment

Event received when a magic affect is being applied to the target (after registering)


Caveats

CK Wiki - Notes

  • Aliases and quests will automatically unregister for this event when the quest stops. Active magic effects will automatically unregister when they are removed.
  • This event only fires once, in order to have it fire again, you must re-register.

Parameters

  1. ObjectReferenceakTarget

    CK Wiki Description

    TheObjectReference being hit by the effect.

  2. ObjectReferenceakCaster

    CK Wiki Description

    The MagicEffect that is attempting to be applied.

  3. MagicEffectakEffect


Examples

Event OnMagicEffectApply(ObjectReference akTarget, ObjectReference akCaster, MagicEffect akEffect)
  Debug.Trace(akCaster + " applied the " + akEffect + " on " + akTarget)
EndEvent

Auto-Generated Example

Scriptname MyCoolScript extends ScriptObject

event OnMagicEffectApply(ObjectReference akTarget, ObjectReference akCaster, MagicEffect akEffect)
    Debug.trace("Event received - OnMagicEffectApply: akTarget = " + akTarget + " akCaster = " + akCaster + " akEffect = " + akEffect)
endEvent

Related Pages


Additional References

View this event’s page on the Fallout 4 Creation Kit Wiki

Some data provided by the Fallout 4 Creation Kit Wiki. Licensed under the Creative Commons Attribution-Share Alike 4.0 license.