Background for Starfield
Member of the ScriptObject script
voidfunctionUnregisterForHitEvent(ScriptObjectakTarget, ScriptObjectakAggressorFilter=NONE, FormakSourceFilter=NONE, FormakProjectileFilter=NONE, intaiPowerFilter=-1, intaiSneakFilter=-1, intaiBashFilter=-1, intaiBlockFilter=-1, boolabMatch=true)Native

Description

Wiki Description

Unregisters this script from a OnHit event matching the filters given to this function. The filters must match the filters given to the RegisterForHitEvent function.

Only the script that unregisters for an event will stop receiving it. Other scripts attached to the same form, alias, or magic effect will still receive the event if they registered for it separately.

Documentation Comment

Unregister for the specified hit event.


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.

Parameters

  1. ScriptObjectakTarget

    CK Wiki Description

  2. ScriptObjectakAggressorFilter=NONE

    CK Wiki Description

    The filter to use for the aggressor.

    • Default:None
  3. FormakSourceFilter=NONE

    CK Wiki Description

    The filter to use for the source of the hit (weapon usually)

    • Default:None
  4. FormakProjectileFilter=NONE

    CK Wiki Description

    The node on the target to cast the LOS check to. If empty, will cast to the object's root.

    • Default:None
  5. intaiPowerFilter=-1

    CK Wiki Description

    Filter for a power attack

    • Default:-1
  6. intaiSneakFilter=-1

    CK Wiki Description

    Filter for a sneak attack

    • Default:-1
  7. intaiBashFilter=-1

    CK Wiki Description

    Filter for a bash attack

    • Default:-1
  8. intaiBlockFilter=-1

    CK Wiki Description

    Filter for a blocked attack

    • Default:-1
  9. 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

; We no longer care about the player being hit
UnregisterForHitEvent(Game.GetPlayer())
; We no longer care about the player being hit by anything other then the companion alias
RegisterForHitEvent(self, CompanionAlias, abMatch = false)

Auto-Generated Example

ScriptObject myScriptObject__akTarget
ScriptObject myScriptObject__akAggressorFilter
Form myForm__akSourceFilter
Form myForm__akProjectileFilter
int myInt__aiPowerFilter
int myInt__aiSneakFilter
int myInt__aiBashFilter
int myInt__aiBlockFilter
bool myBool__abMatch

myScriptObject__toCallFunctionOn.UnregisterForHitEvent(myScriptObject__akTarget, myScriptObject__akAggressorFilter, myForm__akSourceFilter, myForm__akProjectileFilter, myInt__aiPowerFilter, myInt__aiSneakFilter, myInt__aiBashFilter, myInt__aiBlockFilter, 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.