Background for Fallout 4
Member of the ScriptObject script
voidfunctionRegisterForMagicEffectApplyEvent(ScriptObjectakTarget, ScriptObjectakCasterFilter=NONE, FormakEffectFilter=NONE, boolabMatch=true)Native

[DEV SERVER] Loading description...


Caveats

CK Wiki - Notes

  • Registration is removed after the first matching effect. You have to re-register to get another effect apply.
  • Aliases and quests will automatically unregister for this event when the quest stops. Active magic effects will automatically unregister when they are removed.
  • You can be registered for as many different magic effect apply events as you like, but if a magic effect arrives that matches multiple filters it is undefined which filter will be removed from the list.

Parameters

ScriptObjectakTarget

CK Wiki Description

The ObjectReference, ReferenceAlias or RefCollectionAlias that is having the effect applied to them.

ScriptObjectakCasterFilter=NONE

CK Wiki Description

The filter to use for the caster.

  • Default:None
  • Reference or actor:Exact match
  • Base object:Base object match
  • Keyword:Keyword match
  • Faction:Actor in faction match
  • Form list:Containing any of the above (not recursed into)
  • Reference alias:Filling this alias
  • Ref collection alias:Filling this alias
  • None:Anything

FormakEffectFilter=NONE

CK Wiki Description

The filter to use for the magic effect

  • Default:None
  • Magic effect base object:Base object match
  • Keyword:Keyword match
  • Form list:Containing any of the above (not recursed into)
  • None:Anything

boolabMatch=true

CK Wiki Description

If true, the filter must match the hit - if false, the filter must NOT match the hit (inverted filter)

  • Default:true

Examples

; Register for when the player has any effects applied to him
RegisterForMagicEffectApplyEvent(Game.GetPlayer())
; Register for when we are hit by anything OTHER then a flame effect
RegisterForMagicEffectApplyEvent(self, akEffectFilter = FlameEffect, abMatch = false)

Auto-Generated Example

ScriptObject myScriptObject__akTarget
ScriptObject myScriptObject__akCasterFilter
Form myForm__akEffectFilter
bool myBool__abMatch

myScriptObject__toCallFunctionOn.RegisterForMagicEffectApplyEvent(myScriptObject__akTarget, myScriptObject__akCasterFilter, myForm__akEffectFilter, myBool__abMatch)

Related Pages


Additional References

View this function’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.