Difference between revisions of "OnAnimationEvent - ScriptObject"

From the Fallout4 CreationKit Wiki
Jump to navigation Jump to search
imported>Plplecuyer
 
imported>Docclox
m (→‎Examples: The registered animation was inconsistent with asEventName in the OnAnimationEvent example)
Line 20: Line 20:
<source lang="papyrus">
<source lang="papyrus">
Function SomeFunction()
Function SomeFunction()
   RegisterForAnimationEvent(JoeBob, "IdleFurnitureExit") ; Before we can use OnAnimationEvent we must register.
   RegisterForAnimationEvent(JoeBob, "Reset") ; Before we can use OnAnimationEvent we must register.
EndFunction
EndFunction



Revision as of 19:53, 6 June 2016

Member of: ScriptObject

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.

Syntax

Event OnAnimationEvent(ObjectReference akSource, string asEventName)

Parameters

  • akSource: The ObjectReference that sent the event.
  • asEventName: 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

Notes

  • Aliases and quests will automatically unregister for this event when the quest stops. Active magic effects will automatically unregister when they are removed.

See Also