Background for Starfield
Member of the ScriptObject script
boolfunctionRegisterForAnimationEvent(ObjectReferenceakSender, stringasEventName)Native

Description

Wiki Description

Registers this active magic effect/alias/form for the specified animation event on the specified reference.

Only the script that registers for an event will receive it. Other scripts attached to the same form, alias, or magic effect will not receive the event unless they also register for it.

Documentation Comment

Register for the specified animation event from the specified object - returns true if it successfully registered


Caveats

CK Wiki - Notes

  • The reference in question must have loaded 3D, otherwise this function will fail
  • Aliases and quests will automatically unregister for this event when the quest stops.
  • Active magic effects will automatically unregister when they are removed.
  • Animation events are always unregistered when the target animation graph unloads. Anything registered will automaticallly get the OnAnimationEventUnregistered event when this happens.

Parameters

  1. ObjectReferenceakSender

    CK Wiki Description

    The ObjectReference we want animation events from.

  2. stringasEventName

    CK Wiki Description

    The event we want from the object.


Examples

; Listen for the "reset" animation event from the object we are attached to
If (!RegisterForAnimationEvent(self, "reset"))
  Debug.Trace("Failed to register for event!")
EndIf

Auto-Generated Example

ObjectReference myObjectReference__akSender
string myString__asEventName

bool returnedValue = myScriptObject__toCallFunctionOn.RegisterForAnimationEvent(myObjectReference__akSender, myString__asEventName)

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.