Background for Fallout 4
Member of the ScriptObject script
eventOnAnimationEvent(ObjectReferenceakSource, stringasEventName)

Description

Wiki Description

Event called when the active magic effect/alias/form receives one of the animation events it was listening for.

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

Animation event, sent when an object we are listening to hits one of the events we are listening for


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. ObjectReferenceakSource

    CK Wiki Description

    The ObjectReference that sent the event.

  2. stringasEventName

    CK Wiki Description

    The event that was received.


Examples

Function SomeFunction()
  RegisterForAnimationEvent(JoeBob, "Reset") ; Before we can use OnAnimationEvent we must register.
EndFunction

Event OnAnimationEvent(ObjectReference akSource, string asEventName)
  if (akSource == self) && (asEventName == "Reset")
    Debug.Trace("We got the reset animation graph event from ourselves that we were looking for!")
  endIf
endEvent

Auto-Generated Example

Scriptname MyCoolScript extends ScriptObject

event OnAnimationEvent(ObjectReference akSource, string asEventName)
    Debug.trace("Event received - OnAnimationEvent: akSource = " + akSource + " asEventName = " + asEventName)
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.