OnEffectStart - ActiveMagicEffect

From the Fallout4 CreationKit Wiki
Jump to navigation Jump to search

Member of: ActiveMagicEffect Script

Event called when the active magic effect has just started on the specified target.

Syntax[edit | edit source]

Event OnEffectStart(Actor akTarget, Actor akCaster)

Parameters[edit | edit source]

  • akTarget: The Actor this effect was applied to.
  • akCaster: The Actor that cast the spell this effect was from.

Examples[edit | edit source]

Event OnEffectStart(Actor akTarget, Actor akCaster)
  Debug.Trace("Magic effect was started on " + akTarget)
endEvent

Caveat[edit | edit source]

It is possible, that the ActiveMagicEffect ceases to exist immediately (ex: if the actor it's applied to dies the moment the effect starts), so that GetBaseObject() ends up being called on a none object, even in the OnEffectStart() event. If you need to know the MagicEffect such a ActiveMagicEffect is attached to, you'll need to store it as a property on the ActiveMagicEffect script.


See Also[edit | edit source]